diff options
-rw-r--r-- | res/values/colors.xml | 3 | ||||
-rw-r--r-- | res/values/themes.xml | 6 | ||||
-rw-r--r-- | src/com/android/settings/notification/NotificationStation.java | 17 |
3 files changed, 20 insertions, 6 deletions
diff --git a/res/values/colors.xml b/res/values/colors.xml index f3fea10..4774ab9 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -102,4 +102,7 @@ <!-- Accent color that matches the settings launcher icon --> <color name="icon_accent">#ffabffec</color> + <!-- Color used by notification log view --> + <color name="theme_primary_dark">#21272b</color> + </resources> diff --git a/res/values/themes.xml b/res/values/themes.xml index b1bf390..9759468 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -188,11 +188,7 @@ <item name="android:actionBarStyle">@style/Theme.ActionBar</item> </style> - <style name="Theme.NotificationStation" parent="@android:style/Theme.Material"> - <!-- Redefine the ActionBar style for contentInsetStart --> - <item name="android:actionBarStyle">@style/Theme.ActionBar.SubSettings</item> - <item name="@*android:actionBarSize">@dimen/actionbar_size</item> - + <style name="Theme.NotificationStation" parent="Theme.SettingsBase"> <item name="preferenceBackgroundColor">@android:color/transparent</item> </style> diff --git a/src/com/android/settings/notification/NotificationStation.java b/src/com/android/settings/notification/NotificationStation.java index a54e3dd..fa6b171 100644 --- a/src/com/android/settings/notification/NotificationStation.java +++ b/src/com/android/settings/notification/NotificationStation.java @@ -27,6 +27,8 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Resources; import android.graphics.drawable.Drawable; +import android.graphics.ColorFilter; +import android.graphics.LightingColorFilter; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -74,6 +76,7 @@ public class NotificationStation extends SettingsPreferenceFragment { private PackageManager mPm; private INotificationManager mNoMan; + private ColorFilter mFilter; private Runnable mRefreshListRunnable = new Runnable() { @Override @@ -128,6 +131,15 @@ public class NotificationStation extends SettingsPreferenceFragment { } @Override + public void onCreate(Bundle savedInstanceState) { + logd("onCreate(%s)", savedInstanceState); + super.onCreate(savedInstanceState); + + int colorPrimaryDark = getResources().getColor(R.color.theme_primary_dark); + mFilter = new LightingColorFilter(colorPrimaryDark, colorPrimaryDark); + } + + @Override public void onDetach() { try { mListener.unregisterAsSystemService(); @@ -275,13 +287,16 @@ public class NotificationStation extends SettingsPreferenceFragment { private Drawable loadIconDrawable(String pkg, int userId, int resId) { Resources r = getResourcesForUserPackage(pkg, userId); + Drawable d; if (resId == 0) { return null; } try { - return r.getDrawable(resId, null); + d = r.getDrawable(resId, null).mutate(); + d.setColorFilter(mFilter); + return d; } catch (RuntimeException e) { Log.w(TAG, "Icon not found in " + (pkg != null ? resId : "<system>") |