Add spring animation when stashing transient taskbar.

Bug: 273961611
Change-Id: I35a658a5e30a155094a48effdefc3895f45e0483
Flag: ENABLE_TRANSIENT_TASKBAR
Test: stash transient taskbar
This commit is contained in:
Jon Miranda
2023-03-21 07:07:46 -07:00
parent 149246f077
commit 3344ec7004
11 changed files with 156 additions and 4 deletions
@@ -84,6 +84,9 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
private boolean mIsStashed;
private boolean mTaskbarHidden;
private float mTranslationYForSwipe;
private float mTranslationYForStash;
public StashedHandleViewController(TaskbarActivityContext activity,
StashedHandleView stashedHandleView) {
mActivity = activity;
@@ -254,7 +257,20 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
* Sets the translation of the stashed handle during the swipe up gesture.
*/
protected void setTranslationYForSwipe(float transY) {
mStashedHandleView.setTranslationY(transY);
mTranslationYForSwipe = transY;
updateTranslationY();
}
/**
* Sets the translation of the stashed handle during the spring on stash animation.
*/
protected void setTranslationYForStash(float transY) {
mTranslationYForStash = transY;
updateTranslationY();
}
private void updateTranslationY() {
mStashedHandleView.setTranslationY(mTranslationYForSwipe + mTranslationYForStash);
}
/**