diff options
author | Dan Sandler <dsandler@android.com> | 2014-05-15 09:36:47 -0400 |
---|---|---|
committer | Dan Sandler <dsandler@android.com> | 2014-05-22 01:36:46 -0400 |
commit | 842dd77bb9c002af5364237f46b63c826f1c4082 (patch) | |
tree | f6834814e795cd439ac16ed163ae020b616d29f3 /packages/SystemUI/src/com/android | |
parent | 7de53d693eb4b70431514481d9da30b80f007939 (diff) | |
download | frameworks_base-842dd77bb9c002af5364237f46b63c826f1c4082.zip frameworks_base-842dd77bb9c002af5364237f46b63c826f1c4082.tar.gz frameworks_base-842dd77bb9c002af5364237f46b63c826f1c4082.tar.bz2 |
Introducing Notification.MediaStyle.
Allows you to create a nice music player with all the
trimmings, including:
* up to 5 actions in the bigContentView, styled as
transport control buttons
* up to 2 of those actions in the 1U (!)
* a nice custom progress bar
* a tinted background (taken from your Notification.color)
* a special place to put your MediaSessionToken
Bug: 15147533
Change-Id: Ic20a2b369eb6c5fe4853987a44ffd9bace720c7f
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 16 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index e699dd9..457d32e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -446,9 +446,25 @@ public abstract class BaseStatusBar extends SystemUI implements com.android.internal.R.drawable.notification_bg, com.android.internal.R.drawable.notification_bg_dim); } + } else { + // Using platform templates + final int color = sbn.getNotification().color; + if (isMediaNotification(entry)) { + entry.row.setBackgroundResourceIds( + com.android.internal.R.drawable.notification_quantum_bg, + color, + com.android.internal.R.drawable.notification_quantum_bg_dim, + color); + } } } + private boolean isMediaNotification(NotificationData.Entry entry) { + // TODO: confirm that there's a valid media key + return entry.expandedBig != null && + entry.expandedBig.findViewById(com.android.internal.R.id.media_action_area) != null; + } + private void startApplicationDetailsActivity(String packageName) { Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", packageName, null)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java index 6b6f55a..b1a5750 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java @@ -36,7 +36,7 @@ public class NotificationData { public View expanded; // the inflated RemoteViews public View expandedPublic; // for insecure lockscreens public ImageView largeIcon; - private View expandedBig; + public View expandedBig; private boolean interruption; public Entry() {} public Entry(IBinder key, StatusBarNotification n, StatusBarIconView ic) { |