mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 11:55:20 +01:00
Added option to show background colors
This commit is contained in:
@@ -127,6 +127,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private SwitchCompat swContrast;
|
||||
private SwitchCompat swMonospaced;
|
||||
private SwitchCompat swMonospacedPre;
|
||||
private SwitchCompat swBackgroundColor;
|
||||
private SwitchCompat swTextColor;
|
||||
private SwitchCompat swTextSize;
|
||||
private SwitchCompat swTextFont;
|
||||
@@ -158,7 +159,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
"preview", "preview_italic", "preview_lines",
|
||||
"addresses",
|
||||
"message_zoom", "overview_mode", "contrast", "monospaced", "monospaced_pre",
|
||||
"text_color", "text_size", "text_font", "text_align", "text_separators",
|
||||
"background_color", "text_color", "text_size", "text_font", "text_align", "text_separators",
|
||||
"collapse_quotes", "image_placeholders", "inline_images", "button_extra", "attachments_alt", "thumbnails",
|
||||
"parse_classes", "authentication"
|
||||
};
|
||||
@@ -238,6 +239,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swContrast = view.findViewById(R.id.swContrast);
|
||||
swMonospaced = view.findViewById(R.id.swMonospaced);
|
||||
swMonospacedPre = view.findViewById(R.id.swMonospacedPre);
|
||||
swBackgroundColor = view.findViewById(R.id.swBackgroundColor);
|
||||
swTextColor = view.findViewById(R.id.swTextColor);
|
||||
swTextSize = view.findViewById(R.id.swTextSize);
|
||||
swTextFont = view.findViewById(R.id.swTextFont);
|
||||
@@ -799,6 +801,18 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
}
|
||||
});
|
||||
|
||||
String theme = prefs.getString("theme", "blue_orange_system");
|
||||
boolean bw = "black_and_white".equals(theme);
|
||||
|
||||
swBackgroundColor.setEnabled(!bw);
|
||||
swBackgroundColor.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("background_color", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swTextColor.setEnabled(!bw);
|
||||
swTextColor.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -806,9 +820,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
}
|
||||
});
|
||||
|
||||
String theme = prefs.getString("theme", "blue_orange_system");
|
||||
swTextColor.setEnabled(!"black_and_white".equals(theme));
|
||||
|
||||
swTextSize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -1061,6 +1072,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swContrast.setChecked(prefs.getBoolean("contrast", false));
|
||||
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
|
||||
swMonospacedPre.setChecked(prefs.getBoolean("monospaced_pre", false));
|
||||
swBackgroundColor.setChecked(prefs.getBoolean("background_color", false));
|
||||
swTextColor.setChecked(prefs.getBoolean("text_color", true));
|
||||
swTextSize.setChecked(prefs.getBoolean("text_size", true));
|
||||
swTextFont.setChecked(prefs.getBoolean("text_font", true));
|
||||
|
||||
Reference in New Issue
Block a user