OSDN Git Service

Patches for the Paste window behavior.
authorGilles Debunne <debunne@google.com>
Mon, 31 Jan 2011 23:00:08 +0000 (15:00 -0800)
committerGilles Debunne <debunne@google.com>
Mon, 31 Jan 2011 23:20:50 +0000 (15:20 -0800)
Bug 3409440

Change-Id: Id266bb83aa6e1912817995881daa9c24a1553c32

core/java/android/widget/TextView.java

index eee042a..c500db3 100644 (file)
@@ -7358,7 +7358,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
 
                     stopSelectionActionMode();
                     boolean selectAllGotFocus = mSelectAllOnFocus && mTouchFocusSelected;
-                    if (hasInsertionController() && !selectAllGotFocus) {
+                    if (hasInsertionController() && !selectAllGotFocus && mText.length() > 0) {
                         getInsertionController().show();
                     }
                 }
@@ -8881,6 +8881,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                     mLastParentX = coords[0];
                     mLastParentY = coords[1];
                     mIsDragging = true;
+                    if (mIsInsertionHandle) {
+                        mTouchTimer = SystemClock.uptimeMillis();
+                    }
                     break;
                 }
 
@@ -9029,6 +9032,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
 
             if (offset != previousOffset) {
                 updateOffset(handle, offset);
+                removePastePopupCallback();
             }
             hideDelayed();
         }