Skip to content

feat(duo): add punch-hole cutout touch gestures with haptic feedback - #957

Open
Balajitechlabs wants to merge 2 commits into
sameerasw:developfrom
Balajitechlabs:feat/duo-cutout-touch-gestures
Open

feat(duo): add punch-hole cutout touch gestures with haptic feedback#957
Balajitechlabs wants to merge 2 commits into
sameerasw:developfrom
Balajitechlabs:feat/duo-cutout-touch-gestures

Conversation

@Balajitechlabs

Copy link
Copy Markdown
Contributor

Context

Turns the physical camera punch-hole cutout into an interactive tactile touch surface for quick media playback control, flashlight toggling, and global navigation actions without obstructing any surrounding UI or status bar elements.

What's included

  • Dual-window architecture:
    • DuoOverlayView remains a fullscreen FLAG_NOT_TOUCHABLE drawing canvas.
    • DuoTouchAnchorView is a lightweight circular touch target positioned directly over (cameraCenterX, cameraCenterY).
    • Sub-pixel circular hit-testing (dx^2 + dy^2 <= r^2) ensures touches outside the camera cutout circle pass directly through to underlying apps.
    • Automatically detaches when fullscreen video plays or screen turns off to prevent accidental touches.
  • Context-aware actions:
    • Single tap: Toggles play/pause when media is active, turns off flashlight if active, or triggers configured idle action (Notification shade, screenshot, flashlight, or none).
    • Double tap: Skips to the next track when media is playing, or triggers configured action (Lock screen, recents, etc.).
    • Long press: Brings active music app (Spotify/YouTube Music) to foreground, or toggles flashlight when idle.
    • Horizontal swipe: Skips next track (swipe right) or previous track (swipe left).
  • Tactile feedback:
    • Spring micro-bounce animation on touch.
    • Optional vibration feedback tick on tap (Vibrate on touch).
  • Settings UI:
    • M3 Expressive "Gestures" settings card in Duo settings with action dropdowns.

Verification

  • Built cleanly with ./gradlew :app:assembleDebug --no-daemon (0 warnings, 0 errors).
  • Stream-installed and verified on a physical Android device (Vivo V2513).

Signed-off-by: balajitechlabs <212744006+Balajitechlabs@users.noreply.github.com>

@thenuker123 thenuker123 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm looks good I will tell @sameerasw to double check it and he will probably merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants