From 3aa9c221c0d092b927628be6a7ba371028cebe79 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 9 Sep 2014 17:54:51 +0200 Subject: [PATCH] Adding task switching animation xmls for further tweaking. (Bug 16656169) Change-Id: I472116cb3d86a3f90a935b2a3ac058ffc2ac1b5d --- ...nts_launch_next_affiliated_task_bounce.xml | 59 +++++++++++++++++++ ...nts_launch_next_affiliated_task_source.xml | 34 +++++++++++ ...nts_launch_next_affiliated_task_target.xml | 28 +++++++++ ...nts_launch_prev_affiliated_task_bounce.xml | 33 +++++++++++ ...nts_launch_prev_affiliated_task_source.xml | 27 +++++++++ ...nts_launch_prev_affiliated_task_target.xml | 36 +++++++++++ .../recents/AlternateRecentsComponent.java | 14 ++++- 7 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 packages/SystemUI/res/anim/recents_launch_next_affiliated_task_bounce.xml create mode 100644 packages/SystemUI/res/anim/recents_launch_next_affiliated_task_source.xml create mode 100644 packages/SystemUI/res/anim/recents_launch_next_affiliated_task_target.xml create mode 100644 packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_bounce.xml create mode 100644 packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_source.xml create mode 100644 packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_target.xml diff --git a/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_bounce.xml b/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_bounce.xml new file mode 100644 index 0000000000000..a571cbc8c1f3a --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_bounce.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_source.xml b/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_source.xml new file mode 100644 index 0000000000000..f0fd68458801d --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_source.xml @@ -0,0 +1,34 @@ + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_target.xml b/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_target.xml new file mode 100644 index 0000000000000..170ac829c3c29 --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_next_affiliated_task_target.xml @@ -0,0 +1,28 @@ + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_bounce.xml b/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_bounce.xml new file mode 100644 index 0000000000000..46045acd9ac43 --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_bounce.xml @@ -0,0 +1,33 @@ + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_source.xml b/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_source.xml new file mode 100644 index 0000000000000..ad5341bf8ff3a --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_source.xml @@ -0,0 +1,27 @@ + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_target.xml b/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_target.xml new file mode 100644 index 0000000000000..7687f0286f25f --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_prev_affiliated_task_target.xml @@ -0,0 +1,36 @@ + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java index f23f9f2bf5c62..f65621e8b896c 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java @@ -190,10 +190,14 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta Task.TaskKey toTaskKey; if (showNextTask) { toTaskKey = group.getNextTaskInGroup(task); - // XXX: We will actually set the appropriate launch animations here + launchOpts = ActivityOptions.makeCustomAnimation(mContext, + R.anim.recents_launch_next_affiliated_task_target, + R.anim.recents_launch_next_affiliated_task_source); } else { toTaskKey = group.getPrevTaskInGroup(task); - // XXX: We will actually set the appropriate launch animations here + launchOpts = ActivityOptions.makeCustomAnimation(mContext, + R.anim.recents_launch_prev_affiliated_task_target, + R.anim.recents_launch_prev_affiliated_task_source); } if (toTaskKey != null) { toTask = stack.findTaskWithId(toTaskKey.id); @@ -204,7 +208,11 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta // Return early if there is no next task if (toTask == null) { - // XXX: We will actually show a bounce animation here + if (showNextTask) { + // XXX: Show the next-task bounce animation + } else { + // XXX: Show the prev-task bounce animation + } return; }