am 00afa11c: am 0538e621: Merge "Tap timeout removed on paste. Relying on position only." into honeycomb-mr2

* commit '00afa11c1565da7ad6721db08a4da7c2ec1eacc0':
  Tap timeout removed on paste. Relying on position only.
This commit is contained in:
Gilles Debunne
2011-06-03 10:35:58 -07:00
committed by Android Git Automerger

View File

@@ -5236,6 +5236,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
* @param text The auto complete text the user has selected. * @param text The auto complete text the user has selected.
*/ */
public void onCommitCompletion(CompletionInfo text) { public void onCommitCompletion(CompletionInfo text) {
// Intentionally empty
} }
/** /**
@@ -8660,8 +8661,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
private boolean mIsActive = false; private boolean mIsActive = false;
// The insertion handle can have an associated PastePopupMenu // The insertion handle can have an associated PastePopupMenu
private boolean mIsInsertionHandle = false; private boolean mIsInsertionHandle = false;
// Used to detect taps on the insertion handle, which will affect the PastePopupMenu
private long mTouchTimer;
private PastePopupMenu mPastePopupWindow; private PastePopupMenu mPastePopupWindow;
// Touch-up filter: number of previous positions remembered // Touch-up filter: number of previous positions remembered
@@ -8932,9 +8931,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
mLastParentX = coords[0]; mLastParentX = coords[0];
mLastParentY = coords[1]; mLastParentY = coords[1];
mIsDragging = true; mIsDragging = true;
if (mIsInsertionHandle) {
mTouchTimer = SystemClock.uptimeMillis();
}
break; break;
} }
@@ -8964,18 +8960,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
if (mIsInsertionHandle) { if (mIsInsertionHandle) {
long delay = SystemClock.uptimeMillis() - mTouchTimer; final float deltaX = mDownPositionX - ev.getRawX();
if (delay < ViewConfiguration.getTapTimeout()) { final float deltaY = mDownPositionY - ev.getRawY();
final float deltaX = mDownPositionX - ev.getRawX(); final float distanceSquared = deltaX * deltaX + deltaY * deltaY;
final float deltaY = mDownPositionY - ev.getRawY(); if (distanceSquared < mSquaredTouchSlopDistance) {
final float distanceSquared = deltaX * deltaX + deltaY * deltaY; if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) {
if (distanceSquared < mSquaredTouchSlopDistance) { // Tapping on the handle dismisses the displayed paste view,
if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) { mPastePopupWindow.hide();
// Tapping on the handle dismisses the displayed paste view, } else {
mPastePopupWindow.hide(); ((InsertionPointCursorController) mController).show(0);
} else {
((InsertionPointCursorController) mController).show(0);
}
} }
} }
} }
@@ -9360,7 +9353,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
} }
@Override @Override
public void onDetached() {} public void onDetached() {
// Nothing to do
}
} }
private void hideInsertionPointCursorController() { private void hideInsertionPointCursorController() {