mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Merge changes from topic "am-40c467ee-c39c-4073-8110-b85bfe660cdb" into ub-launcher3-master
* changes:
[automerger] Post at front of queue for app launch and recents launch am: 6e9f6838b8
Post at front of queue for app launch and recents launch
This commit is contained in:
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user