From 730c238b8dd726f62efe844bdd5b481a96d19b83 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Fri, 12 Jun 2020 00:44:34 -0700 Subject: [PATCH] Call displayCompletions couple frames after selectAll is called Bug: 158710542 Change-Id: I295adce9d84bb82c4af27b7e54693ce4c64004cc --- src/com/android/launcher3/folder/FolderNameEditText.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/folder/FolderNameEditText.java b/src/com/android/launcher3/folder/FolderNameEditText.java index edf2c705e9..6038a053d6 100644 --- a/src/com/android/launcher3/folder/FolderNameEditText.java +++ b/src/com/android/launcher3/folder/FolderNameEditText.java @@ -70,8 +70,11 @@ public class FolderNameEditText extends ExtendedEditText { for (int i = 0; i < cnt; i++) { cInfo[i] = new CompletionInfo(i, i, suggestList.get(i)); } - post(() -> getContext().getSystemService(InputMethodManager.class) - .displayCompletions(this, cInfo)); + // post it to future frame so that onSelectionChanged, onFocusChanged, all other + // TextView flag change and IME animation has settled. Ideally, there should be IMM + // callback to notify when the IME animation and state handling is finished. + postDelayed(() -> getContext().getSystemService(InputMethodManager.class) + .displayCompletions(this, cInfo), 40 /* 2~3 frame delay */); } /**