Consolidate tracking of touch state in Editor (editable TextView)
The goal of these changes is to consolidate the state that needs to be tracked for user motion events (touches, clicks, etc), in order to make it easier to add/update functionality in the future. These changes are intended to fully preserve existing behavior from the user perspective. For the most part, the logic is completely unchanged (just that the code is pulled out), but it's worth calling out the following subtle changes to the logic. These changes don't affect any user-visible behavior. 1) In Editor.onTouchEvent, the recorded position of the last down event is now updated before SelectionModifierCursorController.onTouchEvent() is invoked. 2) In Editor.updateTapState (now in EditorTouchState.update), instead of using SystemClock.uptimeMillis() for the event time, we use event.getEventTime(). Bug: 143852764 Test: Manual testing and unit test atest FrameworksCoreTests:EditorTouchStateTest Change-Id: Ic40b5e53412294d365bc9d787e7013a44fe11ffa
Loading
Please register or sign in to comment