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

This commit is contained in:
Tracy Zhou
2022-01-25 21:44:48 +00:00
committed by Android (Google) Code Review
3 changed files with 36 additions and 1 deletions

View File

@@ -74,6 +74,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>() {
@@ -86,7 +88,9 @@ import java.util.function.Supplier;
mLauncherState = toState;
}
updateStateForFlag(FLAG_TRANSITION_STATE_RUNNING, true);
applyState();
if (!mShouldDelayLauncherStateAnim) {
applyState();
}
}
@Override
@@ -159,6 +163,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.
*