Merge "Fixing crash in Recents" into nyc-dev
This commit is contained in:
@@ -645,7 +645,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
if (stack != null) {
|
||||
stackLayout.initialize(taskStackBounds,
|
||||
TaskStackLayoutAlgorithm.StackState.getStackStateForStack(stack));
|
||||
mDummyStackView.setTasks(stack, false /* notifyStackChanges */);
|
||||
mDummyStackView.setTasks(stack, false /* notifyStackChanges */,
|
||||
false /* relayoutTaskStack */);
|
||||
}
|
||||
Rect taskViewBounds = stackLayout.getUntransformedTaskViewBounds();
|
||||
if (!taskViewBounds.equals(mLastTaskViewBounds)) {
|
||||
|
||||
@@ -184,7 +184,8 @@ public class RecentsView extends FrameLayout {
|
||||
|
||||
// Update the stack
|
||||
mTaskStackView.onResume(isResumingFromVisible);
|
||||
mTaskStackView.setTasks(stack, isResumingFromVisible /* notifyStackChanges */);
|
||||
mTaskStackView.setTasks(stack, isResumingFromVisible /* notifyStackChanges */,
|
||||
true /* relayoutTaskStack */);
|
||||
|
||||
if (isResumingFromVisible) {
|
||||
// If we are already visible, then restore the background scrim
|
||||
|
||||
@@ -298,7 +298,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
/**
|
||||
* Sets the stack tasks of this TaskStackView from the given TaskStack.
|
||||
*/
|
||||
public void setTasks(TaskStack stack, boolean notifyStackChanges) {
|
||||
public void setTasks(TaskStack stack, boolean notifyStackChanges, boolean relayoutTaskStack) {
|
||||
boolean isInitialized = mLayoutAlgorithm.isInitialized();
|
||||
mStack.setTasks(getContext(), stack.computeAllTasksList(),
|
||||
notifyStackChanges && isInitialized);
|
||||
@@ -307,15 +307,18 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
// measure/layout pass
|
||||
updateLayoutAlgorithm(false /* boundScroll */, EMPTY_TASK_SET);
|
||||
updateToInitialState();
|
||||
relayoutTaskViews(AnimationProps.IMMEDIATE);
|
||||
|
||||
// Rebind all the task views. This will not trigger new resources to be loaded unless
|
||||
// they have actually changed
|
||||
List<TaskView> taskViews = getTaskViews();
|
||||
int taskViewCount = taskViews.size();
|
||||
for (int i = 0; i < taskViewCount; i++) {
|
||||
TaskView tv = taskViews.get(i);
|
||||
bindTaskView(tv, tv.getTask());
|
||||
if (relayoutTaskStack) {
|
||||
relayoutTaskViews(AnimationProps.IMMEDIATE);
|
||||
|
||||
// Rebind all the task views. This will not trigger new resources to be loaded
|
||||
// unless they have actually changed
|
||||
List<TaskView> taskViews = getTaskViews();
|
||||
int taskViewCount = taskViews.size();
|
||||
for (int i = 0; i < taskViewCount; i++) {
|
||||
TaskView tv = taskViews.get(i);
|
||||
bindTaskView(tv, tv.getTask());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user