Search in sources :

Example 1 with RemoteAnimationProvider

use of com.android.quickstep.util.RemoteAnimationProvider in project android_packages_apps_Launcher3 by crdroidandroid.

the class LauncherInitListener method handleInit.

@Override
public boolean handleInit(Launcher launcher, boolean alreadyOnHome) {
    if (mRemoteAnimationProvider != null) {
        QuickstepTransitionManager appTransitionManager = ((BaseQuickstepLauncher) launcher).getAppTransitionManager();
        // Set a one-time animation provider. After the first call, this will get cleared.
        // TODO: Probably also check the intended target id.
        CancellationSignal cancellationSignal = new CancellationSignal();
        appTransitionManager.setRemoteAnimationProvider(new RemoteAnimationProvider() {

            @Override
            public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets) {
                // On the first call clear the reference.
                cancellationSignal.cancel();
                RemoteAnimationProvider provider = mRemoteAnimationProvider;
                mRemoteAnimationProvider = null;
                if (provider != null && launcher.getStateManager().getState().overviewUi) {
                    return provider.createWindowAnimation(appTargets, wallpaperTargets);
                }
                return null;
            }
        }, cancellationSignal);
    }
    launcher.deferOverlayCallbacksUntilNextResumeOrStop();
    return super.handleInit(launcher, alreadyOnHome);
}
Also used : RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat) AnimatorSet(android.animation.AnimatorSet) CancellationSignal(android.os.CancellationSignal) RemoteAnimationProvider(com.android.quickstep.util.RemoteAnimationProvider)

Example 2 with RemoteAnimationProvider

use of com.android.quickstep.util.RemoteAnimationProvider in project android_packages_apps_Launcher3 by crdroidandroid.

the class BaseQuickstepLauncher method useFadeOutAnimationForLauncherStart.

@Override
public void useFadeOutAnimationForLauncherStart(CancellationSignal signal) {
    QuickstepTransitionManager appTransitionManager = getAppTransitionManager();
    appTransitionManager.setRemoteAnimationProvider(new RemoteAnimationProvider() {

        @Override
        public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets) {
            // On the first call clear the reference.
            signal.cancel();
            ValueAnimator fadeAnimation = ValueAnimator.ofFloat(1, 0);
            fadeAnimation.addUpdateListener(new RemoteFadeOutAnimationListener(appTargets, wallpaperTargets));
            AnimatorSet anim = new AnimatorSet();
            anim.play(fadeAnimation);
            return anim;
        }
    }, signal);
}
Also used : RemoteFadeOutAnimationListener(com.android.quickstep.util.RemoteFadeOutAnimationListener) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat) AnimatorSet(android.animation.AnimatorSet) ValueAnimator(android.animation.ValueAnimator) RemoteAnimationProvider(com.android.quickstep.util.RemoteAnimationProvider)

Aggregations

AnimatorSet (android.animation.AnimatorSet)2 RemoteAnimationProvider (com.android.quickstep.util.RemoteAnimationProvider)2 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)2 ValueAnimator (android.animation.ValueAnimator)1 CancellationSignal (android.os.CancellationSignal)1 RemoteFadeOutAnimationListener (com.android.quickstep.util.RemoteFadeOutAnimationListener)1