From f298e908b97a5a56ccb52d9f015e5408fe523af9 Mon Sep 17 00:00:00 2001 From: Filip Gruszczynski Date: Mon, 18 Jan 2016 08:59:45 -0800 Subject: [PATCH] Enable enter animation when docking by dragging from recents. This requires further work on the sysui side (the view disappears before the animation starts), but it shows that existing infrastructure on the WMS side is sufficient. Bug: 24913915 Change-Id: I7ce20fdd21ee76db4720a3d0fefdfa221b0e96bf --- .../android/systemui/recents/misc/SystemServicesProxy.java | 6 ++++-- .../src/com/android/systemui/recents/views/RecentsView.java | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java index 01de60c5724e4..adc1e9200daa4 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -59,6 +59,7 @@ import android.util.MutableBoolean; import android.util.Pair; import android.view.Display; import android.view.IDockedStackListener; +import android.view.View; import android.view.WindowManager; import android.view.WindowManager.KeyboardShortcutsReceiver; import android.view.WindowManagerGlobal; @@ -307,12 +308,13 @@ public class SystemServicesProxy { } /** Docks a task to the side of the screen and starts it. */ - public void startTaskInDockedMode(Context context, int taskId, int createMode) { + public void startTaskInDockedMode(Context context, View view, int taskId, int createMode) { if (mIam == null) return; try { // TODO: Determine what animation we want for the incoming task - final ActivityOptions options = ActivityOptions.makeCustomAnimation(context, 0, 0); + final ActivityOptions options = ActivityOptions.makeThumbnailAspectScaleUpAnimation( + view, null, 0, 0, view.getWidth(), view.getHeight(), null, null); options.setDockCreateMode(createMode); options.setLaunchStackId(DOCKED_STACK_ID); mIam.startActivityFromRecents(taskId, options.toBundle()); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 0d9a1c4bef1e1..c77a2f9ccb2d1 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -526,9 +526,8 @@ public class RecentsView extends FrameLayout { public void onAnimationEnd(Animator animation) { // Dock the task and launch it SystemServicesProxy ssp = Recents.getSystemServices(); - ssp.startTaskInDockedMode(getContext(), event.task.key.id, - dockState.createMode); - launchTask(event.task, null, INVALID_STACK_ID); + ssp.startTaskInDockedMode(getContext(), event.taskView, + event.task.key.id, dockState.createMode); mTaskStackView.getStack().removeTask(event.task); }