mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 00:53:26 +02:00
Added option to disable stars
This commit is contained in:
@@ -143,6 +143,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private boolean contacts;
|
||||
private boolean search;
|
||||
private boolean avatars;
|
||||
private boolean flags;
|
||||
private boolean preview;
|
||||
private boolean autohtml;
|
||||
private boolean autoimages;
|
||||
@@ -693,7 +694,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
int flagged = (message.count - message.unflagged);
|
||||
ivFlagged.setImageResource(flagged > 0 ? R.drawable.baseline_star_24 : R.drawable.baseline_star_border_24);
|
||||
ivFlagged.setImageTintList(ColorStateList.valueOf(flagged > 0 ? colorAccent : textColorSecondary));
|
||||
ivFlagged.setVisibility(message.uid == null ? View.INVISIBLE : View.VISIBLE);
|
||||
ivFlagged.setVisibility(flags ? (message.uid == null ? View.INVISIBLE : View.VISIBLE) : View.GONE);
|
||||
}
|
||||
|
||||
private void bindContactInfo(ContactInfo info, TupleMessageEx message) {
|
||||
@@ -2667,6 +2668,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
|
||||
this.avatars = (prefs.getBoolean("avatars", true) ||
|
||||
prefs.getBoolean("identicons", false));
|
||||
this.flags = prefs.getBoolean("flags", true);
|
||||
this.preview = prefs.getBoolean("preview", false);
|
||||
this.autohtml = prefs.getBoolean("autohtml", false);
|
||||
this.autoimages = (!this.autohtml && prefs.getBoolean("autoimages", false));
|
||||
|
||||
@@ -78,6 +78,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
private SwitchCompat swAvatars;
|
||||
private SwitchCompat swIdenticons;
|
||||
private SwitchCompat swNameEmail;
|
||||
private SwitchCompat swFlags;
|
||||
private SwitchCompat swPreview;
|
||||
private SwitchCompat swAddresses;
|
||||
private SwitchCompat swHtml;
|
||||
@@ -107,7 +108,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
private Group grpNotification;
|
||||
|
||||
static String[] OPTIONS_RESTART = new String[]{
|
||||
"unified", "date", "threading", "avatars", "identicons", "name_email", "preview", "addresses", "autoimages", "actionbar",
|
||||
"unified", "date", "threading", "avatars", "identicons", "name_email", "flags", "preview", "addresses", "autoimages", "actionbar",
|
||||
"pull", "swipenav", "autoexpand", "autoclose", "autonext",
|
||||
"debug"
|
||||
};
|
||||
@@ -115,7 +116,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
private final static String[] ADVANCED_OPTIONS = new String[]{
|
||||
"enabled", "schedule_start", "schedule_end",
|
||||
"metered", "download",
|
||||
"unified", "date", "threading", "avatars", "identicons", "name_email", "preview", "addresses", "autoimages", "actionbar",
|
||||
"unified", "date", "threading", "avatars", "identicons", "name_email", "flags", "preview", "addresses", "autoimages", "actionbar",
|
||||
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
|
||||
"autoresize", "sender", "autosend",
|
||||
"notify_preview", "search_local", "light", "sound",
|
||||
@@ -148,6 +149,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
swAvatars = view.findViewById(R.id.swAvatars);
|
||||
swIdenticons = view.findViewById(R.id.swIdenticons);
|
||||
swNameEmail = view.findViewById(R.id.swNameEmail);
|
||||
swFlags = view.findViewById(R.id.swFlags);
|
||||
swPreview = view.findViewById(R.id.swPreview);
|
||||
swAddresses = view.findViewById(R.id.swAddresses);
|
||||
swHtml = view.findViewById(R.id.swHtml);
|
||||
@@ -312,6 +314,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
}
|
||||
});
|
||||
|
||||
swFlags.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("flags", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swPreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -553,6 +562,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
swAvatars.setChecked(prefs.getBoolean("avatars", true));
|
||||
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
|
||||
swNameEmail.setChecked(prefs.getBoolean("name_email", !compact));
|
||||
swFlags.setChecked(prefs.getBoolean("flags", true));
|
||||
swPreview.setChecked(prefs.getBoolean("preview", false));
|
||||
swAddresses.setChecked(prefs.getBoolean("addresses", true));
|
||||
swHtml.setChecked(prefs.getBoolean("autohtml", false));
|
||||
|
||||
Reference in New Issue
Block a user