diff options
author | Sam Mortimer <sam@mortimer.me.uk> | 2014-11-24 21:51:27 -0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-12-22 12:45:07 -0800 |
commit | 716714a085abd8688facec0e7a561bb8722ab55b (patch) | |
tree | cc35df41a2d016fca0a988653ad228c2e8295eac | |
parent | 3e2025a54fe23a7a0b541e2ca29b7e38f9ad4610 (diff) | |
download | packages_apps_Settings-716714a085abd8688facec0e7a561bb8722ab55b.zip packages_apps_Settings-716714a085abd8688facec0e7a561bb8722ab55b.tar.gz packages_apps_Settings-716714a085abd8688facec0e7a561bb8722ab55b.tar.bz2 |
Light settings: reduce tone if preview image color is very light
Prevents material whiteout in color preview.
Change-Id: Idfa47e57bdb669b17b610b737d0fe2c942b47d78
-rw-r--r-- | src/com/android/settings/notificationlight/ApplicationLightPreference.java | 8 | ||||
-rw-r--r-- | src/com/android/settings/notificationlight/NotificationLightSettings.java | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/settings/notificationlight/ApplicationLightPreference.java b/src/com/android/settings/notificationlight/ApplicationLightPreference.java index c6b534e..9feb050 100644 --- a/src/com/android/settings/notificationlight/ApplicationLightPreference.java +++ b/src/com/android/settings/notificationlight/ApplicationLightPreference.java @@ -36,7 +36,7 @@ public class ApplicationLightPreference extends DialogPreference { private static String TAG = "AppLightPreference"; public static final int DEFAULT_TIME = 1000; - public static final int DEFAULT_COLOR = 0xeeeeee; //off-White since white does not show in UI + public static final int DEFAULT_COLOR = 0xffffff; private ImageView mLightColorView; private TextView mOnValueView; @@ -138,7 +138,11 @@ public class ApplicationLightPreference extends DialogPreference { if (mLightColorView != null) { mLightColorView.setEnabled(true); - mLightColorView.setImageDrawable(createOvalShape(size, 0xFF000000 + mColorValue)); + // adjust if necessary to prevent material whiteout + final int imageColor = ((mColorValue & 0xF0F0F0) == 0xF0F0F0) ? + (mColorValue - 0x101010) : mColorValue; + mLightColorView.setImageDrawable(createOvalShape(size, + 0xFF000000 + imageColor)); } if (mOnValueView != null) { mOnValueView.setText(mapLengthValue(mOnValue)); diff --git a/src/com/android/settings/notificationlight/NotificationLightSettings.java b/src/com/android/settings/notificationlight/NotificationLightSettings.java index d70977f..597ea3a 100644 --- a/src/com/android/settings/notificationlight/NotificationLightSettings.java +++ b/src/com/android/settings/notificationlight/NotificationLightSettings.java @@ -96,11 +96,8 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem PreferenceGroup mAdvancedPrefs = (PreferenceGroup) prefSet.findPreference("advanced_section"); // Get the system defined default notification color - mDefaultColor = resources.getColor(com.android.internal.R.color.config_defaultNotificationColor); - if (mDefaultColor == Color.WHITE) { - // We cannot properly show white in the UI, change it to off white (#eeeeee) - mDefaultColor = 0xFFEEEEEE; - } + mDefaultColor = + resources.getColor(com.android.internal.R.color.config_defaultNotificationColor); mDefaultLedOn = resources.getInteger( com.android.internal.R.integer.config_defaultNotificationLedOn); |