Merge "Do not invoke textclassifier when dimissing the selection" into sc-dev

This commit is contained in:
Tony Mak
2021-02-03 12:28:14 +00:00
committed by Android (Google) Code Review

View File

@@ -1705,15 +1705,23 @@ public class Editor {
}
private void updateFloatingToolbarVisibility(MotionEvent event) {
if (mTextActionMode != null) {
switch (event.getActionMasked()) {
case MotionEvent.ACTION_MOVE:
hideFloatingToolbar(ActionMode.DEFAULT_HIDE_DURATION);
break;
case MotionEvent.ACTION_UP: // fall through
case MotionEvent.ACTION_CANCEL:
if (mTextActionMode == null) {
return;
}
switch (event.getActionMasked()) {
case MotionEvent.ACTION_MOVE:
hideFloatingToolbar(ActionMode.DEFAULT_HIDE_DURATION);
break;
case MotionEvent.ACTION_UP: // fall through
case MotionEvent.ACTION_CANCEL:
final SelectionModifierCursorController selectionController =
getSelectionController();
final InsertionPointCursorController insertionController = getInsertionController();
if ((selectionController != null && selectionController.isCursorBeingModified())
|| (insertionController != null
&& insertionController.isCursorBeingModified())) {
showFloatingToolbar();
}
}
}
}