Skip scroll-to animation when undocking and there are no tasks.

Bug: 28367678
Change-Id: Iafd064196cae43f60ff6d356843d1e431d15daea
This commit is contained in:
Winson
2016-04-26 14:46:58 -07:00
parent 9832f8f463
commit 95ee8736da
3 changed files with 9 additions and 3 deletions

View File

@@ -451,11 +451,13 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
TaskStack stack = loadPlan.getTaskStack();
int numStackTasks = stack.getStackTaskCount();
boolean showDeferredAnimation = numStackTasks > 0;
EventBus.getDefault().send(new ConfigurationChangedEvent(true /* fromMultiWindow */,
false /* fromDeviceOrientationChange */, false /* fromDisplayDensityChange */,
numStackTasks > 0));
EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode, stack));
EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode,
showDeferredAnimation, stack));
}
@Override

View File

@@ -25,10 +25,14 @@ import com.android.systemui.recents.model.TaskStack;
public class MultiWindowStateChangedEvent extends EventBus.AnimatedEvent {
public final boolean inMultiWindow;
// This flag is only used when undocking a task
public final boolean showDeferredAnimation;
public final TaskStack stack;
public MultiWindowStateChangedEvent(boolean inMultiWindow, TaskStack stack) {
public MultiWindowStateChangedEvent(boolean inMultiWindow, boolean showDeferredAnimation,
TaskStack stack) {
this.inMultiWindow = inMultiWindow;
this.showDeferredAnimation = showDeferredAnimation;
this.stack = stack;
}
}

View File

@@ -1938,7 +1938,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
public final void onBusEvent(final MultiWindowStateChangedEvent event) {
if (event.inMultiWindow) {
if (event.inMultiWindow || !event.showDeferredAnimation) {
setTasks(event.stack, true /* allowNotifyStackChanges */);
} else {
// Reset the launch state before handling the multiwindow change