Skip to content
Commit cd36c5ea authored by Nikita Dubrovsky's avatar Nikita Dubrovsky
Browse files

Suppress cursor drag when the user swipes vertically

When the EditText component is wrapped in a ScrollView or another
scrollable component, vertical scrolling works without any explicit
logic to suppress the cursor drag. But if the EditText component is
not placed in a scrolling container, swiping vertically will trigger a
cursor drag instead of scrolling unless we add some explicit logic to
suppress the drag for vertical swiping.

The change here implements explicit logic to disambiguate dragging the
cursor vs scrolling. This is done using the following heuristic: the
swipe direction angle must be greater than 30 degrees from vertical in
order to trigger the cursor drag. Otherwise the existing handlers will
pick up the gesture (e.g. scrolling).

Bug: 143852764, 145833335
Test: Manual and unit tests
  atest FrameworksCoreTests:EditorCursorDragTest

Change-Id: Ibc5b2317e06cc36b221609c716c858ad0a70d577
parent 9a1369b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment