diff options
| author | 2015-03-18 23:02:57 +0000 | |
|---|---|---|
| committer | 2015-03-18 23:02:58 +0000 | |
| commit | 10ff56ec6d402a69f53ee899e54e3c1de7bf3b1a (patch) | |
| tree | e784c180f1648c86355f4b6c2dfe3dcc7fc142e6 | |
| parent | ac66a3261131eb82412a405675e5a5c665a6a2c9 (diff) | |
| parent | 452fa75207404f5cf4a0a6963d1dc9455e8f4b8e (diff) | |
Merge "Editor: Make the Insertion handle start/finish the selection action mode on tap."
| -rw-r--r-- | core/java/android/widget/Editor.java | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 6d7a547c4122..7d3c9c9f098e 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -3702,7 +3702,7 @@ public class Editor { private static final int DELAY_BEFORE_HANDLE_FADES_OUT = 4000; private static final int RECENT_CUT_COPY_DURATION = 15 * 1000; // seconds - // Used to detect taps on the insertion handle, which will affect the ActionPopupWindow + // Used to detect taps on the insertion handle, which will affect the selection action mode private float mDownPositionX, mDownPositionY; private Runnable mHider; @@ -3717,17 +3717,12 @@ public class Editor { final long durationSinceCutOrCopy = SystemClock.uptimeMillis() - TextView.LAST_CUT_OR_COPY_TIME; if (durationSinceCutOrCopy < RECENT_CUT_COPY_DURATION) { - showActionPopupWindow(0); + startSelectionActionModeWithoutSelection(); } hideAfterDelay(); } - public void showWithActionPopup() { - show(); - showActionPopupWindow(0); - } - private void hideAfterDelay() { if (mHider == null) { mHider = new Runnable() { @@ -3789,11 +3784,11 @@ public class Editor { final int touchSlop = viewConfiguration.getScaledTouchSlop(); if (distanceSquared < touchSlop * touchSlop) { - if (mActionPopupWindow != null && mActionPopupWindow.isShowing()) { - // Tapping on the handle dismisses the displayed action popup - mActionPopupWindow.hide(); + // Tapping on the handle toggles the selection action mode. + if (mSelectionActionMode != null) { + mSelectionActionMode.finish(); } else { - showWithActionPopup(); + startSelectionActionModeWithoutSelection(); } } } @@ -4078,10 +4073,6 @@ public class Editor { getHandle().show(); } - public void showWithActionPopup() { - getHandle().showWithActionPopup(); - } - public void hide() { if (mHandle != null) { mHandle.hide(); |