OSDN Git Service

Minor tweak to initial paging state.
authorWinson <winsonc@google.com>
Fri, 4 Dec 2015 01:21:00 +0000 (17:21 -0800)
committerWinson Chung <winsonc@google.com>
Fri, 4 Dec 2015 01:23:17 +0000 (01:23 +0000)
- Making the scroll and focus animations identical so that it doesn't
  cause a weird flicker.

Change-Id: If1e3d23cd5ef45e429341c6bf7ac62b3a17eb662

packages/SystemUI/res/values/config.xml
packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java

index 902db26..a0052ce 100644 (file)
     <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>
index 43db666..e0bd59b 100644 (file)
@@ -82,7 +82,7 @@ public class RecentsActivityLaunchState {
             if (launchedFromHome) {
                 return numTasks - 1;
             } else {
-                if (flags.isFastToggleRecentsEnabled()) {
+                if (flags.isFastToggleRecentsEnabled() || !flags.isInitialStatePaging()) {
                     return numTasks - 1;
                 } else {
                     return numTasks - 2;
index ebb819c..7d5daae 100644 (file)
@@ -213,7 +213,7 @@ public class TaskStackLayoutAlgorithm {
 
     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 @@ public class TaskStackLayoutAlgorithm {
         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 @@ public class TaskStackLayoutAlgorithm {
         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();
         }
     }
index 4095d2e..56942a8 100644 (file)
@@ -49,7 +49,7 @@ public class TaskStackViewScroller {
     ObjectAnimator mScrollAnimator;
     float mFinalAnimatedScroll;
 
-    Interpolator mLinearOutSlowInInterpolator;
+    private Interpolator mLinearOutSlowInInterpolator;
 
     public TaskStackViewScroller(Context context, TaskStackLayoutAlgorithm layoutAlgorithm) {
         mContext = context;