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);
}
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);
}
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);
}
}
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);
}
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);
}
}
Aggregations