diff options
author | Clara Bayarri <clarabayarri@google.com> | 2015-03-19 00:04:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-19 00:04:37 +0000 |
commit | 6820434edde7354e9414e4ebe2923021db1a4361 (patch) | |
tree | 3c09c6afa452b47b050bb58b42fa5385d8947435 /core/java/android/widget | |
parent | 9504a9d90b81b9b9befd0008f8b862bef6bbc803 (diff) | |
parent | 6351e660142a2319c142346628f131c494ded99c (diff) | |
download | frameworks_base-6820434edde7354e9414e4ebe2923021db1a4361.zip frameworks_base-6820434edde7354e9414e4ebe2923021db1a4361.tar.gz frameworks_base-6820434edde7354e9414e4ebe2923021db1a4361.tar.bz2 |
Merge "Editor: Avoid the paste popup from coming up when a word is selected."
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/Editor.java | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 51066e8..fd34415 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -1666,6 +1666,7 @@ public class Editor { private boolean startSelectionActionModeWithoutSelection() { if (mSelectionActionMode != null) { // Selection action mode is already started + // TODO: revisit invocations to minimize this case. return false; } ActionMode.Callback actionModeCallback = new SelectionActionModeCallback(); @@ -3339,14 +3340,10 @@ public class Editor { private float mIdealVerticalOffset; // Parent's (TextView) previous position in window private int mLastParentX, mLastParentY; - // Transient action popup window for Paste and Replace actions - protected ActionPopupWindow mActionPopupWindow; // Previous text character offset private int mPreviousOffset = -1; // Previous text character offset private boolean mPositionHasChanged = true; - // Used to delay the appearance of the action popup window - private Runnable mActionPopupShower; // Minimum touch target size for handles private int mMinSize; // Indicates the line of text that the handle is on. @@ -3448,8 +3445,6 @@ public class Editor { // Make sure the offset is always considered new, even when focusing at same position mPreviousOffset = -1; positionAtCursorOffset(getCurrentCursorOffset(), false); - - hideActionPopupWindow(); } protected void dismiss() { @@ -3464,31 +3459,6 @@ public class Editor { getPositionListener().removeSubscriber(this); } - void showActionPopupWindow(int delay) { - if (mActionPopupWindow == null) { - mActionPopupWindow = new ActionPopupWindow(); - } - if (mActionPopupShower == null) { - mActionPopupShower = new Runnable() { - public void run() { - mActionPopupWindow.show(); - } - }; - } else { - mTextView.removeCallbacks(mActionPopupShower); - } - mTextView.postDelayed(mActionPopupShower, delay); - } - - protected void hideActionPopupWindow() { - if (mActionPopupShower != null) { - mTextView.removeCallbacks(mActionPopupShower); - } - if (mActionPopupWindow != null) { - mActionPopupWindow.hide(); - } - } - public boolean isShowing() { return mContainer.isShowing(); } @@ -3689,13 +3659,9 @@ public class Editor { return mIsDragging; } - void onHandleMoved() { - hideActionPopupWindow(); - } + void onHandleMoved() {} - public void onDetached() { - hideActionPopupWindow(); - } + public void onDetached() {} } private class InsertionHandleView extends HandleView { @@ -3923,10 +3889,6 @@ public class Editor { } } - public ActionPopupWindow getActionPopupWindow() { - return mActionPopupWindow; - } - @Override public boolean onTouchEvent(MotionEvent event) { boolean superResult = super.onTouchEvent(event); @@ -4027,10 +3989,6 @@ public class Editor { } } - public void setActionPopupWindow(ActionPopupWindow actionPopupWindow) { - mActionPopupWindow = actionPopupWindow; - } - @Override public boolean onTouchEvent(MotionEvent event) { boolean superResult = super.onTouchEvent(event); @@ -4159,11 +4117,6 @@ public class Editor { mStartHandle.show(); mEndHandle.show(); - // Make sure both left and right handles share the same ActionPopupWindow (so that - // moving any of the handles hides the action popup). - mStartHandle.showActionPopupWindow(DELAY_BEFORE_REPLACE_ACTION); - mEndHandle.setActionPopupWindow(mStartHandle.getActionPopupWindow()); - hideInsertionPointCursorController(); } |