Revert "Added option to show sender only in summary notifications"

This reverts commit 964ab3d61a.
pull/217/head
M66B 6 months ago
parent 964ab3d61a
commit 4d2fb605b0

@ -126,7 +126,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private SwitchCompat swMessagingStyle; private SwitchCompat swMessagingStyle;
private ImageButton ibCar; private ImageButton ibCar;
private SwitchCompat swBiometricsNotify; private SwitchCompat swBiometricsNotify;
private SwitchCompat swNotifyMinimal;
private SwitchCompat swNotifyOpenFolder; private SwitchCompat swNotifyOpenFolder;
private SwitchCompat swBackground; private SwitchCompat swBackground;
private Spinner spRateLimit; private Spinner spRateLimit;
@ -154,7 +153,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
"notify_subtext", "notify_preview", "notify_preview_all", "notify_preview_only", "notify_transliterate", "notify_ascii", "notify_subtext", "notify_preview", "notify_preview_all", "notify_preview_only", "notify_transliterate", "notify_ascii",
"wearable_preview", "wearable_preview",
"notify_messaging", "notify_messaging",
"biometrics_notify", "notify_minimal", "notify_open_folder", "background_service", "notify_rate_limit", "alert_once" "biometrics_notify", "notify_open_folder", "background_service", "notify_rate_limit", "alert_once"
)); ));
@Override @Override
@ -220,7 +219,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
swMessagingStyle = view.findViewById(R.id.swMessagingStyle); swMessagingStyle = view.findViewById(R.id.swMessagingStyle);
ibCar = view.findViewById(R.id.ibCar); ibCar = view.findViewById(R.id.ibCar);
swBiometricsNotify = view.findViewById(R.id.swBiometricsNotify); swBiometricsNotify = view.findViewById(R.id.swBiometricsNotify);
swNotifyMinimal = view.findViewById(R.id.swNotifyMinimal);
swNotifyOpenFolder = view.findViewById(R.id.swNotifyOpenFolder); swNotifyOpenFolder = view.findViewById(R.id.swNotifyOpenFolder);
swBackground = view.findViewById(R.id.swBackground); swBackground = view.findViewById(R.id.swBackground);
spRateLimit = view.findViewById(R.id.spRateLimit); spRateLimit = view.findViewById(R.id.spRateLimit);
@ -735,15 +733,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("biometrics_notify", checked).apply(); prefs.edit().putBoolean("biometrics_notify", checked).apply();
enableOptions();
}
});
swNotifyMinimal.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("notify_minimal", checked).apply();
enableOptions();
} }
}); });
@ -937,7 +926,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
swWearablePreview.setChecked(prefs.getBoolean("wearable_preview", false)); swWearablePreview.setChecked(prefs.getBoolean("wearable_preview", false));
swMessagingStyle.setChecked(prefs.getBoolean("notify_messaging", false)); swMessagingStyle.setChecked(prefs.getBoolean("notify_messaging", false));
swBiometricsNotify.setChecked(prefs.getBoolean("biometrics_notify", true)); swBiometricsNotify.setChecked(prefs.getBoolean("biometrics_notify", true));
swNotifyMinimal.setChecked(prefs.getBoolean("notify_minimal", false));
swNotifyOpenFolder.setChecked(prefs.getBoolean("notify_open_folder", false)); swNotifyOpenFolder.setChecked(prefs.getBoolean("notify_open_folder", false));
swBackground.setChecked(prefs.getBoolean("background_service", false)); swBackground.setChecked(prefs.getBoolean("background_service", false));
swAlertOnce.setChecked(!prefs.getBoolean("alert_once", true)); swAlertOnce.setChecked(!prefs.getBoolean("alert_once", true));
@ -968,7 +956,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
swNotifyPreviewOnly.setEnabled(!summary && swNotifyPreview.isChecked()); swNotifyPreviewOnly.setEnabled(!summary && swNotifyPreview.isChecked());
swWearablePreview.setEnabled(!summary && swNotifyPreview.isChecked()); swWearablePreview.setEnabled(!summary && swNotifyPreview.isChecked());
swBiometricsNotify.setEnabled(!summary); swBiometricsNotify.setEnabled(!summary);
swNotifyMinimal.setEnabled(summary || !swBiometricsNotify.isChecked());
} }
@Override @Override

@ -727,7 +727,6 @@ class NotificationHelper {
boolean alert_once = prefs.getBoolean("alert_once", true); boolean alert_once = prefs.getBoolean("alert_once", true);
boolean perform_expunge = prefs.getBoolean("perform_expunge", true); boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
boolean delete_notification = prefs.getBoolean("delete_notification", false); boolean delete_notification = prefs.getBoolean("delete_notification", false);
boolean notify_minimal = prefs.getBoolean("notify_minimal", false);
// Get contact info // Get contact info
Long latest = null; Long latest = null;
@ -865,7 +864,7 @@ class NotificationHelper {
} }
if (notify_preview) if (notify_preview)
if (redacted && !notify_minimal) if (redacted)
builder.setContentText(context.getString(R.string.title_notification_redacted)); builder.setContentText(context.getString(R.string.title_notification_redacted));
else { else {
DateFormat DTF = Helper.getDateTimeInstance(context, SimpleDateFormat.SHORT, SimpleDateFormat.SHORT); DateFormat DTF = Helper.getDateTimeInstance(context, SimpleDateFormat.SHORT, SimpleDateFormat.SHORT);
@ -874,7 +873,7 @@ class NotificationHelper {
Address[] afrom = messageFrom.get(message.id); Address[] afrom = messageFrom.get(message.id);
String from = MessageHelper.formatAddresses(afrom, email_format, false); String from = MessageHelper.formatAddresses(afrom, email_format, false);
sb.append("<strong>").append(Html.escapeHtml(from)).append("</strong>"); sb.append("<strong>").append(Html.escapeHtml(from)).append("</strong>");
if (!TextUtils.isEmpty(message.subject) && !notify_minimal) if (!TextUtils.isEmpty(message.subject))
sb.append(": ").append(Html.escapeHtml(message.subject)); sb.append(": ").append(Html.escapeHtml(message.subject));
sb.append(" ").append(Html.escapeHtml(DTF.format(message.received))); sb.append(" ").append(Html.escapeHtml(DTF.format(message.received)));
sb.append("<br>"); sb.append("<br>");

@ -890,19 +890,6 @@
app:layout_constraintTop_toBottomOf="@id/ibCar" app:layout_constraintTop_toBottomOf="@id/ibCar"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNotifyMinimal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_notify_minimal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swBiometricsNotify"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNotifyOpenFolder" android:id="@+id/swNotifyOpenFolder"
android:layout_width="0dp" android:layout_width="0dp"
@ -912,7 +899,7 @@
android:text="@string/title_advanced_notify_open_folder" android:text="@string/title_advanced_notify_open_folder"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNotifyMinimal" app:layout_constraintTop_toBottomOf="@id/swBiometricsNotify"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

@ -808,7 +808,6 @@
<string name="title_advanced_wearable_preview">Only send notifications with a message preview to wearables</string> <string name="title_advanced_wearable_preview">Only send notifications with a message preview to wearables</string>
<string name="title_advanced_notify_messaging">Use Android \'messaging style\' notification format</string> <string name="title_advanced_notify_messaging">Use Android \'messaging style\' notification format</string>
<string name="title_advanced_biometrics_notify">Show notification content when using biometric authentication</string> <string name="title_advanced_biometrics_notify">Show notification content when using biometric authentication</string>
<string name="title_advanced_notify_minimal">Show sender only</string>
<string name="title_advanced_notify_open_folder">Open folder when opening new message</string> <string name="title_advanced_notify_open_folder">Open folder when opening new message</string>
<string name="title_advanced_light">Use notification light</string> <string name="title_advanced_light">Use notification light</string>
<string name="title_advanced_sound">Select notification sound</string> <string name="title_advanced_sound">Select notification sound</string>

Loading…
Cancel
Save