Search in sources :

Example 1 with AnimationResult

use of com.android.launcher3.LauncherAnimationRunner.AnimationResult in project android_packages_apps_Launcher3 by crdroidandroid.

the class RecentsActivity method getActivityLaunchOptions.

@Override
public ActivityOptionsWrapper getActivityLaunchOptions(final View v, @Nullable ItemInfo item) {
    if (!(v instanceof TaskView)) {
        return super.getActivityLaunchOptions(v, item);
    }
    final TaskView taskView = (TaskView) v;
    RunnableList onEndCallback = new RunnableList();
    mActivityLaunchAnimationRunner = new RemoteAnimationFactory() {

        @Override
        public void onCreateAnimation(int transit, RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets, RemoteAnimationTargetCompat[] nonAppTargets, AnimationResult result) {
            AnimatorSet anim = composeRecentsLaunchAnimator(taskView, appTargets, wallpaperTargets, nonAppTargets);
            anim.addListener(resetStateListener());
            result.setAnimation(anim, RecentsActivity.this, onEndCallback::executeAllAndDestroy, true);
        }

        @Override
        public void onAnimationCancelled() {
            onEndCallback.executeAllAndDestroy();
        }
    };
    final LauncherAnimationRunner wrapper = new LauncherAnimationRunner(mUiHandler, mActivityLaunchAnimationRunner, true);
    RemoteAnimationAdapterCompat adapterCompat = new RemoteAnimationAdapterCompat(wrapper, RECENTS_LAUNCH_DURATION, RECENTS_LAUNCH_DURATION - STATUS_BAR_TRANSITION_DURATION - STATUS_BAR_TRANSITION_PRE_DELAY);
    final ActivityOptionsWrapper activityOptions = new ActivityOptionsWrapper(ActivityOptionsCompat.makeRemoteAnimation(adapterCompat), onEndCallback);
    activityOptions.options.setSplashscreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
    return activityOptions;
}
Also used : RemoteAnimationAdapterCompat(com.android.systemui.shared.system.RemoteAnimationAdapterCompat) TaskView(com.android.quickstep.views.TaskView) RemoteAnimationFactory(com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat) AnimationResult(com.android.launcher3.LauncherAnimationRunner.AnimationResult) ActivityOptionsWrapper(com.android.launcher3.util.ActivityOptionsWrapper) AnimatorSet(android.animation.AnimatorSet) LauncherAnimationRunner(com.android.launcher3.LauncherAnimationRunner) RunnableList(com.android.launcher3.util.RunnableList)

Aggregations

AnimatorSet (android.animation.AnimatorSet)1 LauncherAnimationRunner (com.android.launcher3.LauncherAnimationRunner)1 AnimationResult (com.android.launcher3.LauncherAnimationRunner.AnimationResult)1 RemoteAnimationFactory (com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory)1 ActivityOptionsWrapper (com.android.launcher3.util.ActivityOptionsWrapper)1 RunnableList (com.android.launcher3.util.RunnableList)1 TaskView (com.android.quickstep.views.TaskView)1 RemoteAnimationAdapterCompat (com.android.systemui.shared.system.RemoteAnimationAdapterCompat)1 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)1