From 975a8d0f4d6b5c2ec954c4db11d95de1a553227e Mon Sep 17 00:00:00 2001 From: Andrei Stingaceanu Date: Tue, 19 May 2015 17:29:16 +0100 Subject: [PATCH] Landscape extracted mode - floating toolbar interference In landscape do not allow starting selection modes if the extracted mode has not yet started. Also remove the single tap selection delayed runnable. This allows for a smooth transition (as in no floating toolbar artifacts) into extracted mode. Also fixes (more as in hides) the double selections. Bug: 20930071 Change-Id: Idb9c375dc25777761b11ca17ccfd9f5eedc642b4 --- core/java/android/widget/Editor.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index c829783e685df..3bb36af8504a5 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -1645,6 +1645,15 @@ public class Editor { * @return true if the selection mode was actually started. */ private boolean startSelectionActionModeWithoutSelection() { + if (extractedTextModeWillBeStarted()) { + // Cancel the single tap delayed runnable. + if (mSelectionModeWithoutSelectionRunnable != null) { + mTextView.removeCallbacks(mSelectionModeWithoutSelectionRunnable); + } + + return false; + } + if (mSelectionActionMode != null) { // Selection action mode is already started // TODO: revisit invocations to minimize this case. @@ -1686,6 +1695,15 @@ public class Editor { } private boolean startSelectionActionModeWithSelectionInternal() { + if (extractedTextModeWillBeStarted()) { + // Cancel the single tap delayed runnable. + if (mSelectionModeWithoutSelectionRunnable != null) { + mTextView.removeCallbacks(mSelectionModeWithoutSelectionRunnable); + } + + return false; + } + if (mSelectionActionMode != null) { // Selection action mode is already started mSelectionActionMode.invalidate();