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;
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));
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);