summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-02-13 01:50:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-02-13 01:50:09 +0000
commitba747b6f19e2d810cf8bdedde2a0f88e47860ebe (patch)
treed98cbc614198e0b2e9d2138d0c50e71e58ab2c5c
parentaefd062125cb49e98c412e1988845366959899b7 (diff)
parent39552b83b7fded317dd9735e35b002a7f6e7190e (diff)
downloadpackages_apps_Trebuchet-ba747b6f19e2d810cf8bdedde2a0f88e47860ebe.tar.gz
packages_apps_Trebuchet-ba747b6f19e2d810cf8bdedde2a0f88e47860ebe.tar.bz2
packages_apps_Trebuchet-ba747b6f19e2d810cf8bdedde2a0f88e47860ebe.zip
Merge "Skip Launcher opening animation if its not in the set of opening apps." into ub-launcher3-master
-rw-r--r--quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index 2f0cd7833..59b637e1b 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -20,6 +20,7 @@ import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS
import static com.android.systemui.shared.recents.utilities.Utilities.getNextFrameNumber;
import static com.android.systemui.shared.recents.utilities.Utilities.getSurface;
import static com.android.systemui.shared.recents.utilities.Utilities.postAtFrontOfQueueAsynchronously;
+import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -530,7 +531,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
TransactionCompat t = new TransactionCompat();
for (RemoteAnimationTargetCompat target : targets) {
- if (target.mode == RemoteAnimationTargetCompat.MODE_OPENING) {
+ if (target.mode == MODE_OPENING) {
t.setAlpha(target.leash, alpha);
// TODO: This isn't correct at the beginning of the animation, but better
@@ -573,6 +574,16 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
}
}
+ private boolean isLauncherInSetOfOpeningTargets(RemoteAnimationTargetCompat[] targets) {
+ int launcherTaskId = mLauncher.getTaskId();
+ for (RemoteAnimationTargetCompat target : targets) {
+ if (target.mode == MODE_OPENING && target.taskId == launcherTaskId) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* @return Runner that plays when user goes to Launcher
* ie. pressing home, swiping up from nav bar.
@@ -584,9 +595,12 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
Runnable finishedCallback) {
Handler handler = mLauncher.getWindow().getDecorView().getHandler();
postAtFrontOfQueueAsynchronously(handler, () -> {
- if (Utilities.getPrefs(mLauncher).getBoolean("pref_use_screenshot_animation",
- true) && mLauncher.isInState(LauncherState.OVERVIEW)) {
- // We use a separate transition for Overview mode.
+ if ((Utilities.getPrefs(mLauncher).getBoolean("pref_use_screenshot_animation",
+ true) && mLauncher.isInState(LauncherState.OVERVIEW))
+ || !isLauncherInSetOfOpeningTargets(targets)) {
+ // We use a separate transition for Overview mode. And we can skip the
+ // animation in cases where Launcher is not in the set of opening targets.
+ // This can happen when Launcher is already visible. ie. Closing a dialog.
setCurrentAnimator(null);
finishedCallback.run();
return;