Loading packages/SystemUI/res/values/config.xml +0 −12 Original line number Diff line number Diff line Loading @@ -159,18 +159,6 @@ in from the bottom of the screen. --> <integer name="recents_enter_from_home_transition_duration">100</integer> <!-- The duration for animating the task from the bottom of the screen when transitioning from home. --> <integer name="recents_task_enter_from_home_duration">225</integer> <!-- The stagger for each task when animating the task from the bottom of the screen when transitioning from home. --> <integer name="recents_task_enter_from_home_stagger_delay">12</integer> <!-- The duration of the animation of the tasks to the bottom of the screen when leaving Recents to go back to the Launcher. --> <integer name="recents_task_exit_to_home_duration">225</integer> <!-- The min animation duration for animating the nav bar scrim in. --> <integer name="recents_nav_bar_scrim_enter_duration">400</integer> Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +3 −5 Original line number Diff line number Diff line Loading @@ -531,8 +531,7 @@ public class RecentsView extends FrameLayout { public final void onBusEvent(DismissRecentsToHomeAnimationStarted event) { // Hide the history button int taskViewExitToHomeDuration = getResources().getInteger( R.integer.recents_task_exit_to_home_duration); int taskViewExitToHomeDuration = TaskStackAnimationHelper.EXIT_TO_HOME_TRANSLATION_DURATION; hideHistoryButton(taskViewExitToHomeDuration, false /* translate */); animateBackgroundScrim(0f, taskViewExitToHomeDuration); } Loading Loading @@ -647,9 +646,8 @@ public class RecentsView extends FrameLayout { public final void onBusEvent(EnterRecentsWindowAnimationCompletedEvent event) { RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); if (!launchState.launchedFromAppWithThumbnail && mStack.getTaskCount() > 0) { int taskViewEnterFromHomeDuration = getResources().getInteger( R.integer.recents_task_enter_from_home_duration); animateBackgroundScrim(DEFAULT_SCRIM_ALPHA, taskViewEnterFromHomeDuration); animateBackgroundScrim(DEFAULT_SCRIM_ALPHA, TaskStackAnimationHelper.ENTER_FROM_HOME_TRANSLATION_DURATION); } } Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java +48 −19 Original line number Diff line number Diff line Loading @@ -20,8 +20,10 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.res.Resources; import android.graphics.Path; import android.graphics.RectF; import android.view.View; import android.view.animation.PathInterpolator; import com.android.systemui.Interpolators; import com.android.systemui.R; Loading Loading @@ -63,6 +65,22 @@ public class TaskStackAnimationHelper { ReferenceCountedTrigger postAnimationTrigger); } private static final int FRAME_OFFSET_MS = 16; public static final int ENTER_FROM_HOME_ALPHA_DURATION = 100; public static final int ENTER_FROM_HOME_TRANSLATION_DURATION = 333; private static final PathInterpolator ENTER_FROM_HOME_TRANSLATION_INTERPOLATOR = new PathInterpolator(0, 0, 0, 1f); private static final PathInterpolator ENTER_FROM_HOME_ALPHA_INTERPOLATOR = new PathInterpolator(0, 0, 0.2f, 1f); public static final int EXIT_TO_HOME_ALPHA_DURATION = 100; public static final int EXIT_TO_HOME_TRANSLATION_DURATION = 150; private static final PathInterpolator EXIT_TO_HOME_TRANSLATION_INTERPOLATOR = new PathInterpolator(0.8f, 0, 0.6f, 1f); private static final PathInterpolator EXIT_TO_HOME_ALPHA_INTERPOLATOR = new PathInterpolator(0.4f, 0, 1f, 1f); private TaskStackView mStackView; private TaskViewTransform mTmpTransform = new TaskViewTransform(); Loading Loading @@ -157,15 +175,12 @@ public class TaskStackAnimationHelper { R.integer.recents_task_enter_from_app_duration); int taskViewEnterFromAffiliatedAppDuration = res.getInteger( R.integer.recents_task_enter_from_affiliated_app_duration); int taskViewEnterFromHomeDuration = res.getInteger( R.integer.recents_task_enter_from_home_duration); int taskViewEnterFromHomeStaggerDelay = res.getInteger( R.integer.recents_task_enter_from_home_stagger_delay); // Create enter animations for each of the views from front to back List<TaskView> taskViews = mStackView.getTaskViews(); int taskViewCount = taskViews.size(); for (int i = taskViewCount - 1; i >= 0; i--) { int taskIndexFromFront = taskViewCount - i - 1; final TaskView tv = taskViews.get(i); Task task = tv.getTask(); boolean currentTaskOccludesLaunchTarget = false; Loading Loading @@ -202,14 +217,16 @@ public class TaskStackAnimationHelper { } else if (launchState.launchedFromHome) { // Animate the tasks up int frontIndex = (taskViewCount - i - 1); int delay = frontIndex * taskViewEnterFromHomeStaggerDelay; int duration = taskViewEnterFromHomeDuration + frontIndex * taskViewEnterFromHomeStaggerDelay; AnimationProps taskAnimation = new AnimationProps(delay, duration, Interpolators.DECELERATE_QUINT, postAnimationTrigger.decrementOnAnimationEnd()); AnimationProps taskAnimation = new AnimationProps() .setStartDelay(AnimationProps.ALPHA, taskIndexFromFront * FRAME_OFFSET_MS) .setDuration(AnimationProps.ALPHA, ENTER_FROM_HOME_ALPHA_DURATION) .setDuration(AnimationProps.BOUNDS, ENTER_FROM_HOME_TRANSLATION_DURATION - (taskIndexFromFront * FRAME_OFFSET_MS)) .setInterpolator(AnimationProps.BOUNDS, ENTER_FROM_HOME_TRANSLATION_INTERPOLATOR) .setInterpolator(AnimationProps.ALPHA, ENTER_FROM_HOME_ALPHA_INTERPOLATOR) .setListener(postAnimationTrigger.decrementOnAnimationEnd()); postAnimationTrigger.increment(); mStackView.updateTaskViewToTransform(tv, mTmpTransform, taskAnimation); } Loading @@ -221,7 +238,6 @@ public class TaskStackAnimationHelper { */ public void startExitToHomeAnimation(boolean animated, ReferenceCountedTrigger postAnimationTrigger) { Resources res = mStackView.getResources(); TaskStackLayoutAlgorithm stackLayout = mStackView.getStackAlgorithm(); TaskStackViewScroller stackScroller = mStackView.getScroller(); TaskStack stack = mStackView.getStack(); Loading @@ -232,19 +248,32 @@ public class TaskStackAnimationHelper { } int offscreenY = stackLayout.mStackRect.bottom; int taskViewExitToHomeDuration = res.getInteger( R.integer.recents_task_exit_to_home_duration); // Create the animations for each of the tasks List<TaskView> taskViews = mStackView.getTaskViews(); int taskViewCount = taskViews.size(); for (int i = 0; i < taskViewCount; i++) { int taskIndexFromFront = taskViewCount - i - 1; TaskView tv = taskViews.get(i); Task task = tv.getTask(); AnimationProps taskAnimation = new AnimationProps( animated ? taskViewExitToHomeDuration : 0, Interpolators.FAST_OUT_LINEAR_IN, postAnimationTrigger.decrementOnAnimationEnd()); // Animate the tasks down AnimationProps taskAnimation; if (animated) { taskAnimation = new AnimationProps() .setStartDelay(AnimationProps.ALPHA, i * FRAME_OFFSET_MS) .setDuration(AnimationProps.ALPHA, EXIT_TO_HOME_ALPHA_DURATION) .setDuration(AnimationProps.BOUNDS, EXIT_TO_HOME_TRANSLATION_DURATION + (taskIndexFromFront * FRAME_OFFSET_MS)) .setInterpolator(AnimationProps.BOUNDS, EXIT_TO_HOME_TRANSLATION_INTERPOLATOR) .setInterpolator(AnimationProps.ALPHA, EXIT_TO_HOME_ALPHA_INTERPOLATOR) .setListener(postAnimationTrigger.decrementOnAnimationEnd()); postAnimationTrigger.increment(); } else { taskAnimation = AnimationProps.IMMEDIATE; } stackLayout.getStackTransform(task, stackScroller.getStackScroll(), mTmpTransform, null); Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +1 −2 Original line number Diff line number Diff line Loading @@ -1558,8 +1558,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mAnimationHelper.startExitToHomeAnimation(event.animated, event.getAnimationTrigger()); // Dismiss the freeform workspace background int taskViewExitToHomeDuration = getResources().getInteger( R.integer.recents_task_exit_to_home_duration); int taskViewExitToHomeDuration = TaskStackAnimationHelper.EXIT_TO_HOME_TRANSLATION_DURATION; animateFreeformWorkspaceBackgroundAlpha(0, new AnimationProps(taskViewExitToHomeDuration, Interpolators.FAST_OUT_SLOW_IN)); } Loading Loading
packages/SystemUI/res/values/config.xml +0 −12 Original line number Diff line number Diff line Loading @@ -159,18 +159,6 @@ in from the bottom of the screen. --> <integer name="recents_enter_from_home_transition_duration">100</integer> <!-- The duration for animating the task from the bottom of the screen when transitioning from home. --> <integer name="recents_task_enter_from_home_duration">225</integer> <!-- The stagger for each task when animating the task from the bottom of the screen when transitioning from home. --> <integer name="recents_task_enter_from_home_stagger_delay">12</integer> <!-- The duration of the animation of the tasks to the bottom of the screen when leaving Recents to go back to the Launcher. --> <integer name="recents_task_exit_to_home_duration">225</integer> <!-- The min animation duration for animating the nav bar scrim in. --> <integer name="recents_nav_bar_scrim_enter_duration">400</integer> Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +3 −5 Original line number Diff line number Diff line Loading @@ -531,8 +531,7 @@ public class RecentsView extends FrameLayout { public final void onBusEvent(DismissRecentsToHomeAnimationStarted event) { // Hide the history button int taskViewExitToHomeDuration = getResources().getInteger( R.integer.recents_task_exit_to_home_duration); int taskViewExitToHomeDuration = TaskStackAnimationHelper.EXIT_TO_HOME_TRANSLATION_DURATION; hideHistoryButton(taskViewExitToHomeDuration, false /* translate */); animateBackgroundScrim(0f, taskViewExitToHomeDuration); } Loading Loading @@ -647,9 +646,8 @@ public class RecentsView extends FrameLayout { public final void onBusEvent(EnterRecentsWindowAnimationCompletedEvent event) { RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); if (!launchState.launchedFromAppWithThumbnail && mStack.getTaskCount() > 0) { int taskViewEnterFromHomeDuration = getResources().getInteger( R.integer.recents_task_enter_from_home_duration); animateBackgroundScrim(DEFAULT_SCRIM_ALPHA, taskViewEnterFromHomeDuration); animateBackgroundScrim(DEFAULT_SCRIM_ALPHA, TaskStackAnimationHelper.ENTER_FROM_HOME_TRANSLATION_DURATION); } } Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java +48 −19 Original line number Diff line number Diff line Loading @@ -20,8 +20,10 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.res.Resources; import android.graphics.Path; import android.graphics.RectF; import android.view.View; import android.view.animation.PathInterpolator; import com.android.systemui.Interpolators; import com.android.systemui.R; Loading Loading @@ -63,6 +65,22 @@ public class TaskStackAnimationHelper { ReferenceCountedTrigger postAnimationTrigger); } private static final int FRAME_OFFSET_MS = 16; public static final int ENTER_FROM_HOME_ALPHA_DURATION = 100; public static final int ENTER_FROM_HOME_TRANSLATION_DURATION = 333; private static final PathInterpolator ENTER_FROM_HOME_TRANSLATION_INTERPOLATOR = new PathInterpolator(0, 0, 0, 1f); private static final PathInterpolator ENTER_FROM_HOME_ALPHA_INTERPOLATOR = new PathInterpolator(0, 0, 0.2f, 1f); public static final int EXIT_TO_HOME_ALPHA_DURATION = 100; public static final int EXIT_TO_HOME_TRANSLATION_DURATION = 150; private static final PathInterpolator EXIT_TO_HOME_TRANSLATION_INTERPOLATOR = new PathInterpolator(0.8f, 0, 0.6f, 1f); private static final PathInterpolator EXIT_TO_HOME_ALPHA_INTERPOLATOR = new PathInterpolator(0.4f, 0, 1f, 1f); private TaskStackView mStackView; private TaskViewTransform mTmpTransform = new TaskViewTransform(); Loading Loading @@ -157,15 +175,12 @@ public class TaskStackAnimationHelper { R.integer.recents_task_enter_from_app_duration); int taskViewEnterFromAffiliatedAppDuration = res.getInteger( R.integer.recents_task_enter_from_affiliated_app_duration); int taskViewEnterFromHomeDuration = res.getInteger( R.integer.recents_task_enter_from_home_duration); int taskViewEnterFromHomeStaggerDelay = res.getInteger( R.integer.recents_task_enter_from_home_stagger_delay); // Create enter animations for each of the views from front to back List<TaskView> taskViews = mStackView.getTaskViews(); int taskViewCount = taskViews.size(); for (int i = taskViewCount - 1; i >= 0; i--) { int taskIndexFromFront = taskViewCount - i - 1; final TaskView tv = taskViews.get(i); Task task = tv.getTask(); boolean currentTaskOccludesLaunchTarget = false; Loading Loading @@ -202,14 +217,16 @@ public class TaskStackAnimationHelper { } else if (launchState.launchedFromHome) { // Animate the tasks up int frontIndex = (taskViewCount - i - 1); int delay = frontIndex * taskViewEnterFromHomeStaggerDelay; int duration = taskViewEnterFromHomeDuration + frontIndex * taskViewEnterFromHomeStaggerDelay; AnimationProps taskAnimation = new AnimationProps(delay, duration, Interpolators.DECELERATE_QUINT, postAnimationTrigger.decrementOnAnimationEnd()); AnimationProps taskAnimation = new AnimationProps() .setStartDelay(AnimationProps.ALPHA, taskIndexFromFront * FRAME_OFFSET_MS) .setDuration(AnimationProps.ALPHA, ENTER_FROM_HOME_ALPHA_DURATION) .setDuration(AnimationProps.BOUNDS, ENTER_FROM_HOME_TRANSLATION_DURATION - (taskIndexFromFront * FRAME_OFFSET_MS)) .setInterpolator(AnimationProps.BOUNDS, ENTER_FROM_HOME_TRANSLATION_INTERPOLATOR) .setInterpolator(AnimationProps.ALPHA, ENTER_FROM_HOME_ALPHA_INTERPOLATOR) .setListener(postAnimationTrigger.decrementOnAnimationEnd()); postAnimationTrigger.increment(); mStackView.updateTaskViewToTransform(tv, mTmpTransform, taskAnimation); } Loading @@ -221,7 +238,6 @@ public class TaskStackAnimationHelper { */ public void startExitToHomeAnimation(boolean animated, ReferenceCountedTrigger postAnimationTrigger) { Resources res = mStackView.getResources(); TaskStackLayoutAlgorithm stackLayout = mStackView.getStackAlgorithm(); TaskStackViewScroller stackScroller = mStackView.getScroller(); TaskStack stack = mStackView.getStack(); Loading @@ -232,19 +248,32 @@ public class TaskStackAnimationHelper { } int offscreenY = stackLayout.mStackRect.bottom; int taskViewExitToHomeDuration = res.getInteger( R.integer.recents_task_exit_to_home_duration); // Create the animations for each of the tasks List<TaskView> taskViews = mStackView.getTaskViews(); int taskViewCount = taskViews.size(); for (int i = 0; i < taskViewCount; i++) { int taskIndexFromFront = taskViewCount - i - 1; TaskView tv = taskViews.get(i); Task task = tv.getTask(); AnimationProps taskAnimation = new AnimationProps( animated ? taskViewExitToHomeDuration : 0, Interpolators.FAST_OUT_LINEAR_IN, postAnimationTrigger.decrementOnAnimationEnd()); // Animate the tasks down AnimationProps taskAnimation; if (animated) { taskAnimation = new AnimationProps() .setStartDelay(AnimationProps.ALPHA, i * FRAME_OFFSET_MS) .setDuration(AnimationProps.ALPHA, EXIT_TO_HOME_ALPHA_DURATION) .setDuration(AnimationProps.BOUNDS, EXIT_TO_HOME_TRANSLATION_DURATION + (taskIndexFromFront * FRAME_OFFSET_MS)) .setInterpolator(AnimationProps.BOUNDS, EXIT_TO_HOME_TRANSLATION_INTERPOLATOR) .setInterpolator(AnimationProps.ALPHA, EXIT_TO_HOME_ALPHA_INTERPOLATOR) .setListener(postAnimationTrigger.decrementOnAnimationEnd()); postAnimationTrigger.increment(); } else { taskAnimation = AnimationProps.IMMEDIATE; } stackLayout.getStackTransform(task, stackScroller.getStackScroll(), mTmpTransform, null); Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +1 −2 Original line number Diff line number Diff line Loading @@ -1558,8 +1558,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mAnimationHelper.startExitToHomeAnimation(event.animated, event.getAnimationTrigger()); // Dismiss the freeform workspace background int taskViewExitToHomeDuration = getResources().getInteger( R.integer.recents_task_exit_to_home_duration); int taskViewExitToHomeDuration = TaskStackAnimationHelper.EXIT_TO_HOME_TRANSLATION_DURATION; animateFreeformWorkspaceBackgroundAlpha(0, new AnimationProps(taskViewExitToHomeDuration, Interpolators.FAST_OUT_SLOW_IN)); } Loading