Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Launched from app is always the worst case (in terms of how many // thumbnails/tasks visible) launchState.launchedFromApp = true; mBackgroundLayoutAlgorithm.update(plan.getTaskStack(), EMPTY_SET, launchState); mBackgroundLayoutAlgorithm.update(plan.getTaskStack(), EMPTY_SET, launchState, -1 /* lastScrollPPresent */); VisibilityReport visibilityReport = mBackgroundLayoutAlgorithm.computeStackVisibilityReport( stack.getTasks()); Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java +3 −1 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ public class TaskStackLayoutAlgorithm { * in the stack. */ public void update(TaskStack stack, ArraySet<Task.TaskKey> ignoreTasksSet, RecentsActivityLaunchState launchState) { RecentsActivityLaunchState launchState, float lastScrollPPercent) { SystemServicesProxy ssp = Recents.getSystemServices(); // Clear the progress map Loading Loading @@ -506,6 +506,8 @@ public class TaskStackLayoutAlgorithm { if (launchState.launchedWithAltTab) { mInitialScrollP = Utilities.clamp(launchTaskIndex, mMinScrollP, mMaxScrollP); } else if (0 <= lastScrollPPercent && lastScrollPPercent <= 1) { mInitialScrollP = Utilities.mapRange(lastScrollPPercent, mMinScrollP, mMaxScrollP); } else if (Recents.getConfiguration().isLowRamDevice) { mInitialScrollP = mTaskStackLowRamLayoutAlgorithm.getInitialScrollP(mNumStackTasks, scrollToFront); Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +7 −1 Original line number Diff line number Diff line Loading @@ -209,6 +209,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal private int mLastHeight; private boolean mStackActionButtonVisible; // Percentage of last ScrollP from the min to max scrollP that lives after configuration changes private float mLastScrollPPercent; // We keep track of the task view focused by user interaction and draw a frame around it in the // grid layout. private TaskViewFocusFrame mTaskViewFocusFrame; Loading Loading @@ -327,6 +330,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mStackScroller.reset(); mStableLayoutAlgorithm.reset(); mLayoutAlgorithm.reset(); mLastScrollPPercent = -1; } // Since we always animate to the same place in (the initial state), always reset the stack Loading Loading @@ -822,7 +826,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal public void updateLayoutAlgorithm(boolean boundScrollToNewMinMax, RecentsActivityLaunchState launchState) { // Compute the min and max scroll values mLayoutAlgorithm.update(mStack, mIgnoreTasks, launchState); mLayoutAlgorithm.update(mStack, mIgnoreTasks, launchState, mLastScrollPPercent); if (boundScrollToNewMinMax) { mStackScroller.boundScroll(); Loading Loading @@ -1150,6 +1154,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal if (mTaskViewsClipDirty) { clipTaskViews(); } mLastScrollPPercent = Utilities.clamp(Utilities.unmapRange(mStackScroller.getStackScroll(), mLayoutAlgorithm.mMinScrollP, mLayoutAlgorithm.mMaxScrollP), 0, 1); } /** Loading Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Launched from app is always the worst case (in terms of how many // thumbnails/tasks visible) launchState.launchedFromApp = true; mBackgroundLayoutAlgorithm.update(plan.getTaskStack(), EMPTY_SET, launchState); mBackgroundLayoutAlgorithm.update(plan.getTaskStack(), EMPTY_SET, launchState, -1 /* lastScrollPPresent */); VisibilityReport visibilityReport = mBackgroundLayoutAlgorithm.computeStackVisibilityReport( stack.getTasks()); Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java +3 −1 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ public class TaskStackLayoutAlgorithm { * in the stack. */ public void update(TaskStack stack, ArraySet<Task.TaskKey> ignoreTasksSet, RecentsActivityLaunchState launchState) { RecentsActivityLaunchState launchState, float lastScrollPPercent) { SystemServicesProxy ssp = Recents.getSystemServices(); // Clear the progress map Loading Loading @@ -506,6 +506,8 @@ public class TaskStackLayoutAlgorithm { if (launchState.launchedWithAltTab) { mInitialScrollP = Utilities.clamp(launchTaskIndex, mMinScrollP, mMaxScrollP); } else if (0 <= lastScrollPPercent && lastScrollPPercent <= 1) { mInitialScrollP = Utilities.mapRange(lastScrollPPercent, mMinScrollP, mMaxScrollP); } else if (Recents.getConfiguration().isLowRamDevice) { mInitialScrollP = mTaskStackLowRamLayoutAlgorithm.getInitialScrollP(mNumStackTasks, scrollToFront); Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +7 −1 Original line number Diff line number Diff line Loading @@ -209,6 +209,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal private int mLastHeight; private boolean mStackActionButtonVisible; // Percentage of last ScrollP from the min to max scrollP that lives after configuration changes private float mLastScrollPPercent; // We keep track of the task view focused by user interaction and draw a frame around it in the // grid layout. private TaskViewFocusFrame mTaskViewFocusFrame; Loading Loading @@ -327,6 +330,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mStackScroller.reset(); mStableLayoutAlgorithm.reset(); mLayoutAlgorithm.reset(); mLastScrollPPercent = -1; } // Since we always animate to the same place in (the initial state), always reset the stack Loading Loading @@ -822,7 +826,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal public void updateLayoutAlgorithm(boolean boundScrollToNewMinMax, RecentsActivityLaunchState launchState) { // Compute the min and max scroll values mLayoutAlgorithm.update(mStack, mIgnoreTasks, launchState); mLayoutAlgorithm.update(mStack, mIgnoreTasks, launchState, mLastScrollPPercent); if (boundScrollToNewMinMax) { mStackScroller.boundScroll(); Loading Loading @@ -1150,6 +1154,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal if (mTaskViewsClipDirty) { clipTaskViews(); } mLastScrollPPercent = Utilities.clamp(Utilities.unmapRange(mStackScroller.getStackScroll(), mLayoutAlgorithm.mMinScrollP, mLayoutAlgorithm.mMaxScrollP), 0, 1); } /** Loading