mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Fix spring not springing when unstashing.
The spring animation was getting cancelled by the reset animation. Added a check to avoid creating a new reset animation if we are already animating to the final value. Bug: 273961611 Change-Id: I3afb62b89b5f6fbe920906499db2497ef8e94069 Flag: ENABLE_TRANSIENT_TASKBAR Test: stash transient taskbar
This commit is contained in:
@@ -133,6 +133,21 @@ public class TaskbarTranslationController implements TaskbarControllers.Loggable
|
||||
return mCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if we will animate to zero before the input duration.
|
||||
*/
|
||||
public boolean willAnimateToZeroBefore(long duration) {
|
||||
if (mSpringBounce != null && mSpringBounce.isRunning()) {
|
||||
long springDuration = mSpringBounce.getDuration();
|
||||
long current = mSpringBounce.getCurrentPlayTime();
|
||||
return (springDuration - current < duration);
|
||||
}
|
||||
if (mTranslationYForSwipe.isAnimatingToValue(0)) {
|
||||
return mTranslationYForSwipe.getRemainingTime() < duration;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an animation to reset the taskbar translation to {@code 0}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user