Loading quickstep/src/com/android/launcher3/LauncherAnimationRunner.java +15 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.systemui.shared.recents.utilities.Utilities.postAtFrontOfQueueAsynchronously; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; Loading @@ -35,20 +36,31 @@ public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCo private static final int REFRESH_RATE_MS = 16; private final Handler mHandler; private final boolean mStartAtFrontOfQueue; private AnimationResult mAnimationResult; public LauncherAnimationRunner(Handler handler) { /** * @param startAtFrontOfQueue If true, the animation start will be posted at the front of the * queue to minimize latency. */ public LauncherAnimationRunner(Handler handler, boolean startAtFrontOfQueue) { mHandler = handler; mStartAtFrontOfQueue = startAtFrontOfQueue; } @BinderThread @Override public void onAnimationStart(RemoteAnimationTargetCompat[] targetCompats, Runnable runnable) { postAsyncCallback(mHandler, () -> { Runnable r = () -> { finishExistingAnimation(); mAnimationResult = new AnimationResult(runnable); onCreateAnimation(targetCompats, mAnimationResult); }); }; if (mStartAtFrontOfQueue) { postAtFrontOfQueueAsynchronously(mHandler, r); } else { postAsyncCallback(mHandler, r); } } /** Loading quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +3 −2 Original line number Diff line number Diff line Loading @@ -162,7 +162,8 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag @Override public ActivityOptions getActivityLaunchOptions(Launcher launcher, View v) { if (hasControlRemoteAppTransitionPermission()) { RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mHandler) { RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mHandler, true /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, Loading Loading @@ -572,7 +573,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag * ie. pressing home, swiping up from nav bar. */ private RemoteAnimationRunnerCompat getWallpaperOpenRunner() { return new LauncherAnimationRunner(mHandler) { return new LauncherAnimationRunner(mHandler, false /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, AnimationResult result) { Loading quickstep/src/com/android/quickstep/RecentsActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,8 @@ public class RecentsActivity extends BaseDraggingActivity { } final TaskView taskView = (TaskView) v; RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mUiHandler) { RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mUiHandler, true /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, Loading quickstep/src/com/android/quickstep/util/RemoteAnimationProvider.java +2 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ public interface RemoteAnimationProvider { AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] targets); default ActivityOptions toActivityOptions(Handler handler, long duration) { LauncherAnimationRunner runner = new LauncherAnimationRunner(handler) { LauncherAnimationRunner runner = new LauncherAnimationRunner(handler, false /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, Loading Loading
quickstep/src/com/android/launcher3/LauncherAnimationRunner.java +15 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.systemui.shared.recents.utilities.Utilities.postAtFrontOfQueueAsynchronously; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; Loading @@ -35,20 +36,31 @@ public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCo private static final int REFRESH_RATE_MS = 16; private final Handler mHandler; private final boolean mStartAtFrontOfQueue; private AnimationResult mAnimationResult; public LauncherAnimationRunner(Handler handler) { /** * @param startAtFrontOfQueue If true, the animation start will be posted at the front of the * queue to minimize latency. */ public LauncherAnimationRunner(Handler handler, boolean startAtFrontOfQueue) { mHandler = handler; mStartAtFrontOfQueue = startAtFrontOfQueue; } @BinderThread @Override public void onAnimationStart(RemoteAnimationTargetCompat[] targetCompats, Runnable runnable) { postAsyncCallback(mHandler, () -> { Runnable r = () -> { finishExistingAnimation(); mAnimationResult = new AnimationResult(runnable); onCreateAnimation(targetCompats, mAnimationResult); }); }; if (mStartAtFrontOfQueue) { postAtFrontOfQueueAsynchronously(mHandler, r); } else { postAsyncCallback(mHandler, r); } } /** Loading
quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +3 −2 Original line number Diff line number Diff line Loading @@ -162,7 +162,8 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag @Override public ActivityOptions getActivityLaunchOptions(Launcher launcher, View v) { if (hasControlRemoteAppTransitionPermission()) { RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mHandler) { RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mHandler, true /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, Loading Loading @@ -572,7 +573,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag * ie. pressing home, swiping up from nav bar. */ private RemoteAnimationRunnerCompat getWallpaperOpenRunner() { return new LauncherAnimationRunner(mHandler) { return new LauncherAnimationRunner(mHandler, false /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, AnimationResult result) { Loading
quickstep/src/com/android/quickstep/RecentsActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,8 @@ public class RecentsActivity extends BaseDraggingActivity { } final TaskView taskView = (TaskView) v; RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mUiHandler) { RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(mUiHandler, true /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, Loading
quickstep/src/com/android/quickstep/util/RemoteAnimationProvider.java +2 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ public interface RemoteAnimationProvider { AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] targets); default ActivityOptions toActivityOptions(Handler handler, long duration) { LauncherAnimationRunner runner = new LauncherAnimationRunner(handler) { LauncherAnimationRunner runner = new LauncherAnimationRunner(handler, false /* startAtFrontOfQueue */) { @Override public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, Loading