summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notification_overlay.9.pngbin935 -> 784 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notification_overlay.9.pngbin469 -> 398 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notification_overlay.9.pngbin1751 -> 876 bytes
-rw-r--r--packages/SystemUI/res/values-large/config.xml2
-rw-r--r--packages/SystemUI/res/values/colors.xml2
-rw-r--r--packages/SystemUI/res/values/config.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java54
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java2
9 files changed, 57 insertions, 12 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notification_overlay.9.png b/packages/SystemUI/res/drawable-hdpi/ic_notification_overlay.9.png
index fd33ef3..cf18e33 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_notification_overlay.9.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notification_overlay.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notification_overlay.9.png b/packages/SystemUI/res/drawable-mdpi/ic_notification_overlay.9.png
index 667b13d..8d0233f 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_notification_overlay.9.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notification_overlay.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notification_overlay.9.png b/packages/SystemUI/res/drawable-xhdpi/ic_notification_overlay.9.png
index 8758b02..71c84ef 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_notification_overlay.9.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notification_overlay.9.png
Binary files differ
diff --git a/packages/SystemUI/res/values-large/config.xml b/packages/SystemUI/res/values-large/config.xml
index 4014f8d..938a17d 100644
--- a/packages/SystemUI/res/values-large/config.xml
+++ b/packages/SystemUI/res/values-large/config.xml
@@ -20,7 +20,5 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources>
- <!-- Whether or not we show the number in the bar. -->
- <bool name="config_statusBarShowNumber">false</bool>
</resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 3a2ea65..99d3c6e 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -17,7 +17,7 @@
*/
-->
<resources>
- <drawable name="notification_number_text_color">#ffffffff</drawable>
+ <drawable name="notification_number_text_color">#ff000000</drawable>
<drawable name="notification_item_background_color">#ff111111</drawable>
<drawable name="notification_item_background_color_pressed">#ff257390</drawable>
<drawable name="ticker_background_color">#ff1d1d1d</drawable>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 1f22507..8792fdf 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -41,9 +41,6 @@
interface. This name is in the ComponentName flattened format (package/class) -->
<string name="config_systemBarComponent" translatable="false">com.android.systemui.statusbar.tablet.TabletStatusBar</string>
- <!-- Whether or not we show the number in the bar. -->
- <bool name="config_statusBarShowNumber">false</bool>
-
<!-- How many icons may be shown at once in the system bar. Includes any
slots that may be reused for things like IME control. -->
<integer name="config_maxNotificationIcons">5</integer>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
index 371af53..7ca1b22 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
@@ -25,6 +25,7 @@ import android.graphics.PixelFormat;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.provider.Settings;
import android.util.Slog;
import android.util.Log;
import android.view.Display;
@@ -59,12 +60,17 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac
private DoNotDisturb mDoNotDisturb;
+ private boolean mShowNotificationCounts;
+
public void start() {
// First set up our views and stuff.
View sb = makeStatusBarView();
mStatusBarContainer.addView(sb);
+ mShowNotificationCounts = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1;
+
// Connect in to the status bar manager service
StatusBarIconList iconList = new StatusBarIconList();
ArrayList<IBinder> notificationKeys = new ArrayList<IBinder>();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 1f57bf7..a8a39cf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -20,10 +20,14 @@ import android.app.Notification;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.database.ContentObserver;
import android.graphics.drawable.Drawable;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
+import android.graphics.Typeface;
+import android.os.Handler;
+import android.provider.Settings;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Slog;
@@ -49,18 +53,28 @@ public class StatusBarIconView extends AnimatedImageView {
private int mNumberY;
private String mNumberText;
private Notification mNotification;
+ private boolean mShowNotificationCount;
public StatusBarIconView(Context context, String slot, Notification notification) {
super(context);
final Resources res = context.getResources();
+ final float densityMultiplier = res.getDisplayMetrics().density;
+ final float scaledPx = 8 * densityMultiplier;
mSlot = slot;
mNumberPain = new Paint();
mNumberPain.setTextAlign(Paint.Align.CENTER);
mNumberPain.setColor(res.getColor(R.drawable.notification_number_text_color));
mNumberPain.setAntiAlias(true);
+ mNumberPain.setTypeface(Typeface.DEFAULT_BOLD);
+ mNumberPain.setTextSize(scaledPx);
mNotification = notification;
+ mShowNotificationCount = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1;
setContentDescription(notification);
+ SettingsObserver observer = new SettingsObserver(new Handler());
+ observer.observe();
+
// We do not resize and scale system icons (on the right), only notification icons (on the
// left).
if (notification != null) {
@@ -101,10 +115,15 @@ public class StatusBarIconView extends AnimatedImageView {
return a.equals(b);
}
+
/**
* Returns whether the set succeeded.
*/
public boolean set(StatusBarIcon icon) {
+ return set(icon, false);
+ }
+
+ private boolean set(StatusBarIcon icon, boolean force) {
final boolean iconEquals = mIcon != null
&& streq(mIcon.iconPackage, icon.iconPackage)
&& mIcon.iconId == icon.iconId;
@@ -116,7 +135,7 @@ public class StatusBarIconView extends AnimatedImageView {
&& mIcon.number == icon.number;
mIcon = icon.clone();
setContentDescription(icon.contentDescription);
- if (!iconEquals) {
+ if (!iconEquals || force) {
Drawable drawable = getIcon(icon);
if (drawable == null) {
Slog.w(StatusBar.TAG, "No icon for slot " + mSlot);
@@ -124,13 +143,12 @@ public class StatusBarIconView extends AnimatedImageView {
}
setImageDrawable(drawable);
}
- if (!levelEquals) {
+ if (!levelEquals || force) {
setImageLevel(icon.iconLevel);
}
- if (!numberEquals) {
- if (icon.number > 0 && mContext.getResources().getBoolean(
- R.bool.config_statusBarShowNumber)) {
+ if (!numberEquals || force) {
+ if (icon.number > 0 && mShowNotificationCount) {
if (mNumberBackground == null) {
mNumberBackground = getContext().getResources().getDrawable(
R.drawable.ic_notification_overlay);
@@ -142,7 +160,7 @@ public class StatusBarIconView extends AnimatedImageView {
}
invalidate();
}
- if (!visibilityEquals) {
+ if (!visibilityEquals || force) {
setVisibility(icon.visible ? VISIBLE : GONE);
}
return true;
@@ -276,4 +294,28 @@ public class StatusBarIconView extends AnimatedImageView {
return "StatusBarIconView(slot=" + mSlot + " icon=" + mIcon
+ " notification=" + mNotification + ")";
}
+
+ class SettingsObserver extends ContentObserver {
+ SettingsObserver(Handler handler) {
+ super(handler);
+ }
+
+ void observe() {
+ mContext.getContentResolver().registerContentObserver(
+ Settings.System.getUriFor(Settings.System.STATUS_BAR_NOTIF_COUNT),
+ false, this);
+ }
+
+ void unobserve() {
+ mContext.getContentResolver().unregisterContentObserver(this);
+ }
+
+ @Override
+ public void onChange(boolean selfChange) {
+ mShowNotificationCount = Settings.System.getInt(
+ mContext.getContentResolver(),
+ Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1;
+ set(mIcon, true);
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 1abbd39..5f7deae 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -236,6 +236,8 @@ public class TabletStatusBar extends StatusBar implements
mDockBatteryController.addIconView((ImageView)mNotificationPanel.findViewById(R.id.dock_battery));
mDockBatteryController.addLabelView(
(TextView)mNotificationPanel.findViewById(R.id.dock_battery_text));
+ } else {
+ mNotificationPanel.findViewById(R.id.dock_battery_text).setVisibility(View.GONE);
}
// Bt
mBluetoothController.addIconView(