From 1cb1f1523a927bba670f36adea57106a0f61c07c Mon Sep 17 00:00:00 2001 From: Andrei Stingaceanu Date: Wed, 24 Jun 2015 11:56:43 +0100 Subject: [PATCH] EditText - can not drag handles in extracted mode In TextView's onPreDraw method, startSelectionActionMode() is called, but the selection has already been started so in startSelectionActionMode() it shows the insertionController which hides the selectionController. Fix this by adding a check to start the action mode only if it is not already started. Bug: 22028858 Change-Id: I2999423155b7a63a7d879bc8ea5032e17dff459f --- core/java/android/widget/TextView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index e84ba9968de74..77e5b10f54645 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -5230,7 +5230,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // Phone specific code (there is no ExtractEditText on tablets). // ExtractEditText does not call onFocus when it is displayed, and mHasSelectionOnFocus can // not be set. Do the test here instead. - if (this instanceof ExtractEditText && hasSelection() && mEditor != null) { + if (isInExtractedMode() && hasSelection() && mEditor != null + && mEditor.mTextActionMode == null) { mEditor.startSelectionActionMode(); }