diff options
author | Kevin <kevhan@google.com> | 2019-05-07 16:56:12 -0700 |
---|---|---|
committer | Kevin <kevhan@google.com> | 2019-05-07 17:09:43 -0700 |
commit | f95e84a3852e1c85b2326b03431fd4b2ae20ed74 (patch) | |
tree | 8b49a528b91fa10ddff0475ccea310620e9bf8ea /go/quickstep/src | |
parent | 33a2946b7ff02d9e1281d4fd8b95e46fd8df6fa7 (diff) | |
download | android_packages_apps_Trebuchet-f95e84a3852e1c85b2326b03431fd4b2ae20ed74.tar.gz android_packages_apps_Trebuchet-f95e84a3852e1c85b2326b03431fd4b2ae20ed74.tar.bz2 android_packages_apps_Trebuchet-f95e84a3852e1c85b2326b03431fd4b2ae20ed74.zip |
Polish app => recents animation (1/N)
As part of building out a better remote app to overview animation, we
first separate out the logic so that we only do the default layout
animation when coming from a Launcher state (i.e. from home or all
apps) and only then, so coming from an app no longer leads to the tasks
animating.
We do this with a simple flag that indicates that recents will be
using a remote animation.
Bug: 132112131
Test: Go to app, go to recents. No layout animation.
Test: Go to home, go to recents. Layout animation works as normal
Change-Id: I30988d944571fd5317d0c9d13e2a99b167c1291b
Diffstat (limited to 'go/quickstep/src')
3 files changed, 18 insertions, 1 deletions
diff --git a/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java index bba08a40a..d39a66c70 100644 --- a/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java +++ b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java @@ -45,6 +45,7 @@ public final class FallbackActivityControllerHelper extends @Override public AnimationFactory prepareRecentsUI(RecentsActivity activity, boolean activityVisible, boolean animateActivity, Consumer<AnimatorPlaybackController> callback) { + // TODO: Logic for setting remote animation if (activityVisible) { return (transitionLength) -> { }; } diff --git a/go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java b/go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java index 40db7ddbc..d5950077d 100644 --- a/go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -40,6 +40,7 @@ public final class LauncherActivityControllerHelper extends GoActivityControlHel boolean activityVisible, boolean animateActivity, Consumer<AnimatorPlaybackController> callback) { LauncherState fromState = activity.getStateManager().getState(); + activity.<IconRecentsView>getOverviewPanel().setUsingRemoteAnimation(true); //TODO: Implement this based off where the recents view needs to be for app => recents anim. return new AnimationFactory() { @Override @@ -87,6 +88,7 @@ public final class LauncherActivityControllerHelper extends GoActivityControlHel if (launcher == null) { return false; } + launcher.<IconRecentsView>getOverviewPanel().setUsingRemoteAnimation(false); launcher.getUserEventDispatcher().logActionCommand( LauncherLogProto.Action.Command.RECENTS_BUTTON, getContainerType(), diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java index 7225e572b..c69e53458 100644 --- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java @@ -125,6 +125,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable { private View mEmptyView; private View mContentView; private boolean mTransitionedFromApp; + private boolean mUsingRemoteAnimation; private AnimatorSet mLayoutAnimation; private final ArraySet<View> mLayingOutViews = new ArraySet<>(); private Rect mInsets; @@ -276,7 +277,9 @@ public final class IconRecentsView extends FrameLayout implements Insettable { // not be scrollable. mTaskLayoutManager.scrollToPositionWithOffset(TASKS_START_POSITION, 0 /* offset */); } - scheduleFadeInLayoutAnimation(); + if (!mUsingRemoteAnimation) { + scheduleFadeInLayoutAnimation(); + } // Load any task changes if (!mTaskLoader.needsToLoad()) { return; @@ -315,6 +318,17 @@ public final class IconRecentsView extends FrameLayout implements Insettable { } /** + * Set whether we're using a custom remote animation. If so, we will not do the default layout + * animation when entering recents and instead wait for the remote app surface to be ready to + * use. + * + * @param usingRemoteAnimation true if doing a remote animation, false o/w + */ + public void setUsingRemoteAnimation(boolean usingRemoteAnimation) { + mUsingRemoteAnimation = usingRemoteAnimation; + } + + /** * Handles input from the overview button. Launch the most recent task unless we just came from * the app. In that case, we launch the next most recent. */ |