diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index ce8865611b..44bddbdd26 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -1995,7 +1995,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB if (ignore) ServiceUI.ignore(this, id, group); intent.putExtra("id", id); - if (account > 0 && folder > 0 && !TextUtils.isEmpty(type) && BuildConfig.DEBUG) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivityView.this); + boolean notify_open_folder = prefs.getBoolean("notify_open_folder", false); + if (account > 0 && folder > 0 && !TextUtils.isEmpty(type) && notify_open_folder) { if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java index 97a0b45c66..73f1cf4afe 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java @@ -117,6 +117,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared private SwitchCompat swMessagingStyle; private ImageButton ibCar; private SwitchCompat swBiometricsNotify; + private SwitchCompat swNotifyOpenFolder; private SwitchCompat swBackground; private SwitchCompat swAlertOnce; private ImageButton ibTileSync; @@ -142,7 +143,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared "notify_subtext", "notify_preview", "notify_preview_all", "notify_preview_only", "notify_transliterate", "wearable_preview", "notify_messaging", - "biometrics_notify", "background_service", "alert_once" + "biometrics_notify", "notify_open_folder", "background_service", "alert_once" }; @Override @@ -206,6 +207,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared swMessagingStyle = view.findViewById(R.id.swMessagingStyle); ibCar = view.findViewById(R.id.ibCar); swBiometricsNotify = view.findViewById(R.id.swBiometricsNotify); + swNotifyOpenFolder = view.findViewById(R.id.swNotifyOpenFolder); swBackground = view.findViewById(R.id.swBackground); swAlertOnce = view.findViewById(R.id.swAlertOnce); ibTileSync = view.findViewById(R.id.ibTileSync); @@ -694,6 +696,13 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared } }); + swNotifyOpenFolder.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("notify_open_folder", checked).apply(); + } + }); + swBackground.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -844,6 +853,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared swWearablePreview.setChecked(prefs.getBoolean("wearable_preview", false)); swMessagingStyle.setChecked(prefs.getBoolean("notify_messaging", false)); swBiometricsNotify.setChecked(prefs.getBoolean("biometrics_notify", true)); + swNotifyOpenFolder.setChecked(prefs.getBoolean("notify_open_folder", false)); swBackground.setChecked(prefs.getBoolean("background_service", false)); swAlertOnce.setChecked(!prefs.getBoolean("alert_once", true)); diff --git a/app/src/main/res/layout/fragment_options_notifications.xml b/app/src/main/res/layout/fragment_options_notifications.xml index 901cae79f7..2379ffb843 100644 --- a/app/src/main/res/layout/fragment_options_notifications.xml +++ b/app/src/main/res/layout/fragment_options_notifications.xml @@ -843,6 +843,18 @@ app:layout_constraintTop_toBottomOf="@id/ibCar" app:switchPadding="12dp" /> + + Only send notifications with a message preview to wearables Use Android \'messaging style\' notification format Show notification content when using biometric authentication + Open folder when opening new message Use notification light Select notification sound Briefly turn on the screen for new message notifications