Merge "Allow KQS to be reopened during the close animation for responsiveness" into main

This commit is contained in:
Schneider Victor-tulias
2024-03-25 18:55:25 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 4 deletions
@@ -94,8 +94,12 @@ public class KeyboardQuickSwitchViewController {
mViewCallbacks);
}
boolean isCloseAnimationRunning() {
return mCloseAnimation != null;
}
protected void closeQuickSwitchView(boolean animate) {
if (mCloseAnimation != null) {
if (isCloseAnimationRunning()) {
// Let currently-running animation finish.
if (!animate) {
mCloseAnimation.end();
@@ -130,7 +134,7 @@ public class KeyboardQuickSwitchViewController {
}
private int launchTaskAt(int index) {
if (mCloseAnimation != null) {
if (isCloseAnimationRunning()) {
// Ignore taps on task views and alt key unpresses while the close animation is running.
return -1;
}
@@ -186,7 +190,7 @@ public class KeyboardQuickSwitchViewController {
pw.println(prefix + "KeyboardQuickSwitchViewController:");
pw.println(prefix + "\thasFocus=" + mKeyboardQuickSwitchView.hasFocus());
pw.println(prefix + "\tcloseAnimationRunning=" + (mCloseAnimation != null));
pw.println(prefix + "\tisCloseAnimationRunning=" + isCloseAnimationRunning());
pw.println(prefix + "\tmCurrentFocusIndex=" + mCurrentFocusIndex);
}