summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-08-19 22:29:02 +0200
committerSelim Cinek <cinek@google.com>2014-08-20 14:25:18 +0200
commit255dd04271088590fedc46c8e22b2fd4ab142d39 (patch)
tree9b0087d4e1cee5335f4d55b037b5e3a6ff13a30f /packages/SystemUI/src
parent5e85359a36c14c0c568b73f138f6c8f4baad9b8e (diff)
downloadframeworks_base-255dd04271088590fedc46c8e22b2fd4ab142d39.zip
frameworks_base-255dd04271088590fedc46c8e22b2fd4ab142d39.tar.gz
frameworks_base-255dd04271088590fedc46c8e22b2fd4ab142d39.tar.bz2
Added notification color to all system notifications
Bug: 17128331 Change-Id: I81a94510ef51b99916f314c0dd65852426a1fbeb
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java5
4 files changed, 28 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index d455cec..14f93f7 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -162,7 +162,9 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setPriority(Notification.PRIORITY_MAX)
.setCategory(Notification.CATEGORY_SYSTEM)
.setVisibility(Notification.VISIBILITY_PUBLIC)
- .setFullScreenIntent(pendingBroadcast(ACTION_SHOW_FALLBACK_CHARGER), true);
+ .setFullScreenIntent(pendingBroadcast(ACTION_SHOW_FALLBACK_CHARGER), true)
+ .setColor(mContext.getResources().getColor(
+ com.android.internal.R.color.system_notification_accent_color));
final Notification n = nb.build();
if (n.headsUpContentView != null) {
n.headsUpContentView.setViewVisibility(com.android.internal.R.id.right_icon, View.GONE);
@@ -185,7 +187,9 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setPriority(Notification.PRIORITY_MAX)
.setCategory(Notification.CATEGORY_SYSTEM)
.setVisibility(Notification.VISIBILITY_PUBLIC)
- .setFullScreenIntent(pendingBroadcast(ACTION_SHOW_FALLBACK_WARNING), true);
+ .setFullScreenIntent(pendingBroadcast(ACTION_SHOW_FALLBACK_WARNING), true)
+ .setColor(mContext.getResources().getColor(
+ com.android.internal.R.color.battery_saver_mode_color));
if (hasBatterySettings()) {
nb.setContentIntent(pendingBroadcast(ACTION_SHOW_BATTERY_SETTINGS));
}
@@ -214,7 +218,9 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setOngoing(true)
.setShowWhen(false)
.setCategory(Notification.CATEGORY_SYSTEM)
- .setVisibility(Notification.VISIBILITY_PUBLIC);
+ .setVisibility(Notification.VISIBILITY_PUBLIC)
+ .setColor(mContext.getResources().getColor(
+ com.android.internal.R.color.battery_saver_mode_color));
addStopSaverAction(nb);
if (hasSaverSettings()) {
nb.setContentIntent(pendingActivity(mOpenSaverSettings));
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index d4c8ce3..d9fea47 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -164,7 +164,8 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
.setContentTitle(r.getString(R.string.screenshot_saving_title))
.setContentText(r.getString(R.string.screenshot_saving_text))
.setSmallIcon(R.drawable.stat_notify_image)
- .setWhen(now);
+ .setWhen(now)
+ .setColor(r.getColor(com.android.internal.R.color.system_notification_accent_color));
mNotificationStyle = new Notification.BigPictureStyle()
.bigPicture(preview);
@@ -177,7 +178,9 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
.setContentText(r.getString(R.string.screenshot_saving_text))
.setSmallIcon(R.drawable.stat_notify_image)
.setCategory(Notification.CATEGORY_PROGRESS)
- .setWhen(now);
+ .setWhen(now)
+ .setColor(r.getColor(
+ com.android.internal.R.color.system_notification_accent_color));
mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
@@ -304,7 +307,9 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
.setContentText(r.getString(R.string.screenshot_saved_text))
.setContentIntent(PendingIntent.getActivity(params.context, 0, launchIntent, 0))
.setWhen(now)
- .setAutoCancel(true);
+ .setAutoCancel(true)
+ .setColor(r.getColor(
+ com.android.internal.R.color.system_notification_accent_color));;
// Update the text in the public version as well
mPublicNotificationBuilder
@@ -312,7 +317,9 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
.setContentText(r.getString(R.string.screenshot_saved_text))
.setContentIntent(PendingIntent.getActivity(params.context, 0, launchIntent, 0))
.setWhen(now)
- .setAutoCancel(true);
+ .setAutoCancel(true)
+ .setColor(r.getColor(
+ com.android.internal.R.color.system_notification_accent_color));
mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
@@ -717,7 +724,9 @@ class GlobalScreenshot {
.setWhen(System.currentTimeMillis())
.setVisibility(Notification.VISIBILITY_PUBLIC) // ok to show outside lockscreen
.setCategory(Notification.CATEGORY_ERROR)
- .setAutoCancel(true);
+ .setAutoCancel(true)
+ .setColor(context.getResources().getColor(
+ com.android.internal.R.color.system_notification_accent_color));
Notification n =
new Notification.BigTextStyle(b)
.bigText(r.getString(R.string.screenshot_failed_text))
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
index 152bfdc..32fb567 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
@@ -139,7 +139,7 @@ public class BarTransitions {
mOpaque = res.getColor(R.color.system_bar_background_opaque);
mSemiTransparent = res.getColor(R.color.system_bar_background_semi_transparent);
mTransparent = res.getColor(R.color.system_bar_background_transparent);
- mWarning = res.getColor(R.color.system_bar_background_warning);
+ mWarning = res.getColor(com.android.internal.R.color.battery_saver_mode_color);
}
mGradient = res.getDrawable(gradientResourceId);
mInterpolator = new LinearInterpolator();
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index 481266b..dce5c37 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -309,7 +309,8 @@ public class StorageNotification extends SystemUI {
pi = PendingIntent.getBroadcastAsUser(mContext, 0, intent, 0,
UserHandle.CURRENT);
}
-
+ mUsbStorageNotification.color = mContext.getResources().getColor(
+ com.android.internal.R.color.system_notification_accent_color);
mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi);
mUsbStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
mUsbStorageNotification.category = Notification.CATEGORY_SYSTEM;
@@ -403,6 +404,8 @@ public class StorageNotification extends SystemUI {
}
mMediaStorageNotification.icon = icon;
+ mMediaStorageNotification.color = mContext.getResources().getColor(
+ com.android.internal.R.color.system_notification_accent_color);
mMediaStorageNotification.setLatestEventInfo(mContext, title, message, pi);
mMediaStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
mMediaStorageNotification.category = Notification.CATEGORY_SYSTEM;