summaryrefslogtreecommitdiffstats
path: root/quickstep
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2018-09-25 18:18:18 -0700
committerWinson Chung <winsonc@google.com>2018-09-25 18:18:18 -0700
commitc533f315cad1232c1141b0a2678bd8736eef9fba (patch)
treea2abba1e12bebe1947e9be6ace4f1267d548cfc1 /quickstep
parentd65f5f7f1a692b03bee09a15f4e0c865ed97fa61 (diff)
downloadandroid_packages_apps_Trebuchet-c533f315cad1232c1141b0a2678bd8736eef9fba.tar.gz
android_packages_apps_Trebuchet-c533f315cad1232c1141b0a2678bd8736eef9fba.tar.bz2
android_packages_apps_Trebuchet-c533f315cad1232c1141b0a2678bd8736eef9fba.zip
Defer removing the task view until the app has drawn
Bug: 111896388 Change-Id: I8c900e56fcbbdc400dce646c50f8f14b1da4e17f
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/libs/sysui_shared.jarbin141469 -> 142780 bytes
-rw-r--r--quickstep/src/com/android/quickstep/views/TaskView.java22
2 files changed, 19 insertions, 3 deletions
diff --git a/quickstep/libs/sysui_shared.jar b/quickstep/libs/sysui_shared.jar
index 17ff858c4..7ff664d41 100644
--- a/quickstep/libs/sysui_shared.jar
+++ b/quickstep/libs/sysui_shared.jar
Binary files differ
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index ee542d57e..a0615f502 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -57,6 +57,7 @@ import com.android.systemui.shared.recents.model.Task.TaskCallbacks;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.ActivityOptionsCompat;
import java.util.function.Consumer;
/**
@@ -204,11 +205,26 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
if (animate) {
opts = ((BaseDraggingActivity) fromContext(getContext()))
.getActivityLaunchOptions(this);
+ ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(mTask.key,
+ opts, resultCallback, resultCallbackHandler);
} else {
- opts = ActivityOptions.makeCustomAnimation(getContext(), 0, 0);
+ opts = ActivityOptionsCompat.makeCustomAnimation(getContext(), 0, 0, () -> {
+ if (resultCallback != null) {
+ // Only post the animation start after the system has indicated that the
+ // transition has started
+ resultCallbackHandler.post(() -> resultCallback.accept(true));
+ }
+ }, resultCallbackHandler);
+ ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(mTask.key,
+ opts, (success) -> {
+ if (resultCallback != null && !success) {
+ // If the call to start activity failed, then post the result
+ // immediately, otherwise, wait for the animation start callback
+ // from the activity options above
+ resultCallbackHandler.post(() -> resultCallback.accept(false));
+ }
+ }, resultCallbackHandler);
}
- ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(mTask.key,
- opts, resultCallback, resultCallbackHandler);
}
}