diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-06-12 18:03:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-06-12 18:03:26 +0000 |
commit | 329097b179e9d715bb4fe97cb7144818b26dbe0d (patch) | |
tree | bf68b52e77b8501f33dc585dda7397c53a65f55d /quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java | |
parent | 503f46185a13b11296b30d2ce4eb20a72c0b0a79 (diff) | |
parent | a029a8b2d59a12720c09f778bb69d49d0d2cc7e2 (diff) | |
download | android_packages_apps_Trebuchet-329097b179e9d715bb4fe97cb7144818b26dbe0d.tar.gz android_packages_apps_Trebuchet-329097b179e9d715bb4fe97cb7144818b26dbe0d.tar.bz2 android_packages_apps_Trebuchet-329097b179e9d715bb4fe97cb7144818b26dbe0d.zip |
Merge "Bypass systemstate check when using shared state" into ub-launcher3-qt-dev
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java index 94e704a71..83601e617 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java @@ -49,6 +49,8 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener { private final Consumer<SwipeAnimationTargetSet> mOnFinishListener; private RecentsAnimationControllerCompat mController; + private boolean mCancelled; + public RecentsAnimationListenerSet(boolean shouldMinimizeSplitScreen, Consumer<SwipeAnimationTargetSet> onFinishListener) { mShouldMinimizeSplitScreen = shouldMinimizeSplitScreen; @@ -75,11 +77,16 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener { SwipeAnimationTargetSet targetSet = new SwipeAnimationTargetSet(controller, targets, homeContentInsets, minimizedHomeBounds, mShouldMinimizeSplitScreen, mOnFinishListener); - Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> { - for (SwipeAnimationListener listener : getListeners()) { - listener.onRecentsAnimationStart(targetSet); - } - }); + + if (mCancelled) { + targetSet.cancelAnimation(); + } else { + Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> { + for (SwipeAnimationListener listener : getListeners()) { + listener.onRecentsAnimationStart(targetSet); + } + }); + } } @Override @@ -99,4 +106,9 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener { private SwipeAnimationListener[] getListeners() { return mListeners.toArray(new SwipeAnimationListener[mListeners.size()]); } + + public void cancelListener() { + mCancelled = true; + onAnimationCanceled(false); + } } |