Improve app to home animation blur
- Add a blur layer to the Scaling Workspace Reveal to have a smooth
blur transition during animation
- As part of this, disable blur from DepthController (but still
use it for depth to match workspace scale)
- This mirrors the approach in LauncherBackAnimationController
- Use a snappier interpolator for the blur portion (666ms, emphasized)
- Reduce the alpha of floating view during animation, to reduce the
blur effect during the morph
- Increase the cross fade duration of the App Widget to App reveal
Demo video with various widgets and apps:
https://drive.google.com/file/d/1fYJc-TPAEltqParM957NMYbRe2Gn5OgJ/view?usp=sharing&resourcekey=0-AGiL7sqLNXDcNsY-qOzzYQ
Note: this is sort of a different approach to ag/33537973 without the
underlying refactor necessary.
Bug: 417269110
Test: Manual (see video)
Flag: com.android.launcher3.enable_scaling_reveal_home_animation
Change-Id: I2bb6c0114d42af7ed802fbcae03655befe19aa7e
This commit is contained in:
1 parent
a3e63d1e20
commit
15ce89129d
3 files changed
+91
-9
No files matched your search
@@ -120,6 +120,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import com.android.app.animation.Animations;
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.internal.jank.Cuj;
|
||||
import com.android.internal.util.LatencyTracker;
|
||||
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
|
||||
@@ -232,7 +233,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
private static final int MAX_NUM_TASKS = 5;
|
||||
|
||||
// Cross-fade duration between App Widget and App
|
||||
private static final int WIDGET_CROSSFADE_DURATION_MILLIS = 125;
|
||||
private static final int WIDGET_CROSSFADE_DURATION_MILLIS = 666;
|
||||
|
||||
protected final QuickstepLauncher mLauncher;
|
||||
protected final DragLayer mDragLayer;
|
||||
@@ -1488,15 +1489,20 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
FloatingIconView finalFloatingIconView = floatingIconView;
|
||||
|
||||
// We want the window alpha to be 0 once this threshold is met, so that the
|
||||
// FolderIconView can be seen morphing into the icon shape.
|
||||
// FloatingIconView can be seen morphing into the icon shape.
|
||||
final float windowAlphaThreshold = 1f - SHAPE_PROGRESS_DURATION;
|
||||
|
||||
RectFSpringAnim.OnUpdateListener runner = new SpringAnimRunner(targets, targetRect,
|
||||
closingWindowStartRect, closingWindowOriginalRect, startWindowCornerRadius) {
|
||||
@Override
|
||||
public void onUpdate(RectF currentRectF, float progress) {
|
||||
finalFloatingIconView.update(1f, currentRectF, progress, windowAlphaThreshold,
|
||||
getCornerRadius(progress), false);
|
||||
// We want the icon alpha to be 1 once this threshold is met, so that it can be
|
||||
// seen morphing into the icon shape. But before the threshold, we want to limit
|
||||
// the alpha to reduce the blur effect behind the window.
|
||||
float iconAlpha =
|
||||
Interpolators.clampToProgress(progress, 0f, windowAlphaThreshold);
|
||||
finalFloatingIconView.update(iconAlpha, currentRectF, progress,
|
||||
windowAlphaThreshold, getCornerRadius(progress), false);
|
||||
|
||||
super.onUpdate(currentRectF, progress);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user