mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 21:34:44 +02:00
Added option to disable notifying in the foreground
This commit is contained in:
@@ -70,6 +70,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
|
||||
private SwitchCompat swBadge;
|
||||
private SwitchCompat swUnseenIgnored;
|
||||
private SwitchCompat swNotifyBackgroundOnly;
|
||||
private SwitchCompat swNotifyKnown;
|
||||
private TextView tvNotifyKnownPro;
|
||||
private SwitchCompat swNotifySummary;
|
||||
@@ -93,7 +94,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
"notify_flag", "notify_seen", "notify_snooze",
|
||||
"light", "sound",
|
||||
"badge", "unseen_ignored",
|
||||
"notify_known", "notify_summary", "notify_remove", "notify_clear",
|
||||
"notify_background_only", "notify_known", "notify_summary", "notify_remove", "notify_clear",
|
||||
"notify_preview", "notify_preview_all", "notify_preview_only", "wearable_preview",
|
||||
"biometrics_notify",
|
||||
"alert_once"
|
||||
@@ -130,6 +131,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
|
||||
swBadge = view.findViewById(R.id.swBadge);
|
||||
swUnseenIgnored = view.findViewById(R.id.swUnseenIgnored);
|
||||
swNotifyBackgroundOnly = view.findViewById(R.id.swNotifyBackgroundOnly);
|
||||
swNotifyKnown = view.findViewById(R.id.swNotifyKnown);
|
||||
tvNotifyKnownPro = view.findViewById(R.id.tvNotifyKnownPro);
|
||||
swNotifySummary = view.findViewById(R.id.swNotifySummary);
|
||||
@@ -308,6 +310,14 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
}
|
||||
});
|
||||
|
||||
swNotifyBackgroundOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("notify_background_only", checked).apply();
|
||||
enableOptions();
|
||||
}
|
||||
});
|
||||
|
||||
swNotifyKnown.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -457,6 +467,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
|
||||
swBadge.setChecked(prefs.getBoolean("badge", true));
|
||||
swUnseenIgnored.setChecked(prefs.getBoolean("unseen_ignored", false));
|
||||
swNotifyBackgroundOnly.setChecked(prefs.getBoolean("notify_background_only", false));
|
||||
swNotifyKnown.setChecked(prefs.getBoolean("notify_known", false));
|
||||
swNotifySummary.setChecked(prefs.getBoolean("notify_summary", false));
|
||||
swNotifyRemove.setChecked(prefs.getBoolean("notify_remove", true));
|
||||
|
||||
Reference in New Issue
Block a user