@@ -8353,7 +8353,7 @@ public boolean onTouchEvent(MotionEvent event) {
83538353 }
83548354
83558355 final boolean touchIsFinished = (action == MotionEvent .ACTION_UP ) &&
8356- !shouldIgnoreActionUpEvent () && isFocused ();
8356+ !mIgnoreActionUpEvent && isFocused ();
83578357
83588358 if ((mMovement != null || onCheckIsTextEditor ()) && isEnabled ()
83598359 && mText instanceof Spannable && mLayout != null ) {
@@ -8377,6 +8377,10 @@ public boolean onTouchEvent(MotionEvent event) {
83778377 }
83788378
83798379 if (touchIsFinished && (isTextEditable () || mTextIsSelectable )) {
8380+ // Move cursor
8381+ final int offset = getOffsetForPosition (event .getX (), event .getY ());
8382+ Selection .setSelection ((Spannable ) mText , offset );
8383+
83808384 // Show the IME, except when selecting in read-only text.
83818385 final InputMethodManager imm = InputMethodManager .peekInstance ();
83828386 viewClicked (imm );
@@ -8529,17 +8533,6 @@ public void cancelLongPress() {
85298533 mIgnoreActionUpEvent = true ;
85308534 }
85318535
8532- /**
8533- * This method is only valid during a touch event.
8534- *
8535- * @return true when the ACTION_UP event should be ignored, false otherwise.
8536- *
8537- * @hide
8538- */
8539- public boolean shouldIgnoreActionUpEvent () {
8540- return mIgnoreActionUpEvent ;
8541- }
8542-
85438536 @ Override
85448537 public boolean onTrackballEvent (MotionEvent event ) {
85458538 if (mMovement != null && mText instanceof Spannable &&
@@ -10145,8 +10138,8 @@ private boolean startSelectionActionMode() {
1014510138
1014610139 boolean willExtract = extractedTextModeWillBeStarted ();
1014710140
10148- // Do not start the action mode when extracted text will show up full screen, thus
10149- // immediately hiding the newly created action bar, which would be visually distracting.
10141+ // Do not start the action mode when extracted text will show up full screen, which would
10142+ // immediately hide the newly created action bar and would be visually distracting.
1015010143 if (!willExtract ) {
1015110144 ActionMode .Callback actionModeCallback = new SelectionActionModeCallback ();
1015210145 mSelectionActionMode = startActionMode (actionModeCallback );
0 commit comments