Merge "Minor tweak to initial paging state."
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 902db26..a0052ce 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -175,7 +175,7 @@
     <integer name="recents_animate_task_view_remove_duration">250</integer>
 
     <!-- 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">200</integer>
 
     <!-- The animation duration for entering and exiting the history. -->
     <integer name="recents_history_transition_duration">250</integer>
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
index 43db666..e0bd59b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
@@ -82,7 +82,7 @@
             if (launchedFromHome) {
                 return numTasks - 1;
             } else {
-                if (flags.isFastToggleRecentsEnabled()) {
+                if (flags.isFastToggleRecentsEnabled() || !flags.isInitialStatePaging()) {
                     return numTasks - 1;
                 } else {
                     return numTasks - 2;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
index ebb819c..7d5daae 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
@@ -213,7 +213,7 @@
 
     Context mContext;
     private TaskStackView mStackView;
-    private Interpolator mFastOutSlowInInterpolator;
+    private Interpolator mLinearOutSlowInInterpolator;
     private StackState mState = StackState.SPLIT;
 
     // The task bounds (untransformed) for layout.  This rect is anchored at mTaskRoot.
@@ -295,8 +295,8 @@
         mMaxTranslationZ = res.getDimensionPixelSize(R.dimen.recents_task_view_z_max);
         mContext = context;
         mFreeformLayoutAlgorithm = new FreeformWorkspaceLayoutAlgorithm();
-        mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
-                com.android.internal.R.interpolator.fast_out_slow_in);
+        mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
+                com.android.internal.R.interpolator.linear_out_slow_in);
     }
 
     /**
@@ -486,8 +486,9 @@
         if (Float.compare(newState, getFocusState()) != 0) {
             mFocusStateAnimator = ObjectAnimator.ofFloat(this, FOCUS_STATE, getFocusState(),
                     newState);
-            mFocusStateAnimator.setDuration(200);
-            mFocusStateAnimator.setInterpolator(mFastOutSlowInInterpolator);
+            mFocusStateAnimator.setDuration(mContext.getResources().getInteger(
+                    R.integer.recents_animate_task_stack_scroll_duration));
+            mFocusStateAnimator.setInterpolator(mLinearOutSlowInInterpolator);
             mFocusStateAnimator.start();
         }
     }
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
index 4095d2e..56942a8 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
@@ -49,7 +49,7 @@
     ObjectAnimator mScrollAnimator;
     float mFinalAnimatedScroll;
 
-    Interpolator mLinearOutSlowInInterpolator;
+    private Interpolator mLinearOutSlowInInterpolator;
 
     public TaskStackViewScroller(Context context, TaskStackLayoutAlgorithm layoutAlgorithm) {
         mContext = context;