Call displayCompletions couple frames after selectAll is called

Bug: 158710542

Change-Id: I295adce9d84bb82c4af27b7e54693ce4c64004cc
This commit is contained in:
Hyunyoung Song
2020-06-12 00:44:34 -07:00
parent 946696124a
commit 730c238b8d
@@ -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 */);
}
/**