Repository navigation
fix: a swipe from the screen edge no longer opens the menu (#213) - #216
Conversation
GestureDetector confirms a single tap from a down and an up with no move between, wherever the up is: when the system keeps the moves of its edge swipe (status bar), the app saw a tap and opened the menu. TapGuard follows every touch sequence in Activity.dispatchTouchEvent; the menu opens on a touch only when the sequence started outside the edge zone (the larger of the system gesture insets, Android 10+, and a fixed band of 24 dp top/bottom and 16 dp left/right), the finger stayed within the touch slop (up included), with one finger and no cancel. Applies to the single view, the grid cells and the U hint; keys (remote, D-pad) are unchanged. Version 2.13 (38). Fixes #213
PR Summary by QodoPrevent edge swipes from opening the decoder menu
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
…bility click (Qodo on #216) - TapGuard answers for the last finished sequence (up or cancel), so a tap confirmed late by GestureDetector, or a click posted after the up, is not judged by a new touch that has just begun. - Cells and the U hint gate only clicks that come from a touch's up (clickFromTouch, cleared after the posted click); key, accessibility and programmatic clicks open the menu as before, also in touch mode.
|
Qodo findings 1 and 2 addressed in 8d51e2e (Qodo: both resolved, 0 open). Device check, TECNO KM4 (Android 15, 3-button nav), CI APK of 8d51e2e (2.13), single view:
Pinch/pan can't be simulated over adb; still needs a finger check. |
|
Pinch-zoom and pan checked by hand on the TECNO KM4 with this build: they work as before. |
Fixes #213
Cause.
GestureDetectorconfirms a single tap fromACTION_DOWNandACTION_UPwith noACTION_MOVEpast the touch slop between them — it never looks at where the up is. When the system keeps the moves of its edge swipe (status bar pull), the app sees a down and a far-away up and opens the menu. Reproduced on the TECNO KM4 withinput motionevent DOWN 800 0+UP 800 400(menu opened on 2.11).Fix.
TapGuardfollows every touch sequence inActivity.dispatchTouchEvent(before the views see it). A touch opens the menu only when the sequencegetInsets(systemGestures())on Android 11+,getSystemGestureInsets()on 10, from the decor's insets listener) and a fixed band of 24 dp top/bottom, 16 dp left/right;Applies to the single view (
onSingleTapConfirmed), the grid cells and the U hint (theironClick). Pinch, pan, double tap (zoom reset) and long press are unchanged. Keys (remote, D-pad) do not pass throughdispatchTouchEvent; a cell's click from a key (not in touch mode) still opens the menu.startsInEdgeZone/edgeZoneand the sequence logic are pure Java with unit tests (TapGuardTest).Version 2.13 (38).