mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-17 09:38:19 +00:00
Merge "Track LauncherState for task bar stashing better" into sc-v2-dev
This commit is contained in:
@@ -63,7 +63,7 @@ public class TaskbarStashController {
|
||||
/**
|
||||
* How long to stash/unstash when manually invoked via long press.
|
||||
*/
|
||||
private static final long TASKBAR_STASH_DURATION = 300;
|
||||
public static final long TASKBAR_STASH_DURATION = 300;
|
||||
|
||||
/**
|
||||
* The scale TaskbarView animates to when being stashed.
|
||||
@@ -279,7 +279,12 @@ public class TaskbarStashController {
|
||||
return false;
|
||||
}
|
||||
|
||||
private Animator createAnimToIsStashed(boolean isStashed, long duration) {
|
||||
/**
|
||||
* Create a stash animation and save to {@link #mAnimator}.
|
||||
* @param isStashed whether it's a stash animation or an unstash animation
|
||||
* @param duration duration of the animation
|
||||
*/
|
||||
private void createAnimToIsStashed(boolean isStashed, long duration) {
|
||||
if (mAnimator != null) {
|
||||
mAnimator.cancel();
|
||||
}
|
||||
@@ -289,7 +294,7 @@ public class TaskbarStashController {
|
||||
// Just hide/show the icons instead of stashing into a handle.
|
||||
mAnimator.play(mIconAlphaForStash.animateToValue(isStashed ? 0 : 1)
|
||||
.setDuration(duration));
|
||||
return mAnimator;
|
||||
return;
|
||||
}
|
||||
|
||||
AnimatorSet fullLengthAnimatorSet = new AnimatorSet();
|
||||
@@ -361,7 +366,6 @@ public class TaskbarStashController {
|
||||
mAnimator = null;
|
||||
}
|
||||
});
|
||||
return mAnimator;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -481,12 +485,13 @@ public class TaskbarStashController {
|
||||
boolean isStashed = mStashCondition.test(flags);
|
||||
if (mIsStashed != isStashed) {
|
||||
mIsStashed = isStashed;
|
||||
Animator animator = createAnimToIsStashed(mIsStashed, duration);
|
||||
createAnimToIsStashed(mIsStashed, duration);
|
||||
if (start) {
|
||||
animator.start();
|
||||
mAnimator.start();
|
||||
}
|
||||
return mAnimator;
|
||||
}
|
||||
return mAnimator;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user