Miscellaneous polish for new home animation.

1. Update the starting window velocity when coming from 3-button nav or
   predictive back

Before we used an arbitrary fixed velocity which goes down to basically
0 with the old implementation, but caused a noticeable jump up in the
new one when using predictive back. Now we just pass 0, since the
predictive back framework doesn't give us the actual velocity.

2. Add the scaling home reveal to the targetless (not going back to a
   specific app icon or widget) animation and 3-button nav

Bug: 298089923
Fix: 343143876
Flag: com.android.launcher3.enable_scaling_reveal_home_animation
Test: manually tested with flag on and off
Change-Id: Ied3630a51862731fad044b68f76a45dc87f2e17b
This commit is contained in:
Luca Zuccarini
2024-05-30 12:16:27 +00:00
parent 3661e3f655
commit 0f6668d011
4 changed files with 52 additions and 19 deletions

View File

@@ -151,6 +151,7 @@ import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.RectFSpringAnim.DefaultSpringConfig;
import com.android.quickstep.util.RectFSpringAnim.TaskbarHotseatSpringConfig;
import com.android.quickstep.util.ScalingWorkspaceRevealAnim;
import com.android.quickstep.util.StaggeredWorkspaceAnim;
import com.android.quickstep.util.SurfaceTransaction;
import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties;
@@ -174,7 +175,6 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map.Entry;
/**
* Manages the opening and closing app transitions from Launcher
@@ -1630,10 +1630,15 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
anim.play(getUnlockWindowAnimator(appTargets, wallpaperTargets));
} else if (ENABLE_BACK_SWIPE_HOME_ANIMATION.get()
&& !playFallBackAnimation) {
// Use a fixed velocity to start the animation.
float velocityPxPerS = DynamicResource.provider(mLauncher)
.getDimension(R.dimen.unlock_staggered_velocity_dp_per_s);
PointF velocity = new PointF(0, -velocityPxPerS);
PointF velocity;
if (enableScalingRevealHomeAnimation()) {
velocity = new PointF();
} else {
// Use a fixed velocity to start the animation.
float velocityPxPerS = DynamicResource.provider(mLauncher)
.getDimension(R.dimen.unlock_staggered_velocity_dp_per_s);
velocity = new PointF(0, -velocityPxPerS);
}
rectFSpringAnim = getClosingWindowAnimators(
anim, appTargets, launcherView, velocity, startRect,
startWindowCornerRadius);
@@ -1642,8 +1647,15 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
// layout bounds.
skipAllAppsScale = true;
} else if (!fromPredictiveBack) {
anim.play(new StaggeredWorkspaceAnim(mLauncher, velocity.y,
true /* animateOverviewScrim */, launcherView).getAnimators());
if (enableScalingRevealHomeAnimation()) {
anim.play(
new ScalingWorkspaceRevealAnim(
mLauncher, rectFSpringAnim,
rectFSpringAnim.getTargetRect()).getAnimators());
} else {
anim.play(new StaggeredWorkspaceAnim(mLauncher, velocity.y,
true /* animateOverviewScrim */, launcherView).getAnimators());
}
if (!areAllTargetsTranslucent(appTargets)) {
anim.play(ObjectAnimator.ofFloat(mLauncher.getDepthController().stateDepth,