Commit 2354af1
authored
ADFA-4320 Paper cut: Fix for swiping bottom sheet tabs incorrectly opening file menu (#1390)
* Fix for swiping bottom sheet tabs incorrectly opening file menu
* ADFA-4320 Skip drawer fling-open when swiping bottom sheet tabs
Tab-strip flings have enough horizontal velocity to trigger the editor
activity's drawer-open gesture detector, opening the file tree when the
user is just navigating between bottom-pane tabs.
In dispatchTouchEvent, check on ACTION_DOWN whether the touch falls
inside the bottom sheet TabLayout's global visible rect; if so, stop
forwarding the touch sequence to the gesture detector. The hamburger
button and the existing no-files horizontal-fling shortcut remain
untouched.
Reverts the bottom-sheet-state drawer lock from da1e435 — that
approach broke the hamburger because ActionBarDrawerToggle treats
LOCK_MODE_LOCKED_CLOSED as "do not open" and the lock also fired on
gestures outside the tab strip.
* ADFA-4320 Move tab-strip check into onFling and harden against teardown
Code review surfaced three issues with the previous implementation:
1. content.bottomSheet.binding.tabs reads a binding chain whose root
getter throws IllegalStateException once _binding is cleared in
preDestroy. Touches dispatched between preDestroy and window
teardown would crash. Switched to contentOrNull, the file's existing
defensive helper.
2. The dispatchTouchEvent flag was set only on ACTION_DOWN, so
ACTION_POINTER_DOWN (multi-touch) could not re-evaluate it; a second
finger could leak past or stay stuck-suppressed.
3. The check belonged with the other fling filters (startedNearTopEdge,
noFilesOpen, etc.) in onFling, not in dispatchTouchEvent — and onFling
already tracks the down event as e1, so no extra state is needed.
Folded the check into the isDrawerOpenFling branch using e1. Dropped
suppressDrawerGesture and bottomSheetTabsHitRect fields; restored
dispatchTouchEvent to its pre-PR form. The hit-test now runs only when
a drawer-open fling is actually detected, not on every ACTION_DOWN.1 parent 698df84 commit 2354af1
1 file changed
Lines changed: 11 additions & 1 deletion
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
1652 | 1653 | | |
1653 | 1654 | | |
1654 | 1655 | | |
1655 | | - | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
1656 | 1659 | | |
1657 | 1660 | | |
1658 | 1661 | | |
| |||
1672 | 1675 | | |
1673 | 1676 | | |
1674 | 1677 | | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
1675 | 1685 | | |
1676 | 1686 | | |
1677 | 1687 | | |
| |||
0 commit comments