mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 05:15:13 +02:00
Added option to use highlight color for unread shadow
This commit is contained in:
@@ -63,6 +63,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private SwitchCompat swBeige;
|
||||
private SwitchCompat swTabularBackground;
|
||||
private SwitchCompat swShadow;
|
||||
private SwitchCompat swShadowHighlight;
|
||||
private SwitchCompat swDate;
|
||||
private SwitchCompat swDateFixed;
|
||||
private SwitchCompat swDateBold;
|
||||
@@ -159,7 +160,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private NumberFormat NF = NumberFormat.getNumberInstance();
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"theme", "startup", "cards", "beige", "tabular_card_bg", "shadow_unread",
|
||||
"theme", "startup", "cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_highlight",
|
||||
"date", "date_fixed", "date_bold",
|
||||
"portrait2", "portrait2c", "landscape", "nav_options", "nav_count", "nav_unseen_drafts", "navbar_colorize",
|
||||
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_color",
|
||||
@@ -194,6 +195,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swBeige = view.findViewById(R.id.swBeige);
|
||||
swTabularBackground = view.findViewById(R.id.swTabularCardBackground);
|
||||
swShadow = view.findViewById(R.id.swShadow);
|
||||
swShadowHighlight = view.findViewById(R.id.swShadowHighlight);
|
||||
swDate = view.findViewById(R.id.swDate);
|
||||
swDateFixed = view.findViewById(R.id.swDateFixed);
|
||||
swDateBold = view.findViewById(R.id.swDateBold);
|
||||
@@ -321,6 +323,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swBeige.setEnabled(checked);
|
||||
swTabularBackground.setEnabled(!checked);
|
||||
swShadow.setEnabled(checked);
|
||||
swShadowHighlight.setEnabled(swShadow.isEnabled() && checked);
|
||||
swIndentation.setEnabled(checked);
|
||||
}
|
||||
});
|
||||
@@ -344,6 +347,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("shadow_unread", checked).apply();
|
||||
swShadowHighlight.setEnabled(swShadow.isEnabled() && checked);
|
||||
}
|
||||
});
|
||||
|
||||
swShadowHighlight.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("shadow_highlight", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1071,9 +1082,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swBeige.setChecked(prefs.getBoolean("beige", true));
|
||||
swTabularBackground.setChecked(prefs.getBoolean("tabular_card_bg", false));
|
||||
swShadow.setChecked(prefs.getBoolean("shadow_unread", false));
|
||||
swShadowHighlight.setChecked(prefs.getBoolean("shadow_highlight", false));
|
||||
swBeige.setEnabled(swCards.isChecked());
|
||||
swTabularBackground.setEnabled(!swCards.isChecked());
|
||||
swShadow.setEnabled(swCards.isChecked());
|
||||
swShadowHighlight.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
|
||||
swDate.setChecked(prefs.getBoolean("date", true));
|
||||
swDateFixed.setChecked(prefs.getBoolean("date_fixed", false));
|
||||
swDateFixed.setEnabled(!swDate.isChecked());
|
||||
|
||||
Reference in New Issue
Block a user