Delay showing task bar until the user releases their finger dragging from all apps to normal

Fixes: 208802276
Test: drag from all apps to normal, and the task bar doesn't stash until the user releases their finger
Change-Id: I53133cc80749bdc62e77d858b5714ae32facbd1d
This commit is contained in:
Tracy Zhou
2021-12-12 11:16:29 +08:00
parent 434d537725
commit bec00acf28
3 changed files with 36 additions and 1 deletions

View File

@@ -73,6 +73,8 @@ import java.util.function.Supplier;
private boolean mIsAnimatingToLauncherViaGesture;
private boolean mIsAnimatingToLauncherViaResume;
private boolean mShouldDelayLauncherStateAnim;
private final StateManager.StateListener<LauncherState> mStateListener =
new StateManager.StateListener<LauncherState>() {
@@ -85,7 +87,9 @@ import java.util.function.Supplier;
mLauncherState = toState;
}
updateStateForFlag(FLAG_TRANSITION_STATE_RUNNING, true);
applyState();
if (!mShouldDelayLauncherStateAnim) {
applyState();
}
}
@Override
@@ -153,6 +157,15 @@ import java.util.function.Supplier;
return mIsAnimatingToLauncherViaResume || mIsAnimatingToLauncherViaGesture;
}
public void setShouldDelayLauncherStateAnim(boolean shouldDelayLauncherStateAnim) {
if (!shouldDelayLauncherStateAnim && mShouldDelayLauncherStateAnim) {
// Animate the animation we have delayed immediately. This is usually triggered when
// the user has released their finger.
applyState();
}
mShouldDelayLauncherStateAnim = shouldDelayLauncherStateAnim;
}
/**
* Updates the proper flag to change the state of the task bar.
*