Skip to content

Modo Mini Player — Design

Gerado pelo Writer (Reversa) em 2026-05-11

Layout

GestureDetector (Gesture.pan → updateDragOffset → commitDragOffset)
  └── Animated.View (useAnimatedStyle → { transform: [{ translateX }, { translateY }] })
       ├── YoutubePlayer (200×112, playing, videoId)
       └── MiniPlayerControls (play/pause, onClose)

useMiniPlayerDrag

  • translatePosition: { transX, transY } via useSharedValue
  • updateDragOffset(x, y) → atualiza translação durante o gesto
  • commitDragOffset() → salva offset final; aplica limites DragLimits
  • resetPosition() → restaura posição inicial (INIT_TOP, INIT_OFFSET)