Search in sources :

Example 1 with ActivityCompat

use of com.android.systemui.shared.system.ActivityCompat in project android_packages_apps_Launcher3 by crdroidandroid.

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));
        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));
        }
        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 2 with ActivityCompat

use of com.android.systemui.shared.system.ActivityCompat in project android_packages_apps_Launcher3 by crdroidandroid.

the class QuickstepTransitionManager method unregisterRemoteAnimations.

private void unregisterRemoteAnimations() {
    if (SEPARATE_RECENTS_ACTIVITY.get()) {
        return;
    }
    if (hasControlRemoteAppTransitionPermission()) {
        new ActivityCompat(mLauncher).unregisterRemoteAnimations();
        // Also clear strong references to the runners registered with the remote animation
        // definition so we don't have to wait for the system gc
        mWallpaperOpenRunner = null;
        mAppLaunchRunner = null;
        mKeyguardGoingAwayRunner = null;
    }
}
Also used : ActivityCompat(com.android.systemui.shared.system.ActivityCompat)

Aggregations

ActivityCompat (com.android.systemui.shared.system.ActivityCompat)2 RemoteAnimationAdapterCompat (com.android.systemui.shared.system.RemoteAnimationAdapterCompat)1 RemoteAnimationDefinitionCompat (com.android.systemui.shared.system.RemoteAnimationDefinitionCompat)1