diff options
author | Winson Chung <winsonc@google.com> | 2014-11-06 11:05:19 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2014-11-06 14:02:35 -0800 |
commit | 044d52934e57a337665f707aa4be1d423ee3fb29 (patch) | |
tree | 423b99ef3ef8e787818ef0f1c978bd4713f3f4e7 /packages/SystemUI/src/com/android/systemui/recents | |
parent | 7efdb83ceeea3dc916f8a05f59f7b35cb8d13597 (diff) | |
download | frameworks_base-044d52934e57a337665f707aa4be1d423ee3fb29.zip frameworks_base-044d52934e57a337665f707aa4be1d423ee3fb29.tar.gz frameworks_base-044d52934e57a337665f707aa4be1d423ee3fb29.tar.bz2 |
Adding bounce animation for affiliated tasks. (Bug 16656169)
Change-Id: I39e4a57c4e6b707d15513dacde2d40c23bb05058
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/recents')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java | 19 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java | 14 |
2 files changed, 26 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java index 76e8181..4f4c06f 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java @@ -16,13 +16,11 @@ package com.android.systemui.recents; -import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityOptions; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetProviderInfo; import android.content.ActivityNotFoundException; -import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -31,7 +29,6 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Rect; -import android.os.Handler; import android.os.UserHandle; import android.util.Pair; import android.view.LayoutInflater; @@ -199,6 +196,7 @@ public class AlternateRecentsComponent { Task toTask = null; ActivityOptions launchOpts = null; int taskCount = tasks.size(); + int numAffiliatedTasks = 0; for (int i = 0; i < taskCount; i++) { Task task = tasks.get(i); if (task.key.id == runningTask.id) { @@ -218,16 +216,23 @@ public class AlternateRecentsComponent { if (toTaskKey != null) { toTask = stack.findTaskWithId(toTaskKey.id); } + numAffiliatedTasks = group.getTaskCount(); break; } } // Return early if there is no next task if (toTask == null) { - if (showNextTask) { - // XXX: Show the next-task bounce animation - } else { - // XXX: Show the prev-task bounce animation + if (numAffiliatedTasks > 1) { + if (showNextTask) { + mSystemServicesProxy.startInPlaceAnimationOnFrontMostApplication( + ActivityOptions.makeCustomInPlaceAnimation(mContext, + R.anim.recents_launch_next_affiliated_task_bounce)); + } else { + mSystemServicesProxy.startInPlaceAnimationOnFrontMostApplication( + ActivityOptions.makeCustomInPlaceAnimation(mContext, + R.anim.recents_launch_prev_affiliated_task_bounce)); + } } return; } 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 b661385..646d701 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -48,12 +48,14 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.os.RemoteException; +import android.os.ServiceManager; import android.os.UserHandle; import android.provider.Settings; import android.util.Log; import android.util.Pair; import android.view.Display; import android.view.DisplayInfo; +import android.view.IWindowManager; import android.view.SurfaceControl; import android.view.WindowManager; import android.view.accessibility.AccessibilityManager; @@ -429,6 +431,7 @@ public class SystemServicesProxy { opts.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX); if (!mAwm.bindAppWidgetIdIfAllowed(searchWidgetId, searchWidgetInfo.provider, opts)) { + host.deleteAppWidgetId(searchWidgetId); return null; } return new Pair<Integer, AppWidgetProviderInfo>(searchWidgetId, searchWidgetInfo); @@ -532,4 +535,15 @@ public class SystemServicesProxy { } return false; } + + /** Starts an in-place animation on the front most application windows. */ + public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions opts) { + if (mIam == null) return; + + try { + mIam.startInPlaceAnimationOnFrontMostApplication(opts); + } catch (Exception e) { + e.printStackTrace(); + } + } } |