Loading core/java/android/widget/Editor.java +3 −50 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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. Loading Loading @@ -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() { Loading @@ -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(); } Loading Loading @@ -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 { Loading Loading @@ -3923,10 +3889,6 @@ public class Editor { } } public ActionPopupWindow getActionPopupWindow() { return mActionPopupWindow; } @Override public boolean onTouchEvent(MotionEvent event) { boolean superResult = super.onTouchEvent(event); Loading Loading @@ -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); Loading Loading @@ -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(); } Loading Loading
core/java/android/widget/Editor.java +3 −50 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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. Loading Loading @@ -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() { Loading @@ -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(); } Loading Loading @@ -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 { Loading Loading @@ -3923,10 +3889,6 @@ public class Editor { } } public ActionPopupWindow getActionPopupWindow() { return mActionPopupWindow; } @Override public boolean onTouchEvent(MotionEvent event) { boolean superResult = super.onTouchEvent(event); Loading Loading @@ -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); Loading Loading @@ -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(); } Loading