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

Commit f24f2169 authored by Winson's avatar Winson
Browse files

Refactoring and unifying TaskView animations.

- Adding notion of a TaskViewAnimation to animate a TaskView to a
  specific TaskViewTransform
- Refactoring task view enter/exit/launch/delete animations into
  a separate class so that we can improve them easier
- Removing individual TaskView view property animations in favor
  of using the existing TaskStackView stack animation. This ensures that
  we don't have to add separate logic when animating TaskViews.  It is
  all handled by the TaskStackView now.
- Breaking down the TaskStackView synchronize method into binding
  TaskViews and updating them to transforms.  This allows us to
  synchronously update in many cases and is cleaner than the many
  request* calls.

Change-Id: Ib26793568a14e837e6782358155f21158a133992
parent ef06413a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@
    <integer name="recents_nav_bar_scrim_enter_duration">400</integer>

    <!-- The animation duration for animating the removal of a task view. -->
    <integer name="recents_animate_task_view_remove_duration">250</integer>
    <integer name="recents_animate_task_view_remove_duration">175</integer>

    <!-- The animation duration for scrolling the stack to a particular item. -->
    <integer name="recents_animate_task_stack_scroll_duration">200</integer>
+0 −1
Original line number Diff line number Diff line
@@ -28,5 +28,4 @@ public class DismissRecentsToHomeAnimationStarted extends EventBus.AnimatedEvent
    public DismissRecentsToHomeAnimationStarted(boolean animated) {
        this.animated = animated;
    }

}
+9 −7
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.systemui.recents.misc;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.util.Log;

import java.util.ArrayList;

@@ -107,16 +105,20 @@ public class ReferenceCountedTrigger {
        mLastDecRunnables.clear();
    }

    /** Convenience method to decrement this trigger as a runnable. */
    public Runnable decrementAsRunnable() {
        return mDecrementRunnable;
    }
    /** Convenience method to decrement this trigger as a animator listener. */
    /**
     * Convenience method to decrement this trigger as a animator listener.  This listener is
     * guarded to prevent being called back multiple times, and will trigger a decrement once and
     * only once.
     */
    public Animator.AnimatorListener decrementOnAnimationEnd() {
        return new AnimatorListenerAdapter() {
            private boolean hasEnded;

            @Override
            public void onAnimationEnd(Animator animation) {
                if (hasEnded) return;
                decrement();
                hasEnded = true;
            }
        };
    }
+9 −0
Original line number Diff line number Diff line
@@ -87,6 +87,15 @@ public class Utilities {
                    (1f - overlayAlpha) * Color.blue(overlayColor)));
    }

    /**
     * Cancels an animation.
     */
    public static void cancelAnimation(Animator animator) {
        if (animator != null) {
            animator.cancel();
        }
    }

    /**
     * Cancels an animation ensuring that if it has listeners, onCancel and onEnd
     * are not called.
+0 −3
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.ArraySet;
import android.util.Log;
import com.android.systemui.Prefs;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.RecentsConfiguration;
@@ -115,8 +114,6 @@ public class RecentsTaskLoadPlan {
     * - least-recent to most-recent freeform tasks
     */
    public synchronized void preloadPlan(RecentsTaskLoader loader, boolean isTopTaskHome) {
        RecentsConfiguration config = Recents.getConfiguration();
        SystemServicesProxy ssp = Recents.getSystemServices();
        Resources res = mContext.getResources();
        ArrayList<Task> allTasks = new ArrayList<>();
        if (mRawTasks == null) {
Loading