Loading core/java/android/widget/TextView.java +35 −73 Original line number Diff line number Diff line Loading @@ -8596,7 +8596,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private long mTouchTimer; private boolean mIsInsertionHandle = false; private PastePopupMenu mPastePopupWindow; private Runnable mLongPressCallback; // Touch-up filter: number of previous positions remembered private static final int HISTORY_SIZE = 5; Loading Loading @@ -8850,18 +8849,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mLastParentX = coords[0]; mLastParentY = coords[1]; mIsDragging = true; if (mIsInsertionHandle) { mTouchTimer = SystemClock.uptimeMillis(); if (mLongPressCallback == null) { mLongPressCallback = new Runnable() { public void run() { mController.hide(); startSelectionActionMode(); } }; } postDelayed(mLongPressCallback, ViewConfiguration.getLongPressTimeout()); } break; } Loading @@ -8872,21 +8859,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY; mController.updatePosition(this, Math.round(newPosX), Math.round(newPosY)); if (mIsInsertionHandle) { final float dx = rawX - mDownPositionX; final float dy = rawY - mDownPositionY; final float distanceSquared = dx * dx + dy * dy; if (distanceSquared >= mSquaredTouchSlopDistance) { removeLongPressCallback(); } } break; } case MotionEvent.ACTION_UP: if (mIsInsertionHandle) { removeLongPressCallback(); long delay = SystemClock.uptimeMillis() - mTouchTimer; if (delay < ViewConfiguration.getTapTimeout()) { if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) { Loading @@ -8902,10 +8879,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener break; case MotionEvent.ACTION_CANCEL: if (mIsInsertionHandle) { removeLongPressCallback(); } mIsDragging = false; break; } return true; } Loading Loading @@ -8943,16 +8918,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mPastePopupWindow.show(); } } private void removeLongPressCallback() { if (mLongPressCallback != null) { removeCallbacks(mLongPressCallback); } } void onDetached() { removeLongPressCallback(); } } private class InsertionPointCursorController implements CursorController { Loading Loading @@ -9079,9 +9044,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void onDetached() { removeHiderCallback(); removePastePopupCallback(); if (mHandle != null) { mHandle.onDetached(); } } } Loading Loading
core/java/android/widget/TextView.java +35 −73 Original line number Diff line number Diff line Loading @@ -8596,7 +8596,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private long mTouchTimer; private boolean mIsInsertionHandle = false; private PastePopupMenu mPastePopupWindow; private Runnable mLongPressCallback; // Touch-up filter: number of previous positions remembered private static final int HISTORY_SIZE = 5; Loading Loading @@ -8850,18 +8849,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mLastParentX = coords[0]; mLastParentY = coords[1]; mIsDragging = true; if (mIsInsertionHandle) { mTouchTimer = SystemClock.uptimeMillis(); if (mLongPressCallback == null) { mLongPressCallback = new Runnable() { public void run() { mController.hide(); startSelectionActionMode(); } }; } postDelayed(mLongPressCallback, ViewConfiguration.getLongPressTimeout()); } break; } Loading @@ -8872,21 +8859,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY; mController.updatePosition(this, Math.round(newPosX), Math.round(newPosY)); if (mIsInsertionHandle) { final float dx = rawX - mDownPositionX; final float dy = rawY - mDownPositionY; final float distanceSquared = dx * dx + dy * dy; if (distanceSquared >= mSquaredTouchSlopDistance) { removeLongPressCallback(); } } break; } case MotionEvent.ACTION_UP: if (mIsInsertionHandle) { removeLongPressCallback(); long delay = SystemClock.uptimeMillis() - mTouchTimer; if (delay < ViewConfiguration.getTapTimeout()) { if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) { Loading @@ -8902,10 +8879,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener break; case MotionEvent.ACTION_CANCEL: if (mIsInsertionHandle) { removeLongPressCallback(); } mIsDragging = false; break; } return true; } Loading Loading @@ -8943,16 +8918,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mPastePopupWindow.show(); } } private void removeLongPressCallback() { if (mLongPressCallback != null) { removeCallbacks(mLongPressCallback); } } void onDetached() { removeLongPressCallback(); } } private class InsertionPointCursorController implements CursorController { Loading Loading @@ -9079,9 +9044,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void onDetached() { removeHiderCallback(); removePastePopupCallback(); if (mHandle != null) { mHandle.onDetached(); } } } Loading