Merge "Make keyguard exit animation to remote animation." into sc-dev

This commit is contained in:
Issei Suzuki authored and Android (Google) Code Review committed 2021-02-05 15:05:03 +00:00
commit d5c8bd8c0b
6 files changed
+49 -16

No files matched your search

@@ -56,17 +56,22 @@ public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCo
return mHandler;
}
// Called only in R+ platform
// Called only in S+ platform
@BinderThread
public void onAnimationStart(RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, Runnable runnable) {
public void onAnimationStart(
int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
Runnable runnable) {
Runnable r = () -> {
finishExistingAnimation();
mAnimationResult = new AnimationResult(() -> {
UI_HELPER_EXECUTOR.execute(runnable);
mAnimationResult = null;
});
onCreateAnimation(appTargets, wallpaperTargets, mAnimationResult);
onCreateAnimation(transit, appTargets, wallpaperTargets, nonAppTargets,
mAnimationResult);
};
if (mStartAtFrontOfQueue) {
postAtFrontOfQueueAsynchronously(mHandler, r);
@@ -75,6 +80,14 @@ public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCo
}
}
// Called only in R platform
@BinderThread
public void onAnimationStart(RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, Runnable runnable) {
onAnimationStart(0 /* transit */, appTargets, wallpaperTargets,
new RemoteAnimationTargetCompat[0], runnable);
}
// Called only in Q platform
@BinderThread
@Deprecated
@@ -88,8 +101,11 @@ public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCo
*/
@UiThread
public abstract void onCreateAnimation(
int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, AnimationResult result);
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
AnimationResult result);
@UiThread
private void finishExistingAnimation() {
@@ -866,8 +866,10 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
}
@Override
public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets,
public void onCreateAnimation(int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
LauncherAnimationRunner.AnimationResult result) {
if (mLauncher.isDestroyed()) {
AnimatorSet anim = new AnimatorSet();
@@ -880,7 +882,8 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
// If launcher is not resumed, wait until new async-frame after resume
mLauncher.addOnResumeCallback(() ->
postAsyncCallback(mHandler, () ->
onCreateAnimation(appTargets, wallpaperTargets, result)));
onCreateAnimation(transit, appTargets, wallpaperTargets,
nonAppTargets, result)));
return;
}
@@ -964,8 +967,10 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
}
@Override
public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets,
public void onCreateAnimation(int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
LauncherAnimationRunner.AnimationResult result) {
AnimatorSet anim = new AnimatorSet();
@@ -26,7 +26,9 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
*/
public interface WrappedAnimationRunnerImpl {
Handler getHandler();
void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets,
void onCreateAnimation(int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
LauncherAnimationRunner.AnimationResult result);
}
@@ -46,11 +46,15 @@ public class WrappedLauncherAnimationRunner<R extends WrappedAnimationRunnerImpl
}
@Override
public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, AnimationResult result) {
public void onCreateAnimation(int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
AnimationResult result) {
R animationRunnerImpl = mImpl.get();
if (animationRunnerImpl != null) {
animationRunnerImpl.onCreateAnimation(appTargets, wallpaperTargets, result);
animationRunnerImpl.onCreateAnimation(transit, appTargets, wallpaperTargets,
nonAppTargets, result);
}
}
}
@@ -184,8 +184,11 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
}
@Override
public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, AnimationResult result) {
public void onCreateAnimation(int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets,
AnimationResult result) {
AnimatorSet anim = composeRecentsLaunchAnimator(taskView, appTargets,
wallpaperTargets);
anim.addListener(resetStateListener());
@@ -43,8 +43,11 @@ public abstract class RemoteAnimationProvider {
}
@Override
public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, AnimationResult result) {
public void onCreateAnimation(int transit,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonApps,
AnimationResult result) {
result.setAnimation(createWindowAnimation(appTargets, wallpaperTargets), context);
}
};