Search in sources :

Example 6 with RemoteAnimationAdapterCompat

use of com.android.systemui.shared.system.RemoteAnimationAdapterCompat in project android_packages_apps_Trebuchet by LineageOS.

the class QuickstepAppTransitionManagerImpl method getActivityLaunchOptions.

/**
 * @return ActivityOptions with remote animations that controls how the window of the opening
 *         targets are displayed.
 */
@Override
public ActivityOptions getActivityLaunchOptions(Launcher launcher, View v) {
    if (hasControlRemoteAppTransitionPermission()) {
        boolean fromRecents = isLaunchingFromRecents(v, null);
        mAppLaunchRunner = new AppLaunchAnimationRunner(mHandler, v);
        RemoteAnimationRunnerCompat runner = new WrappedLauncherAnimationRunner<>(mAppLaunchRunner, true);
        // Note that this duration is a guess as we do not know if the animation will be a
        // recents launch or not for sure until we know the opening app targets.
        long duration = fromRecents ? RECENTS_LAUNCH_DURATION : APP_LAUNCH_DURATION;
        long statusBarTransitionDelay = duration - STATUS_BAR_TRANSITION_DURATION - STATUS_BAR_TRANSITION_PRE_DELAY;
        return ActivityOptionsCompat.makeRemoteAnimation(new RemoteAnimationAdapterCompat(runner, duration, statusBarTransitionDelay));
    }
    return super.getActivityLaunchOptions(launcher, v);
}
Also used : RemoteAnimationAdapterCompat(com.android.systemui.shared.system.RemoteAnimationAdapterCompat) RemoteAnimationRunnerCompat(com.android.systemui.shared.system.RemoteAnimationRunnerCompat)

Example 7 with RemoteAnimationAdapterCompat

use of com.android.systemui.shared.system.RemoteAnimationAdapterCompat in project Neo-Launcher by NeoApplications.

the class QuickstepAppTransitionManagerImpl method getActivityLaunchOptions.

/**
 * @return ActivityOptions with remote animations that controls how the window of the opening
 *         targets are displayed.
 */
@Override
public ActivityOptions getActivityLaunchOptions(Launcher launcher, View v) {
    if (hasControlRemoteAppTransitionPermission()) {
        boolean fromRecents = isLaunchingFromRecents(v, null);
        RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mHandler, true) {

            /* startAtFrontOfQueue */
            @Override
            public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, AnimationResult result) {
                AnimatorSet anim = new AnimatorSet();
                boolean launcherClosing = launcherIsATargetWithMode(targetCompats, MODE_CLOSING);
                if (isLaunchingFromRecents(v, targetCompats)) {
                    composeRecentsLaunchAnimator(anim, v, targetCompats, launcherClosing);
                } else {
                    composeIconLaunchAnimator(anim, v, targetCompats, launcherClosing);
                }
                if (launcherClosing) {
                    anim.addListener(mForceInvisibleListener);
                }
                result.setAnimation(anim, mLauncher);
            }
        };
        // Note that this duration is a guess as we do not know if the animation will be a
        // recents launch or not for sure until we know the opening app targets.
        long duration = fromRecents ? RECENTS_LAUNCH_DURATION : APP_LAUNCH_DURATION;
        long statusBarTransitionDelay = duration - STATUS_BAR_TRANSITION_DURATION - STATUS_BAR_TRANSITION_PRE_DELAY;
        return ActivityOptionsCompat.makeRemoteAnimation(new RemoteAnimationAdapterCompat(runner, duration, statusBarTransitionDelay));
    }
    return super.getActivityLaunchOptions(launcher, v);
}
Also used : RemoteAnimationAdapterCompat(com.android.systemui.shared.system.RemoteAnimationAdapterCompat) AnimatorSet(android.animation.AnimatorSet) RemoteAnimationRunnerCompat(com.android.systemui.shared.system.RemoteAnimationRunnerCompat)

Example 8 with RemoteAnimationAdapterCompat

use of com.android.systemui.shared.system.RemoteAnimationAdapterCompat in project Neo-Launcher by NeoApplications.

the class QuickstepAppTransitionManagerImpl method registerRemoteAnimations.

/**
 * Registers remote animations used when closing apps to home screen.
 */
private void registerRemoteAnimations() {
    // Unregister this
    if (hasControlRemoteAppTransitionPermission()) {
        RemoteAnimationDefinitionCompat definition = new RemoteAnimationDefinitionCompat();
        definition.addRemoteAnimation(WindowManagerWrapper.TRANSIT_WALLPAPER_OPEN, WindowManagerWrapper.ACTIVITY_TYPE_STANDARD, new RemoteAnimationAdapterCompat(getWallpaperOpenRunner(false), CLOSING_TRANSITION_DURATION_MS, 0));
        new ActivityCompat(mLauncher).registerRemoteAnimations(definition);
    }
}
Also used : RemoteAnimationAdapterCompat(com.android.systemui.shared.system.RemoteAnimationAdapterCompat) ActivityCompat(com.android.systemui.shared.system.ActivityCompat) RemoteAnimationDefinitionCompat(com.android.systemui.shared.system.RemoteAnimationDefinitionCompat)

Example 9 with RemoteAnimationAdapterCompat

use of com.android.systemui.shared.system.RemoteAnimationAdapterCompat in project android_packages_apps_Launcher3 by ProtonAOSP.

the class QuickstepTransitionManager method getActivityLaunchOptions.

/**
 * @return ActivityOptions with remote animations that controls how the window of the opening
 * targets are displayed.
 */
public ActivityOptionsWrapper getActivityLaunchOptions(View v) {
    boolean fromRecents = isLaunchingFromRecents(v, null);
    RunnableList onEndCallback = new RunnableList();
    mAppLaunchRunner = new AppLaunchAnimationRunner(v, onEndCallback);
    RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mHandler, mAppLaunchRunner, true);
    // Note that this duration is a guess as we do not know if the animation will be a
    // recents launch or not for sure until we know the opening app targets.
    long duration = fromRecents ? RECENTS_LAUNCH_DURATION : APP_LAUNCH_DURATION;
    long statusBarTransitionDelay = duration - STATUS_BAR_TRANSITION_DURATION - STATUS_BAR_TRANSITION_PRE_DELAY;
    RemoteAnimationAdapterCompat adapterCompat = new RemoteAnimationAdapterCompat(runner, duration, statusBarTransitionDelay, mLauncher.getIApplicationThread());
    return new ActivityOptionsWrapper(ActivityOptionsCompat.makeRemoteAnimation(adapterCompat), onEndCallback);
}
Also used : RemoteAnimationAdapterCompat(com.android.systemui.shared.system.RemoteAnimationAdapterCompat) ActivityOptionsWrapper(com.android.launcher3.util.ActivityOptionsWrapper) RunnableList(com.android.launcher3.util.RunnableList) RemoteAnimationRunnerCompat(com.android.systemui.shared.system.RemoteAnimationRunnerCompat)

Example 10 with RemoteAnimationAdapterCompat

use of com.android.systemui.shared.system.RemoteAnimationAdapterCompat in project android_packages_apps_Launcher3 by ProtonAOSP.

the class QuickstepTransitionManager method registerRemoteAnimations.

/**
 * Registers remote animations used when closing apps to home screen.
 */
public void registerRemoteAnimations() {
    if (SEPARATE_RECENTS_ACTIVITY.get()) {
        return;
    }
    if (hasControlRemoteAppTransitionPermission()) {
        mWallpaperOpenRunner = createWallpaperOpenRunner(false);
        RemoteAnimationDefinitionCompat definition = new RemoteAnimationDefinitionCompat();
        definition.addRemoteAnimation(WindowManagerWrapper.TRANSIT_WALLPAPER_OPEN, WindowManagerWrapper.ACTIVITY_TYPE_STANDARD, new RemoteAnimationAdapterCompat(new LauncherAnimationRunner(mHandler, mWallpaperOpenRunner, false), CLOSING_TRANSITION_DURATION_MS, 0, /* statusBarTransitionDelay */
        mLauncher.getIApplicationThread()));
        if (KEYGUARD_ANIMATION.get()) {
            mKeyguardGoingAwayRunner = createWallpaperOpenRunner(true);
            definition.addRemoteAnimation(WindowManagerWrapper.TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER, new RemoteAnimationAdapterCompat(new LauncherAnimationRunner(mHandler, mKeyguardGoingAwayRunner, true), CLOSING_TRANSITION_DURATION_MS, 0, /* statusBarTransitionDelay */
            mLauncher.getIApplicationThread()));
        }
        new ActivityCompat(mLauncher).registerRemoteAnimations(definition);
    }
}
Also used : RemoteAnimationAdapterCompat(com.android.systemui.shared.system.RemoteAnimationAdapterCompat) ActivityCompat(com.android.systemui.shared.system.ActivityCompat) RemoteAnimationDefinitionCompat(com.android.systemui.shared.system.RemoteAnimationDefinitionCompat)

Aggregations

RemoteAnimationAdapterCompat (com.android.systemui.shared.system.RemoteAnimationAdapterCompat)29 LauncherAnimationRunner (com.android.launcher3.LauncherAnimationRunner)15 ActivityOptionsWrapper (com.android.launcher3.util.ActivityOptionsWrapper)10 RunnableList (com.android.launcher3.util.RunnableList)10 RemoteAnimationRunnerCompat (com.android.systemui.shared.system.RemoteAnimationRunnerCompat)10 AnimatorSet (android.animation.AnimatorSet)8 TaskView (com.android.quickstep.views.TaskView)7 ActivityCompat (com.android.systemui.shared.system.ActivityCompat)7 RemoteAnimationDefinitionCompat (com.android.systemui.shared.system.RemoteAnimationDefinitionCompat)7 RemoteAnimationFactory (com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory)6 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)6 AnimationResult (com.android.launcher3.LauncherAnimationRunner.AnimationResult)5 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 ActivityOptions (android.app.ActivityOptions)1 Handler (android.os.Handler)1 WrappedLauncherAnimationRunner (com.android.launcher3.WrappedLauncherAnimationRunner)1 TaskViewUtils.getRecentsWindowAnimator (com.android.quickstep.TaskViewUtils.getRecentsWindowAnimator)1 RemoteTransitionCompat (com.android.systemui.shared.system.RemoteTransitionCompat)1