diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml
index fcf3ed6..212214e 100644
--- a/res/values/cherish_strings.xml
+++ b/res/values/cherish_strings.xml
@@ -896,6 +896,10 @@
Preset
Accent Color
Override default accent color
+ Accent background
+ Choose a different accent color for background
+ Background Color
+ Override default background accent color
Luminance
Higher values produce brighter colors
Chroma
diff --git a/res/xml/monet_settings.xml b/res/xml/monet_settings.xml
index 5d0c260..d6ca4ff 100644
--- a/res/xml/monet_settings.xml
+++ b/res/xml/monet_settings.xml
@@ -37,6 +37,17 @@
android:title="@string/accent_color_title"
android:summary="@string/accent_color_summary" />
+
+
+
+
1d) luminV = Math.round((lumin - 1f) * 100f);
@@ -179,6 +198,15 @@ public class MonetSettings extends SettingsPreferenceFragment implements
int value = (Integer) newValue;
setColorValue(value);
return true;
+ } else if (preference == mAccentBackgroundPref) {
+ boolean value = (Boolean) newValue;
+ if (!value) setBgColorValue(0);
+ mBgColorPref.setEnabled(value);
+ return true;
+ } else if (preference == mBgColorPref) {
+ int value = (Integer) newValue;
+ setBgColorValue(value);
+ return true;
} else if (preference == mLuminancePref) {
int value = (Integer) newValue;
setLuminanceValue(value);
@@ -208,6 +236,12 @@ public class MonetSettings extends SettingsPreferenceFragment implements
private boolean updateAccentEnablement(String source) {
final boolean shouldEnable = source != null && source.equals(COLOR_SOURCE_PRESET);
mAccentColorPref.setEnabled(shouldEnable);
+ mAccentBackgroundPref.setEnabled(shouldEnable);
+ if (!shouldEnable) {
+ mBgColorPref.setEnabled(false);
+ mAccentBackgroundPref.setEnabled(false);
+ mAccentBackgroundPref.setChecked(false);
+ }
return shouldEnable;
}
@@ -266,6 +300,15 @@ public class MonetSettings extends SettingsPreferenceFragment implements
} catch (JSONException | IllegalArgumentException ignored) {}
}
+ private void setBgColorValue(int color) {
+ try {
+ JSONObject object = getSettingsJson();
+ if (color != 0) object.putOpt(OVERLAY_CATEGORY_BG_COLOR, color);
+ else object.remove(OVERLAY_CATEGORY_BG_COLOR);
+ putSettingsJson(object);
+ } catch (JSONException | IllegalArgumentException ignored) {}
+ }
+
private void setLuminanceValue(int lumin) {
try {
JSONObject object = getSettingsJson();