am bc687f96: Merge "Drag handles persist after lost focus in extracted mode" into mnc-dev

* commit 'bc687f96c74bd164f5d030cebe80d38274ca336c':
  Drag handles persist after lost focus in extracted mode
This commit is contained in:
Andrei Stingaceanu
2015-07-07 15:49:34 +00:00
committed by Android Git Automerger
2 changed files with 7 additions and 4 deletions

View File

@@ -1121,7 +1121,6 @@ public class Editor {
if (mTemporaryDetach) mPreserveDetachedSelection = false; if (mTemporaryDetach) mPreserveDetachedSelection = false;
downgradeEasyCorrectionSpans(); downgradeEasyCorrectionSpans();
} }
// No need to create the controller // No need to create the controller
if (mSelectionModifierCursorController != null) { if (mSelectionModifierCursorController != null) {
mSelectionModifierCursorController.resetTouchOffsets(); mSelectionModifierCursorController.resetTouchOffsets();
@@ -1793,7 +1792,7 @@ public class Editor {
* *
* @return true if there already was a selection or if the current word was selected. * @return true if there already was a selection or if the current word was selected.
*/ */
private boolean checkFieldAndSelectCurrentWord() { boolean checkFieldAndSelectCurrentWord() {
if (!mTextView.canSelectText() || !mTextView.requestFocus()) { if (!mTextView.canSelectText() || !mTextView.requestFocus()) {
Log.w(TextView.LOG_TAG, Log.w(TextView.LOG_TAG,
"TextView does not support text selection. Selection cancelled."); "TextView does not support text selection. Selection cancelled.");
@@ -1840,7 +1839,7 @@ public class Editor {
return selectionStarted; return selectionStarted;
} }
private boolean extractedTextModeWillBeStarted() { boolean extractedTextModeWillBeStarted() {
if (!(mTextView.isInExtractedMode())) { if (!(mTextView.isInExtractedMode())) {
final InputMethodManager imm = InputMethodManager.peekInstance(); final InputMethodManager imm = InputMethodManager.peekInstance();
return imm != null && imm.isFullscreenMode(); return imm != null && imm.isFullscreenMode();

View File

@@ -5232,7 +5232,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// - onFocusChanged cannot start it when focus is given to a view with selected text (after // - onFocusChanged cannot start it when focus is given to a view with selected text (after
// a screen rotation) since layout is not yet initialized at that point. // a screen rotation) since layout is not yet initialized at that point.
if (mEditor != null && mEditor.mCreatedWithASelection) { if (mEditor != null && mEditor.mCreatedWithASelection) {
mEditor.startSelectionActionMode(); if (mEditor.extractedTextModeWillBeStarted()) {
mEditor.checkFieldAndSelectCurrentWord();
} else {
mEditor.startSelectionActionMode();
}
mEditor.mCreatedWithASelection = false; mEditor.mCreatedWithASelection = false;
} }