diff options
| -rw-r--r-- | libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java | 2 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java index ebca5df63c15..498dc8bdd24d 100644 --- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java +++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/split/SplitScreenConstants.java @@ -30,7 +30,7 @@ public class SplitScreenConstants { /** Duration used for every split fade-in or fade-out. */ public static final int FADE_DURATION = 133; /** Duration where we keep an app veiled to allow it to redraw itself behind the scenes. */ - public static final int VEIL_DELAY_DURATION = 400; + public static final int VEIL_DELAY_DURATION = 300; /** Key for passing in widget intents when invoking split from launcher workspace. */ public static final String KEY_EXTRA_WIDGET_INTENT = "key_extra_widget_intent"; diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index e807afbb1e03..2a934cba1b50 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -27,6 +27,8 @@ import static android.view.WindowManager.DOCKED_TOP; import static com.android.internal.jank.InteractionJankMonitor.CUJ_SPLIT_SCREEN_DOUBLE_TAP_DIVIDER; import static com.android.internal.jank.InteractionJankMonitor.CUJ_SPLIT_SCREEN_RESIZE; import static com.android.wm.shell.shared.animation.Interpolators.DIM_INTERPOLATOR; +import static com.android.wm.shell.shared.animation.Interpolators.EMPHASIZED; +import static com.android.wm.shell.shared.animation.Interpolators.LINEAR; import static com.android.wm.shell.shared.animation.Interpolators.SLOWDOWN_INTERPOLATOR; import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_END_AND_DISMISS; import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_START_AND_DISMISS; @@ -813,7 +815,9 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange float growPortion = 1 - shrinkPortion; ValueAnimator animator = ValueAnimator.ofFloat(0, 1); - animator.setInterpolator(Interpolators.EMPHASIZED); + // Set the base animation to proceed linearly. Each component of the animation (movement, + // shrinking, growing) overrides it with a different interpolator later. + animator.setInterpolator(LINEAR); animator.addUpdateListener(animation -> { if (leash == null) return; if (roundCorners) { @@ -822,10 +826,11 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange } final float progress = (float) animation.getAnimatedValue(); - float instantaneousX = tempStart.left + progress * diffX; - float instantaneousY = tempStart.top + progress * diffY; - int width = (int) (tempStart.width() + progress * diffWidth); - int height = (int) (tempStart.height() + progress * diffHeight); + final float moveProgress = EMPHASIZED.getInterpolation(progress); + float instantaneousX = tempStart.left + moveProgress * diffX; + float instantaneousY = tempStart.top + moveProgress * diffY; + int width = (int) (tempStart.width() + moveProgress * diffWidth); + int height = (int) (tempStart.height() + moveProgress * diffHeight); if (isGoingBehind) { float shrinkDiffX; // the position adjustments needed for this frame @@ -897,8 +902,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange taskInfo, mTempRect, t, isGoingBehind, leash, 0, 0); } } else { - final int diffOffsetX = (int) (progress * offsetX); - final int diffOffsetY = (int) (progress * offsetY); + final int diffOffsetX = (int) (moveProgress * offsetX); + final int diffOffsetY = (int) (moveProgress * offsetY); t.setPosition(leash, instantaneousX + diffOffsetX, instantaneousY + diffOffsetY); mTempRect.set(0, 0, width, height); mTempRect.offsetTo(-diffOffsetX, -diffOffsetY); |