Merge "Notify StateManager of predictive back animation." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcc634e0bb
@@ -1137,9 +1137,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
return animatorSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns animator that controls depth/blur of the background.
|
||||
*/
|
||||
/** Returns animator that controls depth/blur of the background during app/widget opening. */
|
||||
private ObjectAnimator getBackgroundAnimator() {
|
||||
// When launching an app from overview that doesn't map to a task, we still want to just
|
||||
// blur the wallpaper instead of the launcher surface as well
|
||||
@@ -1847,7 +1845,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
}
|
||||
});
|
||||
} else if (playWorkspaceReveal) {
|
||||
anim.play(new WorkspaceRevealAnim(mLauncher, false).getAnimators());
|
||||
anim.play(new WorkspaceRevealAnim(mLauncher, false).getAnimators());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -599,7 +599,7 @@ public class LauncherBackAnimationController {
|
||||
// Scrim hasn't been attached yet. Let's attach it.
|
||||
addScrimLayer();
|
||||
}
|
||||
mScrimAlphaAnimator = new ValueAnimator().ofFloat(1, 0);
|
||||
mScrimAlphaAnimator = ValueAnimator.ofFloat(1, 0);
|
||||
mScrimAlphaAnimator.addUpdateListener(animation -> {
|
||||
float value = (Float) animation.getAnimatedValue();
|
||||
if (mScrimLayer != null && mScrimLayer.isValid()) {
|
||||
@@ -615,7 +615,7 @@ public class LauncherBackAnimationController {
|
||||
}
|
||||
});
|
||||
mScrimAlphaAnimator.setDuration(SCRIM_FADE_DURATION).start();
|
||||
backAnim.start();
|
||||
backAnim.start(mLauncher.getStateManager());
|
||||
}
|
||||
|
||||
private void loadResources() {
|
||||
|
||||
@@ -19,8 +19,11 @@ package com.android.quickstep.util
|
||||
import android.animation.AnimatorSet
|
||||
import android.content.Context
|
||||
import com.android.launcher3.Flags
|
||||
import com.android.launcher3.Launcher
|
||||
import com.android.launcher3.LauncherAnimationRunner.AnimationResult
|
||||
import com.android.launcher3.LauncherState
|
||||
import com.android.launcher3.anim.AnimatorListeners.forEndCallback
|
||||
import com.android.launcher3.statemanager.StateManager
|
||||
import com.android.launcher3.util.RunnableList
|
||||
|
||||
/** Interface to represent animation for back to Launcher transition */
|
||||
@@ -30,7 +33,7 @@ interface BackAnimState {
|
||||
|
||||
fun applyToAnimationResult(result: AnimationResult, c: Context)
|
||||
|
||||
fun start()
|
||||
fun start(stateManager: StateManager<LauncherState, Launcher>)
|
||||
}
|
||||
|
||||
class AnimatorBackState(private val springAnim: RectFSpringAnim?, private val anim: AnimatorSet?) :
|
||||
@@ -58,7 +61,10 @@ class AnimatorBackState(private val springAnim: RectFSpringAnim?, private val an
|
||||
result.setAnimation(anim, c)
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
override fun start(stateManager: StateManager<LauncherState, Launcher>) {
|
||||
if (anim != null) {
|
||||
stateManager.setCurrentAnimation(anim)
|
||||
}
|
||||
anim?.start()
|
||||
}
|
||||
}
|
||||
@@ -73,5 +79,5 @@ class AlreadyStartedBackAnimState(private val onEndCallback: RunnableList) : Bac
|
||||
addOnAnimCompleteCallback(result::onAnimationFinished)
|
||||
}
|
||||
|
||||
override fun start() {}
|
||||
override fun start(stateManager: StateManager<LauncherState, Launcher>) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user