diff options
author | Andrei Stingaceanu <stg@google.com> | 2015-10-21 15:56:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-21 15:56:26 +0000 |
commit | ee4ab0a55b355b21168de0eb5615f2e321c2982f (patch) | |
tree | 04697d4b651d195ce332b72ac3a97a3a621529ea /core | |
parent | 68521fd7ce5e87a4e752569b5691b75d441e8a48 (diff) | |
parent | 2aaeefec92ad70d9797b98caed4b554b982421c8 (diff) | |
download | frameworks_base-ee4ab0a55b355b21168de0eb5615f2e321c2982f.zip frameworks_base-ee4ab0a55b355b21168de0eb5615f2e321c2982f.tar.gz frameworks_base-ee4ab0a55b355b21168de0eb5615f2e321c2982f.tar.bz2 |
Merge "Fix toolbar flickering in ExtractedMode when longpressing." into mnc-dr-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/Editor.java | 20 | ||||
-rw-r--r-- | core/java/android/widget/TextView.java | 18 |
2 files changed, 14 insertions, 24 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 5b042c6..b0dcbb8 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -16,12 +16,6 @@ package android.widget; -import java.text.BreakIterator; -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; - import android.R; import android.annotation.Nullable; import android.app.PendingIntent; @@ -112,6 +106,12 @@ import com.android.internal.util.GrowingArrayUtils; import com.android.internal.util.Preconditions; import com.android.internal.widget.EditableInputConnection; +import java.text.BreakIterator; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; + /** * Helper class used by TextView to handle editable text views. @@ -1004,8 +1004,7 @@ public class Editor { } if (!handled && mTextActionMode != null) { - // TODO: Fix dragging in extracted mode. - if (touchPositionIsInSelection() && !mTextView.isInExtractedMode()) { + if (touchPositionIsInSelection()) { // Start a drag final int start = mTextView.getSelectionStart(); final int end = mTextView.getSelectionEnd(); @@ -4860,9 +4859,8 @@ public class Editor { mEndHandle.showAtLocation(endOffset); // No longer the first dragging motion, reset. - if (!(mTextView.isInExtractedMode())) { - startSelectionActionMode(); - } + startSelectionActionMode(); + mDragAcceleratorActive = false; mStartOffset = -1; mSwitchedLines = false; diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index d8139b8..0c4b60b 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -16,6 +16,8 @@ package android.widget; +import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; + import android.R; import android.annotation.ColorInt; import android.annotation.DrawableRes; @@ -115,14 +117,14 @@ import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; -import android.view.ViewParent; -import android.view.ViewStructure; import android.view.ViewConfiguration; import android.view.ViewDebug; import android.view.ViewGroup.LayoutParams; +import android.view.ViewHierarchyEncoder; +import android.view.ViewParent; import android.view.ViewRootImpl; +import android.view.ViewStructure; import android.view.ViewTreeObserver; -import android.view.ViewHierarchyEncoder; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; @@ -149,8 +151,6 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Locale; -import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; - /** * Displays text to the user and optionally allows them to edit it. A TextView * is a complete text editor, however the basic class is configured to not @@ -5248,14 +5248,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mEditor.mCreatedWithASelection = false; } - // 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 (isInExtractedMode() && hasSelection() && mEditor != null - && mEditor.mTextActionMode == null && isShown() && hasWindowFocus()) { - mEditor.startSelectionActionMode(); - } - unregisterForPreDraw(); return true; |