Loading core/java/android/widget/Editor.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -1756,6 +1756,12 @@ public class Editor { if (!checkFieldAndSelectCurrentWord()) { if (!checkFieldAndSelectCurrentWord()) { return false; return false; } } // Avoid dismissing the selection if it exists. mPreserveDetachedSelection = true; stopTextActionMode(); mPreserveDetachedSelection = false; getSelectionController().enterDrag(); getSelectionController().enterDrag(); return true; return true; } } Loading Loading @@ -3129,7 +3135,9 @@ public class Editor { Callback customCallback = getCustomCallback(); Callback customCallback = getCustomCallback(); if (customCallback != null) { if (customCallback != null) { if (!customCallback.onCreateActionMode(mode, menu)) { if (!customCallback.onCreateActionMode(mode, menu)) { // The custom mode can choose to cancel the action mode // The custom mode can choose to cancel the action mode, dismiss selection. Selection.setSelection((Spannable) mTextView.getText(), mTextView.getSelectionEnd()); return false; return false; } } } } Loading core/java/android/widget/TextView.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -9072,9 +9072,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener switch (id) { switch (id) { case ID_SELECT_ALL: case ID_SELECT_ALL: // This does not enter text selection mode. Text is highlighted, so that it can be // This starts an action mode if triggered from another action mode. Text is // bulk edited, like selectAllOnFocus does. Returns true even if text is empty. // highlighted, so that it can be bulk edited, like selectAllOnFocus does. Returns // true even if text is empty. boolean shouldRestartActionMode = mEditor != null && mEditor.mTextActionMode != null; stopTextActionMode(); selectAllText(); selectAllText(); if (shouldRestartActionMode) { mEditor.startSelectionActionMode(); } return true; return true; case ID_UNDO: case ID_UNDO: Loading Loading
core/java/android/widget/Editor.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -1756,6 +1756,12 @@ public class Editor { if (!checkFieldAndSelectCurrentWord()) { if (!checkFieldAndSelectCurrentWord()) { return false; return false; } } // Avoid dismissing the selection if it exists. mPreserveDetachedSelection = true; stopTextActionMode(); mPreserveDetachedSelection = false; getSelectionController().enterDrag(); getSelectionController().enterDrag(); return true; return true; } } Loading Loading @@ -3129,7 +3135,9 @@ public class Editor { Callback customCallback = getCustomCallback(); Callback customCallback = getCustomCallback(); if (customCallback != null) { if (customCallback != null) { if (!customCallback.onCreateActionMode(mode, menu)) { if (!customCallback.onCreateActionMode(mode, menu)) { // The custom mode can choose to cancel the action mode // The custom mode can choose to cancel the action mode, dismiss selection. Selection.setSelection((Spannable) mTextView.getText(), mTextView.getSelectionEnd()); return false; return false; } } } } Loading
core/java/android/widget/TextView.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -9072,9 +9072,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener switch (id) { switch (id) { case ID_SELECT_ALL: case ID_SELECT_ALL: // This does not enter text selection mode. Text is highlighted, so that it can be // This starts an action mode if triggered from another action mode. Text is // bulk edited, like selectAllOnFocus does. Returns true even if text is empty. // highlighted, so that it can be bulk edited, like selectAllOnFocus does. Returns // true even if text is empty. boolean shouldRestartActionMode = mEditor != null && mEditor.mTextActionMode != null; stopTextActionMode(); selectAllText(); selectAllText(); if (shouldRestartActionMode) { mEditor.startSelectionActionMode(); } return true; return true; case ID_UNDO: case ID_UNDO: Loading