mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Merge "Fix taskbar bg delay for the case when user is going home." into main
This commit is contained in:
@@ -245,7 +245,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
|
||||
private Animator mTaskbarBackgroundAlphaAnimator;
|
||||
private long mTaskbarBackgroundDuration;
|
||||
private boolean mIsGoingHome;
|
||||
private boolean mUserIsNotGoingHome = false;
|
||||
|
||||
// Evaluate whether the handle should be stashed
|
||||
private final LongPredicate mIsStashedPredicate = flags -> {
|
||||
@@ -828,17 +828,13 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
private boolean mTaskbarBgAlphaAnimationStarted = false;
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||
if (mIsGoingHome) {
|
||||
mTaskbarBgAlphaAnimationStarted = true;
|
||||
}
|
||||
if (mTaskbarBgAlphaAnimationStarted) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (valueAnimator.getAnimatedFraction() >= ANIMATED_FRACTION_THRESHOLD) {
|
||||
if (!mIsGoingHome) {
|
||||
if (mUserIsNotGoingHome) {
|
||||
playTaskbarBackgroundAlphaAnimation();
|
||||
setUserIsGoingHome(false);
|
||||
mTaskbarBgAlphaAnimationStarted = true;
|
||||
}
|
||||
}
|
||||
@@ -850,8 +846,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
/**
|
||||
* Sets whether the user is going home based on the current gesture.
|
||||
*/
|
||||
public void setUserIsGoingHome(boolean isGoingHome) {
|
||||
mIsGoingHome = isGoingHome;
|
||||
public void setUserIsNotGoingHome(boolean userIsNotGoingHome) {
|
||||
mUserIsNotGoingHome = userIsNotGoingHome;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -415,7 +415,7 @@ public class TaskbarUIController {
|
||||
/**
|
||||
* Sets whether the user is going home based on the current gesture.
|
||||
*/
|
||||
public void setUserIsGoingHome(boolean isGoingHome) {
|
||||
mControllers.taskbarStashController.setUserIsGoingHome(isGoingHome);
|
||||
public void setUserIsNotGoingHome(boolean isNotGoingHome) {
|
||||
mControllers.taskbarStashController.setUserIsNotGoingHome(isNotGoingHome);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1196,7 +1196,7 @@ public abstract class AbsSwipeUpHandler<T extends RecentsViewContainer,
|
||||
}
|
||||
if (mContainerInterface.getTaskbarController() != null) {
|
||||
// Resets this value as the gesture is now complete.
|
||||
mContainerInterface.getTaskbarController().setUserIsGoingHome(false);
|
||||
mContainerInterface.getTaskbarController().setUserIsNotGoingHome(false);
|
||||
}
|
||||
ActiveGestureLog.INSTANCE.addLog(
|
||||
new ActiveGestureLog.CompoundString("onSettledOnEndTarget ")
|
||||
@@ -1350,7 +1350,7 @@ public abstract class AbsSwipeUpHandler<T extends RecentsViewContainer,
|
||||
&& mIsTransientTaskbar
|
||||
&& mContainerInterface.getTaskbarController() != null) {
|
||||
mContainerInterface.getTaskbarController()
|
||||
.setUserIsGoingHome(endTarget == GestureState.GestureEndTarget.HOME);
|
||||
.setUserIsNotGoingHome(endTarget != GestureState.GestureEndTarget.HOME);
|
||||
}
|
||||
|
||||
float endShift = endTarget == ALL_APPS ? mDragLengthFactor
|
||||
|
||||
Reference in New Issue
Block a user