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

Handle ACTION_CANCEL in EditorTouchState (editable TextView)

When testDragAndDrop_longClick() performs the long-press, the events
triggered are ACTION_DOWN, ACTION_CANCEL, ACTION_DOWN, ACTION_CANCEL.
It's not clear why there is the additional ACTION_DOWN / ACTION_CANCEL
pair; performing the same gesture manually only produces a single
ACTION_DOWN / ACTION_CANCEL pair. Still, Editor should be able to handle
this scenario since ACTION_CANCEL is a valid event.

Previously there was no handling for ACTION_CANCEL in EditorTouchState
at all, so the sequence of events triggered by the test would end up
getting treated as a double-tap scenario and drag-and-drop would not be
started.

This CL adds handling for ACTION_CANCEL in EditorTouchState, attempting
to follow GestureDetector as closely as possible (essentially resetting
state whenever ACTION_CANCEL is received, so that subsequent events
start a "fresh sequence").

Bug: 29591177
Test: Manual and ran tests
  atest FrameworksCoreTests:TextViewActivityMouseTest
  atest FrameworksCoreTests:TextViewActivityTest
  atest FrameworksCoreTests:EditorTouchStateTest
  atest FrameworksCoreTests:EditorCursorDragTest

Change-Id: Ia0ee531af64083a4f670842188bdc7e35b617397
parent 4dca994b
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