Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f95e84a3 authored by Kevin's avatar Kevin
Browse files

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
parent 33a2946b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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) -> { };
        }
+2 −0
Original line number Diff line number Diff line
@@ -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(),
+15 −1
Original line number Diff line number Diff line
@@ -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 */);
        }
        if (!mUsingRemoteAnimation) {
            scheduleFadeInLayoutAnimation();
        }
        // Load any task changes
        if (!mTaskLoader.needsToLoad()) {
            return;
@@ -314,6 +317,17 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
        mTransitionedFromApp = transitionedFromApp;
    }

    /**
     * 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.