Merge "Tweaking animation XMLs and removing dead code. (Bug 17672056, Bug 18415217)" into lmp-mr1-dev

This commit is contained in:
Winson Chung
2014-11-18 20:10:03 +00:00
committed by Android (Google) Code Review
23 changed files with 134 additions and 109 deletions

View File

@@ -16,7 +16,7 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<!-- Recents Activity -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:shareInterpolator="false"
android:zAdjustment="top"> android:zAdjustment="top">

View File

@@ -16,7 +16,7 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<!-- Incoming Activity -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:shareInterpolator="false"
android:zAdjustment="normal"> android:zAdjustment="normal">

View File

@@ -16,13 +16,13 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<!-- Recents Activity -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:shareInterpolator="false"
android:zAdjustment="normal"> android:zAdjustment="normal">
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
android:fillEnabled="true" android:fillEnabled="true"
android:fillBefore="true" android:fillAfter="true" android:fillBefore="true" android:fillAfter="true"
android:interpolator="@android:interpolator/linear" android:interpolator="@android:interpolator/linear"
android:duration="50"/> android:duration="1"/>
</set> </set>

View File

@@ -16,14 +16,13 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<!-- Launcher Activity -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:shareInterpolator="false"
android:zAdjustment="top"> android:zAdjustment="top">
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
android:startOffset="50"
android:fillEnabled="true" android:fillEnabled="true"
android:fillBefore="true" android:fillAfter="true" android:fillBefore="true" android:fillAfter="true"
android:interpolator="@android:interpolator/linear_out_slow_in" android:interpolator="@android:interpolator/linear_out_slow_in"
android:duration="100"/> android:duration="@integer/recents_enter_from_home_transition_duration"/>
</set> </set>

View File

@@ -16,7 +16,7 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<!-- Launcher Activity -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:shareInterpolator="false"
android:zAdjustment="normal"> android:zAdjustment="normal">

View File

@@ -16,14 +16,13 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<!-- Recents Activity -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:shareInterpolator="false"
android:zAdjustment="top"> android:zAdjustment="top">
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
android:startOffset="100"
android:fillEnabled="true" android:fillEnabled="true"
android:fillBefore="true" android:fillAfter="true" android:fillBefore="true" android:fillAfter="true"
android:interpolator="@android:interpolator/linear" android:interpolator="@android:interpolator/linear"
android:duration="50"/> android:duration="100"/>
</set> </set>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -16,5 +16,11 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#ff9cdfd9"> android:color="#ff9cdfd9">
<item android:drawable="@drawable/btn_fab_recents" /> <item>
<shape android:shape="oval">
<solid android:color="#9cc8c4" />
<size android:width="@dimen/recents_lock_to_app_size"
android:height="@dimen/recents_lock_to_app_size" />
</shape>
</item>
</ripple> </ripple>

View File

@@ -29,8 +29,8 @@
<include layout="@layout/recents_task_view_header" /> <include layout="@layout/recents_task_view_header" />
<FrameLayout <FrameLayout
android:id="@+id/lock_to_app_fab" android:id="@+id/lock_to_app_fab"
android:layout_width="48dp" android:layout_width="@dimen/recents_lock_to_app_size"
android:layout_height="48dp" android:layout_height="@dimen/recents_lock_to_app_size"
android:layout_gravity="bottom|right" android:layout_gravity="bottom|right"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp"
@@ -38,8 +38,8 @@
android:contentDescription="@string/recents_lock_to_app_button_label" android:contentDescription="@string/recents_lock_to_app_button_label"
android:background="@drawable/recents_lock_to_task_button_bg"> android:background="@drawable/recents_lock_to_task_button_bg">
<ImageView <ImageView
android:layout_width="24dp" android:layout_width="@dimen/recents_lock_to_app_icon_size"
android:layout_height="24dp" android:layout_height="@dimen/recents_lock_to_app_icon_size"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/recents_lock_to_app_pin" /> android:src="@drawable/recents_lock_to_app_pin" />
</FrameLayout> </FrameLayout>

View File

@@ -144,42 +144,61 @@
<!-- The duration in seconds to wait before the dismiss buttons are shown. --> <!-- The duration in seconds to wait before the dismiss buttons are shown. -->
<integer name="recents_task_bar_dismiss_delay_seconds">1</integer> <integer name="recents_task_bar_dismiss_delay_seconds">1</integer>
<!-- The min animation duration for animating views that are currently visible. --> <!-- The min animation duration for animating views that are currently visible. -->
<integer name="recents_filter_animate_current_views_duration">250</integer> <integer name="recents_filter_animate_current_views_duration">250</integer>
<!-- The min animation duration for animating views that are newly visible. --> <!-- The min animation duration for animating views that are newly visible. -->
<integer name="recents_filter_animate_new_views_duration">250</integer> <integer name="recents_filter_animate_new_views_duration">250</integer>
<!-- The min animation duration for animating the task bar in. -->
<integer name="recents_animate_task_bar_enter_duration">225</integer> <!-- The duration of the window transition when coming to Recents from an app.
<!-- The animation delay for animating the first task in. This should roughly be the animation In order to defer the in-app animations until after the transition is complete,
duration of the transition in to recents. --> we also need to use this value as the starting delay when animating the first
<integer name="recents_animate_task_bar_enter_delay">275</integer> task decorations in. -->
<!-- The min animation duration for animating the task bar out. --> <integer name="recents_enter_from_app_transition_duration">325</integer>
<integer name="recents_animate_task_exit_to_home_duration">225</integer>
<!-- The min animation duration for animating the task bar out. --> <!-- The duration for animating the task decorations in after transitioning from an app. -->
<integer name="recents_animate_task_bar_exit_duration">125</integer> <integer name="recents_task_enter_from_app_duration">200</integer>
<!-- The animation delay for animating the first task in. This should roughly be the animation
duration of the transition in to recents from home. --> <!-- The duration for animating the task decorations out before transitioning to an app. -->
<integer name="recents_animate_task_enter_from_home_delay">150</integer> <integer name="recents_task_exit_to_app_duration">125</integer>
<!-- The min animation duration for animating the task in when transitioning from home. -->
<integer name="recents_animate_task_enter_from_home_duration">250</integer> <!-- The duration of the window transition when coming to Recents from the Launcher.
<!-- The animation stagger to apply to each task animation when transitioning from home. --> In order to defer the in-app animations until after the transition is complete,
<integer name="recents_animate_task_enter_from_home_stagger_delay">12</integer> we also need to use this value as the starting delay when animating the task views
<!-- The short duration when animating in/out the lock to app button. --> in from the bottom of the screen. -->
<integer name="recents_animate_lock_to_app_button_short_duration">150</integer> <integer name="recents_enter_from_home_transition_duration">100</integer>
<!-- The long duration when animating in/out the lock to app button. -->
<integer name="recents_animate_lock_to_app_button_long_duration">300</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. --> <!-- The min animation duration for animating the nav bar scrim in. -->
<integer name="recents_nav_bar_scrim_enter_duration">400</integer> <integer name="recents_nav_bar_scrim_enter_duration">400</integer>
<!-- The animation duration for animating the removal of a task view. --> <!-- 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">250</integer>
<!-- The animation duration for scrolling the stack to a particular item. --> <!-- The animation duration for scrolling the stack to a particular item. -->
<integer name="recents_animate_task_stack_scroll_duration">225</integer> <integer name="recents_animate_task_stack_scroll_duration">225</integer>
<!-- The minimum alpha for the dim applied to cards that go deeper into the stack. --> <!-- The minimum alpha for the dim applied to cards that go deeper into the stack. -->
<integer name="recents_max_task_stack_view_dim">96</integer> <integer name="recents_max_task_stack_view_dim">96</integer>
<!-- The delay to enforce between each alt-tab key press. --> <!-- The delay to enforce between each alt-tab key press. -->
<integer name="recents_alt_tab_key_delay">200</integer> <integer name="recents_alt_tab_key_delay">200</integer>
<!-- Transposes the search bar layout in landscape. --> <!-- Transposes the search bar layout in landscape. -->
<bool name="recents_has_transposed_search_bar">true</bool> <bool name="recents_has_transposed_search_bar">true</bool>
<!-- Transposes the nav bar in landscape (only used for purposes of layout). --> <!-- Transposes the nav bar in landscape (only used for purposes of layout). -->
<bool name="recents_has_transposed_nav_bar">true</bool> <bool name="recents_has_transposed_nav_bar">true</bool>
<!-- Svelte specific logic, see RecentsConfiguration.SVELTE_* constants. --> <!-- Svelte specific logic, see RecentsConfiguration.SVELTE_* constants. -->

View File

@@ -226,9 +226,6 @@
<!-- The amount of highlight to make on each task view. --> <!-- The amount of highlight to make on each task view. -->
<dimen name="recents_task_view_highlight">1.5dp</dimen> <dimen name="recents_task_view_highlight">1.5dp</dimen>
<!-- The height of the lock-to-app button. -->
<dimen name="recents_task_view_lock_to_app_button_height">48dp</dimen>
<!-- The amount to offset when animating into an affiliate group. --> <!-- The amount to offset when animating into an affiliate group. -->
<dimen name="recents_task_view_affiliate_group_enter_offset">64dp</dimen> <dimen name="recents_task_view_affiliate_group_enter_offset">64dp</dimen>
@@ -257,6 +254,12 @@
<!-- The min alpha to apply to a task affiliation group color. --> <!-- The min alpha to apply to a task affiliation group color. -->
<item name="recents_task_affiliation_color_min_alpha_percentage" format="float" type="dimen">0.6</item> <item name="recents_task_affiliation_color_min_alpha_percentage" format="float" type="dimen">0.6</item>
<!-- The size of the lock-to-app button. -->
<dimen name="recents_lock_to_app_size">56dp</dimen>
<!-- The size of the lock-to-app button icon. -->
<dimen name="recents_lock_to_app_icon_size">28dp</dimen>
<!-- Space reserved for the cards behind the top card in the top stack --> <!-- Space reserved for the cards behind the top card in the top stack -->
<dimen name="top_stack_peek_amount">12dp</dimen> <dimen name="top_stack_peek_amount">12dp</dimen>

View File

@@ -431,8 +431,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
// Update if we are getting a configuration change // Update if we are getting a configuration change
if (savedInstanceState != null) { if (savedInstanceState != null) {
// Update RecentsConfiguration // Update RecentsConfiguration
mConfig = RecentsConfiguration.reinitialize(this,
RecentsTaskLoader.getInstance().getSystemServicesProxy());
mConfig.updateOnConfigurationChange(); mConfig.updateOnConfigurationChange();
// Trigger the enter animation // Trigger the enter animation
onEnterAnimationTriggered(); onEnterAnimationTriggered();

View File

@@ -86,11 +86,15 @@ public class RecentsConfiguration {
public float taskStackWidthPaddingPct; public float taskStackWidthPaddingPct;
public float taskStackOverscrollPct; public float taskStackOverscrollPct;
/** Transitions */
public int transitionEnterFromAppDelay;
public int transitionEnterFromHomeDelay;
/** Task view animation and styles */ /** Task view animation and styles */
public int taskViewEnterFromHomeDelay; public int taskViewEnterFromAppDuration;
public int taskViewEnterFromHomeDuration; public int taskViewEnterFromHomeDuration;
public int taskViewEnterFromHomeStaggerDelay; public int taskViewEnterFromHomeStaggerDelay;
public int taskViewEnterFromHomeStaggerDuration; public int taskViewExitToAppDuration;
public int taskViewExitToHomeDuration; public int taskViewExitToHomeDuration;
public int taskViewRemoveAnimDuration; public int taskViewRemoveAnimDuration;
public int taskViewRemoveAnimTranslationXPx; public int taskViewRemoveAnimTranslationXPx;
@@ -110,16 +114,8 @@ public class RecentsConfiguration {
/** Task bar size & animations */ /** Task bar size & animations */
public int taskBarHeight; public int taskBarHeight;
public int taskBarEnterAnimDuration;
public int taskBarEnterAnimDelay;
public int taskBarExitAnimDuration;
public int taskBarDismissDozeDelaySeconds; public int taskBarDismissDozeDelaySeconds;
/** Lock to app */
public int taskViewLockToAppButtonHeight;
public int taskViewLockToAppShortAnimDuration;
public int taskViewLockToAppLongAnimDuration;
/** Nav bar scrim */ /** Nav bar scrim */
public int navBarScrimEnterDuration; public int navBarScrimEnterDuration;
@@ -226,15 +222,23 @@ public class RecentsConfiguration {
taskStackMaxDim = res.getInteger(R.integer.recents_max_task_stack_view_dim); taskStackMaxDim = res.getInteger(R.integer.recents_max_task_stack_view_dim);
taskStackTopPaddingPx = res.getDimensionPixelSize(R.dimen.recents_stack_top_padding); taskStackTopPaddingPx = res.getDimensionPixelSize(R.dimen.recents_stack_top_padding);
// Transition
transitionEnterFromAppDelay =
res.getInteger(R.integer.recents_enter_from_app_transition_duration);
transitionEnterFromHomeDelay =
res.getInteger(R.integer.recents_enter_from_home_transition_duration);
// Task view animation and styles // Task view animation and styles
taskViewEnterFromHomeDelay = taskViewEnterFromAppDuration =
res.getInteger(R.integer.recents_animate_task_enter_from_home_delay); res.getInteger(R.integer.recents_task_enter_from_app_duration);
taskViewEnterFromHomeDuration = taskViewEnterFromHomeDuration =
res.getInteger(R.integer.recents_animate_task_enter_from_home_duration); res.getInteger(R.integer.recents_task_enter_from_home_duration);
taskViewEnterFromHomeStaggerDelay = taskViewEnterFromHomeStaggerDelay =
res.getInteger(R.integer.recents_animate_task_enter_from_home_stagger_delay); res.getInteger(R.integer.recents_task_enter_from_home_stagger_delay);
taskViewExitToAppDuration =
res.getInteger(R.integer.recents_task_exit_to_app_duration);
taskViewExitToHomeDuration = taskViewExitToHomeDuration =
res.getInteger(R.integer.recents_animate_task_exit_to_home_duration); res.getInteger(R.integer.recents_task_exit_to_home_duration);
taskViewRemoveAnimDuration = taskViewRemoveAnimDuration =
res.getInteger(R.integer.recents_animate_task_view_remove_duration); res.getInteger(R.integer.recents_animate_task_view_remove_duration);
taskViewRemoveAnimTranslationXPx = taskViewRemoveAnimTranslationXPx =
@@ -265,23 +269,9 @@ public class RecentsConfiguration {
// Task bar size & animations // Task bar size & animations
taskBarHeight = res.getDimensionPixelSize(R.dimen.recents_task_bar_height); taskBarHeight = res.getDimensionPixelSize(R.dimen.recents_task_bar_height);
taskBarEnterAnimDuration =
res.getInteger(R.integer.recents_animate_task_bar_enter_duration);
taskBarEnterAnimDelay =
res.getInteger(R.integer.recents_animate_task_bar_enter_delay);
taskBarExitAnimDuration =
res.getInteger(R.integer.recents_animate_task_bar_exit_duration);
taskBarDismissDozeDelaySeconds = taskBarDismissDozeDelaySeconds =
res.getInteger(R.integer.recents_task_bar_dismiss_delay_seconds); res.getInteger(R.integer.recents_task_bar_dismiss_delay_seconds);
// Lock to app
taskViewLockToAppButtonHeight =
res.getDimensionPixelSize(R.dimen.recents_task_view_lock_to_app_button_height);
taskViewLockToAppShortAnimDuration =
res.getInteger(R.integer.recents_animate_lock_to_app_button_short_duration);
taskViewLockToAppLongAnimDuration =
res.getInteger(R.integer.recents_animate_lock_to_app_button_long_duration);
// Nav bar scrim // Nav bar scrim
navBarScrimEnterDuration = navBarScrimEnterDuration =
res.getInteger(R.integer.recents_nav_bar_scrim_enter_duration); res.getInteger(R.integer.recents_nav_bar_scrim_enter_duration);

View File

@@ -16,7 +16,6 @@
package com.android.systemui.recents.views; package com.android.systemui.recents.views;
import android.animation.ObjectAnimator;
import android.graphics.Outline; import android.graphics.Outline;
import android.graphics.Rect; import android.graphics.Rect;
import android.view.View; import android.view.View;
@@ -35,8 +34,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
float mAlpha = 1f; float mAlpha = 1f;
final float mMinAlpha = 0.25f; final float mMinAlpha = 0.25f;
ObjectAnimator mClipBottomAnimator;
public AnimateableViewBounds(TaskView source, int cornerRadius) { public AnimateableViewBounds(TaskView source, int cornerRadius) {
mConfig = RecentsConfiguration.getInstance(); mConfig = RecentsConfiguration.getInstance();
mSourceView = source; mSourceView = source;

View File

@@ -64,7 +64,9 @@ public class SystemBarScrimViews {
mStatusBarScrimView.setTranslationY(-mStatusBarScrimView.getMeasuredHeight()); mStatusBarScrimView.setTranslationY(-mStatusBarScrimView.getMeasuredHeight());
mStatusBarScrimView.animate() mStatusBarScrimView.animate()
.translationY(0) .translationY(0)
.setStartDelay(mConfig.taskBarEnterAnimDelay) .setStartDelay(mConfig.launchedFromHome ?
mConfig.transitionEnterFromHomeDelay :
mConfig.transitionEnterFromAppDelay)
.setDuration(mConfig.navBarScrimEnterDuration) .setDuration(mConfig.navBarScrimEnterDuration)
.setInterpolator(mConfig.quintOutInterpolator) .setInterpolator(mConfig.quintOutInterpolator)
.withStartAction(new Runnable() { .withStartAction(new Runnable() {
@@ -79,7 +81,9 @@ public class SystemBarScrimViews {
mNavBarScrimView.setTranslationY(mNavBarScrimView.getMeasuredHeight()); mNavBarScrimView.setTranslationY(mNavBarScrimView.getMeasuredHeight());
mNavBarScrimView.animate() mNavBarScrimView.animate()
.translationY(0) .translationY(0)
.setStartDelay(mConfig.taskBarEnterAnimDelay) .setStartDelay(mConfig.launchedFromHome ?
mConfig.transitionEnterFromHomeDelay :
mConfig.transitionEnterFromAppDelay)
.setDuration(mConfig.navBarScrimEnterDuration) .setDuration(mConfig.navBarScrimEnterDuration)
.setInterpolator(mConfig.quintOutInterpolator) .setInterpolator(mConfig.quintOutInterpolator)
.withStartAction(new Runnable() { .withStartAction(new Runnable() {
@@ -101,7 +105,7 @@ public class SystemBarScrimViews {
mStatusBarScrimView.animate() mStatusBarScrimView.animate()
.translationY(-mStatusBarScrimView.getMeasuredHeight()) .translationY(-mStatusBarScrimView.getMeasuredHeight())
.setStartDelay(0) .setStartDelay(0)
.setDuration(mConfig.taskBarExitAnimDuration) .setDuration(mConfig.taskViewExitToAppDuration)
.setInterpolator(mConfig.fastOutSlowInInterpolator) .setInterpolator(mConfig.fastOutSlowInInterpolator)
.start(); .start();
} }
@@ -109,7 +113,7 @@ public class SystemBarScrimViews {
mNavBarScrimView.animate() mNavBarScrimView.animate()
.translationY(mNavBarScrimView.getMeasuredHeight()) .translationY(mNavBarScrimView.getMeasuredHeight())
.setStartDelay(0) .setStartDelay(0)
.setDuration(mConfig.taskBarExitAnimDuration) .setDuration(mConfig.taskViewExitToAppDuration)
.setInterpolator(mConfig.fastOutSlowInInterpolator) .setInterpolator(mConfig.fastOutSlowInInterpolator)
.start(); .start();
} }

View File

@@ -186,6 +186,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
mUIDozeTrigger.stopDozing(); mUIDozeTrigger.stopDozing();
mUIDozeTrigger.resetTrigger(); mUIDozeTrigger.resetTrigger();
} }
mStackScroller.reset();
} }
/** Requests that the views be synchronized with the model */ /** Requests that the views be synchronized with the model */
@@ -659,10 +660,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
// If this is the first layout, then scroll to the front of the stack and synchronize the // If this is the first layout, then scroll to the front of the stack and synchronize the
// stack views immediately to load all the views // stack views immediately to load all the views
if (mAwaitingFirstLayout) { if (mAwaitingFirstLayout) {
mStackScroller.setStackScrollToInitialState(); if (mStackScroller.setStackScrollToInitialState()) {
requestSynchronizeStackViewsWithModel(); requestSynchronizeStackViewsWithModel();
synchronizeStackViewsWithModel(); synchronizeStackViewsWithModel();
} }
}
// Measure each of the TaskViews // Measure each of the TaskViews
int childCount = getChildCount(); int childCount = getChildCount();
@@ -915,7 +917,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
TaskView frontTv = getChildViewForTask(newFrontMostTask); TaskView frontTv = getChildViewForTask(newFrontMostTask);
if (frontTv != null) { if (frontTv != null) {
frontTv.onTaskBound(newFrontMostTask); frontTv.onTaskBound(newFrontMostTask);
frontTv.fadeInActionButton(false); frontTv.fadeInActionButton(0, mConfig.taskViewEnterFromAppDuration);
} }
} }

View File

@@ -48,6 +48,11 @@ public class TaskStackViewScroller {
setStackScroll(getStackScroll()); setStackScroll(getStackScroll());
} }
/** Resets the task scroller. */
void reset() {
mStackScrollP = 0f;
}
/** Sets the callbacks */ /** Sets the callbacks */
void setCallbacks(TaskStackViewScrollerCallbacks cb) { void setCallbacks(TaskStackViewScrollerCallbacks cb) {
mCb = cb; mCb = cb;
@@ -71,9 +76,14 @@ public class TaskStackViewScroller {
mStackScrollP = s; mStackScrollP = s;
} }
/** Sets the current stack scroll to the initial state when you first enter recents */ /**
public void setStackScrollToInitialState() { * Sets the current stack scroll to the initial state when you first enter recents.
* @return whether the stack progress changed.
*/
public boolean setStackScrollToInitialState() {
float prevStackScrollP = mStackScrollP;
setStackScroll(getBoundedStackScroll(mLayoutAlgorithm.mInitialScrollP)); setStackScroll(getBoundedStackScroll(mLayoutAlgorithm.mInitialScrollP));
return Float.compare(prevStackScrollP, mStackScrollP) != 0;
} }
/** Bounds the current scroll if necessary */ /** Bounds the current scroll if necessary */

View File

@@ -24,7 +24,6 @@ import android.graphics.*;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.ViewOutlineProvider; import android.view.ViewOutlineProvider;
import android.view.ViewPropertyAnimator;
import android.view.animation.AccelerateInterpolator; import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.android.systemui.R; import com.android.systemui.R;
@@ -271,24 +270,25 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
if (Constants.DebugFlags.App.EnableThumbnailAlphaOnFrontmost) { if (Constants.DebugFlags.App.EnableThumbnailAlphaOnFrontmost) {
// Animate the thumbnail alpha before the dim animation (to prevent updating the // Animate the thumbnail alpha before the dim animation (to prevent updating the
// hardware layer) // hardware layer)
mThumbnailView.startEnterRecentsAnimation(mConfig.taskBarEnterAnimDelay, mThumbnailView.startEnterRecentsAnimation(mConfig.transitionEnterFromAppDelay,
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
animateDimToProgress(0, mConfig.taskBarEnterAnimDuration, animateDimToProgress(0, mConfig.taskViewEnterFromAppDuration,
ctx.postAnimationTrigger.decrementOnAnimationEnd()); ctx.postAnimationTrigger.decrementOnAnimationEnd());
} }
}); });
} else { } else {
// Immediately start the dim animation // Immediately start the dim animation
animateDimToProgress(mConfig.taskBarEnterAnimDelay, animateDimToProgress(mConfig.transitionEnterFromAppDelay,
mConfig.taskBarEnterAnimDuration, mConfig.taskViewEnterFromAppDuration,
ctx.postAnimationTrigger.decrementOnAnimationEnd()); ctx.postAnimationTrigger.decrementOnAnimationEnd());
} }
ctx.postAnimationTrigger.increment(); ctx.postAnimationTrigger.increment();
// Animate the action button in // Animate the action button in
fadeInActionButton(true); fadeInActionButton(mConfig.transitionEnterFromAppDelay,
mConfig.taskViewEnterFromAppDuration);
} else { } else {
// Animate the task up if it was occluding the launch target // Animate the task up if it was occluding the launch target
if (ctx.currentTaskOccludesLaunchTarget) { if (ctx.currentTaskOccludesLaunchTarget) {
@@ -296,7 +296,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
setAlpha(0f); setAlpha(0f);
animate().alpha(1f) animate().alpha(1f)
.translationY(transform.translationY) .translationY(transform.translationY)
.setStartDelay(mConfig.taskBarEnterAnimDelay) .setStartDelay(mConfig.transitionEnterFromAppDelay)
.setUpdateListener(null) .setUpdateListener(null)
.setInterpolator(mConfig.fastOutSlowInInterpolator) .setInterpolator(mConfig.fastOutSlowInInterpolator)
.setDuration(mConfig.taskViewEnterFromHomeDuration) .setDuration(mConfig.taskViewEnterFromHomeDuration)
@@ -311,12 +311,12 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
ctx.postAnimationTrigger.increment(); ctx.postAnimationTrigger.increment();
} }
} }
startDelay = mConfig.taskBarEnterAnimDelay; startDelay = mConfig.transitionEnterFromAppDelay;
} else if (mConfig.launchedFromHome) { } else if (mConfig.launchedFromHome) {
// Animate the tasks up // Animate the tasks up
int frontIndex = (ctx.currentStackViewCount - ctx.currentStackViewIndex - 1); int frontIndex = (ctx.currentStackViewCount - ctx.currentStackViewIndex - 1);
int delay = mConfig.taskViewEnterFromHomeDelay + int delay = mConfig.transitionEnterFromHomeDelay +
frontIndex * mConfig.taskViewEnterFromHomeStaggerDelay; frontIndex * mConfig.taskViewEnterFromHomeStaggerDelay;
setScaleX(transform.scale); setScaleX(transform.scale);
@@ -353,19 +353,17 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
}, (startDelay / 2)); }, (startDelay / 2));
} }
public void fadeInActionButton(boolean withDelay) { public void fadeInActionButton(int delay, int duration) {
// Hide the action button // Hide the action button
mActionButtonView.setAlpha(0f); mActionButtonView.setAlpha(0f);
// Animate the action button in // Animate the action button in
ViewPropertyAnimator animator = mActionButtonView.animate().alpha(1f) mActionButtonView.animate().alpha(1f)
.setDuration(mConfig.taskBarEnterAnimDuration) .setStartDelay(delay)
.setDuration(duration)
.setInterpolator(PhoneStatusBar.ALPHA_IN) .setInterpolator(PhoneStatusBar.ALPHA_IN)
.withLayer(); .withLayer()
if (withDelay) { .start();
animator.setStartDelay(mConfig.taskBarEnterAnimDelay);
}
animator.start();
} }
/** Animates this task view as it leaves recents by pressing home. */ /** Animates this task view as it leaves recents by pressing home. */
@@ -391,7 +389,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Animate the dim // Animate the dim
if (mDimAlpha > 0) { if (mDimAlpha > 0) {
ObjectAnimator anim = ObjectAnimator.ofInt(this, "dim", 0); ObjectAnimator anim = ObjectAnimator.ofInt(this, "dim", 0);
anim.setDuration(mConfig.taskBarExitAnimDuration); anim.setDuration(mConfig.taskViewExitToAppDuration);
anim.setInterpolator(mConfig.fastOutLinearInInterpolator); anim.setInterpolator(mConfig.fastOutLinearInInterpolator);
anim.start(); anim.start();
} }
@@ -406,7 +404,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mActionButtonView.animate() mActionButtonView.animate()
.alpha(0f) .alpha(0f)
.setStartDelay(0) .setStartDelay(0)
.setDuration(mConfig.taskBarExitAnimDuration) .setDuration(mConfig.taskViewExitToAppDuration)
.setInterpolator(mConfig.fastOutLinearInInterpolator) .setInterpolator(mConfig.fastOutLinearInInterpolator)
.withLayer() .withLayer()
.start(); .start();
@@ -421,7 +419,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
.setStartDelay(0) .setStartDelay(0)
.setUpdateListener(null) .setUpdateListener(null)
.setInterpolator(mConfig.fastOutLinearInInterpolator) .setInterpolator(mConfig.fastOutLinearInInterpolator)
.setDuration(mConfig.taskBarExitAnimDuration) .setDuration(mConfig.taskViewExitToAppDuration)
.start(); .start();
} }
} }

View File

@@ -235,7 +235,7 @@ public class TaskViewHeader extends FrameLayout {
.alpha(0f) .alpha(0f)
.setStartDelay(0) .setStartDelay(0)
.setInterpolator(mConfig.fastOutSlowInInterpolator) .setInterpolator(mConfig.fastOutSlowInInterpolator)
.setDuration(mConfig.taskBarExitAnimDuration) .setDuration(mConfig.taskViewExitToAppDuration)
.withLayer() .withLayer()
.start(); .start();
} }
@@ -249,7 +249,7 @@ public class TaskViewHeader extends FrameLayout {
.alpha(1f) .alpha(1f)
.setStartDelay(0) .setStartDelay(0)
.setInterpolator(mConfig.fastOutLinearInInterpolator) .setInterpolator(mConfig.fastOutLinearInInterpolator)
.setDuration(mConfig.taskBarEnterAnimDuration) .setDuration(mConfig.taskViewEnterFromAppDuration)
.withLayer() .withLayer()
.start(); .start();
} }

View File

@@ -237,12 +237,12 @@ public class TaskViewThumbnail extends View {
/** Animates this task thumbnail as it enters Recents. */ /** Animates this task thumbnail as it enters Recents. */
void startEnterRecentsAnimation(int delay, Runnable postAnimRunnable) { void startEnterRecentsAnimation(int delay, Runnable postAnimRunnable) {
startFadeAnimation(mConfig.taskViewThumbnailAlpha, delay, startFadeAnimation(mConfig.taskViewThumbnailAlpha, delay,
mConfig.taskBarEnterAnimDuration, postAnimRunnable); mConfig.taskViewEnterFromAppDuration, postAnimRunnable);
} }
/** Animates this task thumbnail as it exits Recents. */ /** Animates this task thumbnail as it exits Recents. */
void startLaunchTaskAnimation(Runnable postAnimRunnable) { void startLaunchTaskAnimation(Runnable postAnimRunnable) {
startFadeAnimation(1f, 0, mConfig.taskBarExitAnimDuration, postAnimRunnable); startFadeAnimation(1f, 0, mConfig.taskViewExitToAppDuration, postAnimRunnable);
} }
/** Starts a new thumbnail alpha animation. */ /** Starts a new thumbnail alpha animation. */