From c6fad96b5926aa8861f49a7f4725dd7657322758 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Mon, 2 May 2016 15:11:41 +0900 Subject: [PATCH] Show drag handles after finishing batch edit if needed. Drag handles are blocked from being shown if batch edit mode is active when onPreDraw is called; however, IME can start and end batch edit mode regardless of onPreDraw timing. As a result, drag handles are sometimes not shown even if selection is created and text action mode is started. With this CL, drag handles are shown after finishing batch edit mode if the handles were blocked from being shown in the above case. Bug: 28366507 Change-Id: I7f099d0626bee70a63bb14bc75eefc2551a52d53 --- core/java/android/widget/Editor.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 106fec0fde825..94fc1f85ae1ab 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -1465,6 +1465,16 @@ public class Editor { // sendUpdateSelection knows to avoid sending if the selection did // not actually change. sendUpdateSelection(); + + // Show drag handles if they were blocked by batch edit mode. + if (mTextActionMode != null) { + final CursorController cursorController = mTextView.hasSelection() ? + getSelectionController() : getInsertionController(); + if (cursorController != null && !cursorController.isActive() + && !cursorController.isCursorBeingModified()) { + cursorController.show(); + } + } } static final int EXTRACT_NOTHING = -2;