Snap for 11314147 from 0c8439e17d to 24Q2-release
Change-Id: I7030e43660f140717a8e3192b0370ca9e852883a
This commit is contained in:
@@ -1087,7 +1087,12 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
}
|
||||
|
||||
backgroundRadiusAnim.addListener(
|
||||
AnimatorListeners.forEndCallback(depthController::dispose));
|
||||
AnimatorListeners.forEndCallback(() -> {
|
||||
// reset the depth to match the main depth controller's depth
|
||||
depthController.stateDepth
|
||||
.setValue(mLauncher.getDepthController().stateDepth.getValue());
|
||||
depthController.dispose();
|
||||
}));
|
||||
|
||||
return backgroundRadiusAnim;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.animation.Animator;
|
||||
import android.app.ActivityOptions;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.window.RemoteTransition;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -38,6 +39,7 @@ import com.android.quickstep.util.SlideInRemoteTransition;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.QuickStepContract;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
@@ -148,8 +150,13 @@ public class KeyboardQuickSwitchViewController {
|
||||
return -1;
|
||||
}
|
||||
|
||||
TaskbarActivityContext context = mControllers.taskbarActivityContext;
|
||||
RemoteTransition remoteTransition = new RemoteTransition(new SlideInRemoteTransition(
|
||||
Utilities.isRtl(mControllers.taskbarActivityContext.getResources())));
|
||||
Utilities.isRtl(mControllers.taskbarActivityContext.getResources()),
|
||||
context.getDeviceProfile().overviewPageSpacing,
|
||||
QuickStepContract.getWindowCornerRadius(context),
|
||||
AnimationUtils.loadInterpolator(
|
||||
context, android.R.interpolator.fast_out_extra_slow_in)));
|
||||
if (mOnDesktop) {
|
||||
UI_HELPER_EXECUTOR.execute(() ->
|
||||
SystemUiProxy.INSTANCE.get(mKeyboardQuickSwitchView.getContext())
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.quickstep.util
|
||||
|
||||
import android.animation.TimeInterpolator
|
||||
import android.animation.ValueAnimator
|
||||
import android.app.WindowConfiguration.ACTIVITY_TYPE_HOME
|
||||
import android.graphics.Rect
|
||||
@@ -30,7 +31,13 @@ import com.android.launcher3.util.Executors
|
||||
import com.android.wm.shell.util.TransitionUtil
|
||||
|
||||
/** Remote animation which slides the opening targets in and the closing targets out */
|
||||
class SlideInRemoteTransition(val isRtl: Boolean) : IRemoteTransition.Stub() {
|
||||
class SlideInRemoteTransition(
|
||||
private val isRtl: Boolean,
|
||||
private val pageSpacing: Int,
|
||||
private val cornerRadius: Float,
|
||||
private val interpolator: TimeInterpolator,
|
||||
) : IRemoteTransition.Stub() {
|
||||
private val animationDurationMs = 500L
|
||||
|
||||
override fun mergeAnimation(
|
||||
iBinder: IBinder,
|
||||
@@ -54,6 +61,8 @@ class SlideInRemoteTransition(val isRtl: Boolean) : IRemoteTransition.Stub() {
|
||||
finishCB: IRemoteTransitionFinishedCallback
|
||||
) {
|
||||
val anim = ValueAnimator.ofFloat(0f, 1f)
|
||||
anim.interpolator = interpolator
|
||||
anim.duration = animationDurationMs
|
||||
|
||||
val closingStartBounds: HashMap<SurfaceControl, Rect> = HashMap()
|
||||
val openingEndBounds: HashMap<SurfaceControl, Rect> = HashMap()
|
||||
@@ -67,9 +76,11 @@ class SlideInRemoteTransition(val isRtl: Boolean) : IRemoteTransition.Stub() {
|
||||
}
|
||||
if (TransitionUtil.isClosingType(chg.mode)) {
|
||||
closingStartBounds[leash] = chg.startAbsBounds
|
||||
startT.setCrop(leash, chg.startAbsBounds).setCornerRadius(leash, cornerRadius)
|
||||
}
|
||||
if (TransitionUtil.isOpeningType(chg.mode)) {
|
||||
openingEndBounds[leash] = chg.endAbsBounds
|
||||
startT.setCrop(leash, chg.endAbsBounds).setCornerRadius(leash, cornerRadius)
|
||||
}
|
||||
}
|
||||
startT.apply()
|
||||
@@ -80,7 +91,7 @@ class SlideInRemoteTransition(val isRtl: Boolean) : IRemoteTransition.Stub() {
|
||||
// Translate the surface from its original position on-screen to off-screen on the
|
||||
// right (or left in RTL)
|
||||
val startBounds = closingStartBounds[it]
|
||||
val targetX = (if (isRtl) -1 else 1) * startBounds!!.right
|
||||
val targetX = (if (isRtl) -1 else 1) * (startBounds!!.right + pageSpacing)
|
||||
t.setPosition(it, anim.animatedValue as Float * targetX, 0f)
|
||||
}
|
||||
openingEndBounds.keys.forEach {
|
||||
@@ -90,7 +101,7 @@ class SlideInRemoteTransition(val isRtl: Boolean) : IRemoteTransition.Stub() {
|
||||
// Translate the surface from off-screen on the left (or left in RTL) to its final
|
||||
// position on-screen
|
||||
val endBounds = openingEndBounds[it]
|
||||
val targetX = (if (isRtl) -1 else 1) * endBounds!!.right
|
||||
val targetX = (if (isRtl) -1 else 1) * (endBounds!!.right + pageSpacing)
|
||||
t.setPosition(it, (1f - anim.animatedValue as Float) * -targetX, 0f)
|
||||
}
|
||||
t.apply()
|
||||
|
||||
Reference in New Issue
Block a user