mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-13 20:43:26 +02:00
Added unread shadow option
This commit is contained in:
@@ -235,7 +235,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
|
||||
private boolean date;
|
||||
private boolean cards;
|
||||
private boolean shadow;
|
||||
private boolean shadow_unread;
|
||||
private boolean threading;
|
||||
private boolean threading_unread;
|
||||
private boolean indentation;
|
||||
@@ -511,7 +511,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
ViewHolder(final View itemView, long viewType) {
|
||||
super(itemView);
|
||||
|
||||
if (cards && shadow) {
|
||||
if (cards && shadow_unread) {
|
||||
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams();
|
||||
lparam.bottomMargin = dp1;
|
||||
itemView.setLayoutParams(lparam);
|
||||
@@ -1400,7 +1400,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
}
|
||||
|
||||
private void bindSeen(TupleMessageEx message) {
|
||||
if (cards && shadow) {
|
||||
if (cards && shadow_unread) {
|
||||
int color = (message.unseen > 0 ? colorSeparator : Color.TRANSPARENT);
|
||||
if (!Objects.equals(itemView.getTag(), color)) {
|
||||
itemView.setTag(color);
|
||||
@@ -5348,7 +5348,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
|
||||
this.date = prefs.getBoolean("date", true);
|
||||
this.cards = prefs.getBoolean("cards", true);
|
||||
this.shadow = prefs.getBoolean("experiments", false);
|
||||
this.shadow_unread = prefs.getBoolean("shadow_unread", false);
|
||||
this.threading = prefs.getBoolean("threading", true);
|
||||
this.threading_unread = threading && prefs.getBoolean("threading_unread", false);
|
||||
this.indentation = prefs.getBoolean("indentation", false);
|
||||
|
||||
@@ -80,7 +80,8 @@ public class FragmentOptions extends FragmentBase {
|
||||
static String[] OPTIONS_RESTART = new String[]{
|
||||
"first", "app_support", "notify_archive", "message_swipe", "message_select", "folder_actions", "folder_sync",
|
||||
"subscriptions",
|
||||
"portrait2", "landscape", "landscape3", "startup", "cards", "beige", "indentation", "date", "threading", "threading_unread",
|
||||
"portrait2", "landscape", "landscape3", "startup", "cards", "beige", "shadow_unread",
|
||||
"indentation", "date", "threading", "threading_unread",
|
||||
"highlight_unread", "highlight_color", "color_stripe",
|
||||
"avatars", "gravatars", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
|
||||
"name_email", "prefer_contact", "distinguish_contacts", "show_recipients", "authentication",
|
||||
|
||||
@@ -64,6 +64,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private Spinner spStartup;
|
||||
private SwitchCompat swCards;
|
||||
private SwitchCompat swBeige;
|
||||
private SwitchCompat swShadow;
|
||||
private SwitchCompat swDate;
|
||||
private SwitchCompat swNavBarColorize;
|
||||
private SwitchCompat swPortrait2;
|
||||
@@ -139,7 +140,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private NumberFormat NF = NumberFormat.getNumberInstance();
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"theme", "startup", "cards", "beige", "date", "navbar_colorize", "portrait2", "landscape", "landscape3",
|
||||
"theme", "startup", "cards", "beige", "shadow_unread",
|
||||
"date", "navbar_colorize", "portrait2", "landscape", "landscape3",
|
||||
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_color",
|
||||
"highlight_unread", "highlight_color", "color_stripe",
|
||||
"avatars", "gravatars", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
|
||||
@@ -168,6 +170,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
spStartup = view.findViewById(R.id.spStartup);
|
||||
swCards = view.findViewById(R.id.swCards);
|
||||
swBeige = view.findViewById(R.id.swBeige);
|
||||
swShadow = view.findViewById(R.id.swShadow);
|
||||
swDate = view.findViewById(R.id.swDate);
|
||||
swNavBarColorize = view.findViewById(R.id.swNavBarColorize);
|
||||
swPortrait2 = view.findViewById(R.id.swPortrait2);
|
||||
@@ -268,6 +271,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("cards", checked).apply();
|
||||
swBeige.setEnabled(checked);
|
||||
swShadow.setEnabled(checked);
|
||||
swIndentation.setEnabled(checked);
|
||||
}
|
||||
});
|
||||
@@ -279,6 +283,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
}
|
||||
});
|
||||
|
||||
swShadow.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("shadow_unread", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swDate.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -887,7 +898,9 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
|
||||
swCards.setChecked(prefs.getBoolean("cards", true));
|
||||
swBeige.setChecked(prefs.getBoolean("beige", true));
|
||||
swShadow.setChecked(prefs.getBoolean("shadow_unread", false));
|
||||
swBeige.setEnabled(swCards.isChecked());
|
||||
swShadow.setEnabled(swCards.isChecked());
|
||||
swDate.setChecked(prefs.getBoolean("date", true));
|
||||
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
|
||||
swPortrait2.setChecked(prefs.getBoolean("portrait2", false));
|
||||
|
||||
Reference in New Issue
Block a user