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:
1 parent
50a37b33a9
commit
5dc07d786f
8 files changed
+133
-12
No files matched your search
@@ -22,6 +22,7 @@ import static com.android.app.animation.Interpolators.FINAL_FRAME;
|
||||
import static com.android.app.animation.Interpolators.INSTANT;
|
||||
import static com.android.app.animation.Interpolators.LINEAR;
|
||||
import static com.android.internal.jank.InteractionJankMonitor.Configuration;
|
||||
import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW;
|
||||
@@ -41,6 +42,7 @@ import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.app.RemoteAction;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
@@ -196,6 +198,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
* by not scaling the height of the taskbar background.
|
||||
*/
|
||||
private static final int TRANSITION_UNSTASH_SUW_MANUAL = 3;
|
||||
private static final Rect EMPTY_RECT = new Rect();
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(value = {
|
||||
@@ -698,7 +701,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
}
|
||||
|
||||
fullLengthAnimatorSet.play(mControllers.stashedHandleViewController
|
||||
.createRevealAnimToIsStashed(isStashed));
|
||||
.createRevealAnimToIsStashed(isStashed, EMPTY_RECT));
|
||||
// Return the stashed handle to its default scale in case it was changed as part of the
|
||||
// feedforward hint. Note that the reveal animation above also visually scales it.
|
||||
fullLengthAnimatorSet.play(mTaskbarStashedHandleHintScale.animateToValue(1f));
|
||||
@@ -748,6 +751,19 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Rect taskbarToHotseatOffsets = new Rect();
|
||||
if (enableScalingRevealHomeAnimation() && animationType == TRANSITION_HOME_TO_APP) {
|
||||
Rect hotseatRect = new Rect();
|
||||
mActivity.getHotseatBounds(hotseatRect);
|
||||
|
||||
// Calculate and store offsets so that we can sync with the taskbar stashed handle
|
||||
taskbarToHotseatOffsets.set(
|
||||
mActivity.calculateTaskbarToHotseatOffsets(hotseatRect));
|
||||
as.addListener(AnimatorListeners.forEndCallback(
|
||||
() -> mActivity.calculateTaskbarToHotseatOffsets(EMPTY_RECT)));
|
||||
}
|
||||
|
||||
play(as, mTaskbarStashedHandleAlpha.animateToValue(stashedHandleAlphaTarget),
|
||||
backgroundAndHandleAlphaStartDelay,
|
||||
backgroundAndHandleAlphaDuration, LINEAR);
|
||||
@@ -786,10 +802,12 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
}
|
||||
|
||||
mControllers.taskbarViewController.addRevealAnimToIsStashed(skippable, isStashed, duration,
|
||||
EMPHASIZED, animationType == TRANSITION_UNSTASH_SUW_MANUAL);
|
||||
EMPHASIZED, animationType == TRANSITION_UNSTASH_SUW_MANUAL,
|
||||
animationType == TRANSITION_HOME_TO_APP);
|
||||
|
||||
play(skippable, mControllers.stashedHandleViewController
|
||||
.createRevealAnimToIsStashed(isStashed), 0, duration, EMPHASIZED);
|
||||
.createRevealAnimToIsStashed(isStashed, taskbarToHotseatOffsets), 0, duration,
|
||||
EMPHASIZED);
|
||||
|
||||
// Return the stashed handle to its default scale in case it was changed as part of the
|
||||
// feedforward hint. Note that the reveal animation above also visually scales it.
|
||||
|
||||
Reference in new issue
Block a user