Add support for taskbar background to wrap around hotseat
Currently only enabled for app launch animation
Future work is planned:
- Overview to home
- App dismiss
- When QSB is drawn inline
Bug: 345768019
Test: Launch an app, taskbar background and stashed handle will
first wrap around hotseat before transforming into the
stashed handle.
Verified by locally forcing taskbar background and
stashed handle to always draw.
Flag: com.android.launcher3.enable_scaling_reveal_home_animation
Change-Id: I9ab1870f87247b6a1b53a352ac3eb0183b7a1a1d
This commit is contained in:
@@ -33,6 +33,7 @@ import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VAL
|
||||
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_ALIGNMENT_ANIM;
|
||||
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_PINNING_ANIM;
|
||||
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_REVEAL_ANIM;
|
||||
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -551,7 +552,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
* @param interpolator The interpolator to use for all animations.
|
||||
*/
|
||||
public void addRevealAnimToIsStashed(AnimatorSet as, boolean isStashed, long duration,
|
||||
Interpolator interpolator, boolean dispatchOnAnimationStart) {
|
||||
Interpolator interpolator, boolean dispatchOnAnimationStart,
|
||||
boolean isHomeToAppAnimation) {
|
||||
AnimatorSet reveal = new AnimatorSet();
|
||||
|
||||
Rect stashedBounds = new Rect();
|
||||
@@ -600,8 +602,21 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
reveal.play(ObjectAnimator.ofFloat(mtd.getTranslationX(INDEX_TASKBAR_REVEAL_ANIM),
|
||||
MULTI_PROPERTY_VALUE, transX)
|
||||
.setDuration(duration));
|
||||
reveal.play(ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
|
||||
MULTI_PROPERTY_VALUE, transY));
|
||||
|
||||
if (enableScalingRevealHomeAnimation()) {
|
||||
// Delay y-translation by 1 frame to keep icons within the bounds of the bg.
|
||||
int delay = isHomeToAppAnimation ? getSingleFrameMs(mActivity) : 0;
|
||||
ObjectAnimator yAnimator =
|
||||
ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
|
||||
MULTI_PROPERTY_VALUE, transY)
|
||||
.setDuration(Math.max(0, duration - delay));
|
||||
yAnimator.setStartDelay(delay);
|
||||
reveal.play(yAnimator);
|
||||
} else {
|
||||
reveal.play(
|
||||
ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
|
||||
MULTI_PROPERTY_VALUE, transY));
|
||||
}
|
||||
as.addListener(forEndCallback(() ->
|
||||
mtd.setTranslation(INDEX_TASKBAR_REVEAL_ANIM, 0, 0)));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user