use of com.android.launcher3.util.Executors.MAIN_EXECUTOR in project android_packages_apps_Launcher3 by crdroidandroid.
the class SplitSelectStateController method setSecondTaskId.
/**
* To be called after second task selected
*/
public void setSecondTaskId(TaskView taskView) {
if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
// Assume initial task is for top/left part of screen
final int[] taskIds = mInitialPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT ? new int[] { mInitialTaskView.getTask().key.id, taskView.getTask().key.id } : new int[] { taskView.getTask().key.id, mInitialTaskView.getTask().key.id };
RemoteSplitLaunchAnimationRunner animationRunner = new RemoteSplitLaunchAnimationRunner(mInitialTaskView, taskView);
mSystemUiProxy.startTasks(taskIds[0], null, /* mainOptions */
taskIds[1], null, /* sideOptions */
STAGE_POSITION_BOTTOM_OR_RIGHT, new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR));
return;
}
// Assume initial mInitialTaskId is for top/left part of screen
RemoteAnimationFactory initialSplitRunnerWrapped = new SplitLaunchAnimationRunner(mInitialTaskView, 0);
RemoteAnimationFactory secondarySplitRunnerWrapped = new SplitLaunchAnimationRunner(taskView, 1);
RemoteAnimationRunnerCompat initialSplitRunner = new LauncherAnimationRunner(new Handler(Looper.getMainLooper()), initialSplitRunnerWrapped, true);
RemoteAnimationRunnerCompat secondarySplitRunner = new LauncherAnimationRunner(new Handler(Looper.getMainLooper()), secondarySplitRunnerWrapped, true);
ActivityOptions initialOptions = ActivityOptionsCompat.makeRemoteAnimation(new RemoteAnimationAdapterCompat(initialSplitRunner, 300, 150));
ActivityOptions secondaryOptions = ActivityOptionsCompat.makeRemoteAnimation(new RemoteAnimationAdapterCompat(secondarySplitRunner, 300, 150));
mSystemUiProxy.startTask(mInitialTaskView.getTask().key.id, mInitialPosition.mStageType, mInitialPosition.mStagePosition, /*null*/
initialOptions.toBundle());
Pair<Integer, Integer> compliment = getComplimentaryStageAndPosition(mInitialPosition);
mSystemUiProxy.startTask(taskView.getTask().key.id, compliment.first, compliment.second, /*null*/
secondaryOptions.toBundle());
// After successful launch, call resetState
resetState();
}
Aggregations