From 0aac29545fcc98f2cea8ae8dc74b47d75ffc638d Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Thu, 9 Feb 2023 15:07:36 -0300 Subject: [PATCH] Adding the option to enable notification deletion. Fixing #71 --- .../java/org/joinmastodon/android/GlobalUserPreferences.java | 2 +- .../org/joinmastodon/android/fragments/SettingsFragment.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java index 8bc841a84..f9f8a63a8 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java +++ b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java @@ -87,7 +87,7 @@ public class GlobalUserPreferences{ disableDividers=prefs.getBoolean("disableDividers", true); relocatePublishButton=prefs.getBoolean("relocatePublishButton", true); voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true); - enableDeleteNotifications=prefs.getBoolean("enableDeleteNotifications", true); + enableDeleteNotifications=prefs.getBoolean("enableDeleteNotifications", false); reduceMotion=prefs.getBoolean("reduceMotion", false); keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false); enableFabAutoHide=prefs.getBoolean("enableFabAutoHide", true); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java index cce12aba1..7ea598883 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java @@ -204,6 +204,11 @@ public class SettingsFragment extends MastodonToolbarFragment{ GlobalUserPreferences.save(); needAppRestart=true; })); + items.add(new SwitchItem(R.string.sk_enable_delete_notifications, R.drawable.ic_fluent_mail_inbox_dismiss_24_regular, GlobalUserPreferences.enableDeleteNotifications, i->{ + GlobalUserPreferences.enableDeleteNotifications=i.checked; + GlobalUserPreferences.save(); + needAppRestart=true; + })); // items.add(new SwitchItem(R.string.sk_settings_show_differentiated_notification_icons, R.drawable.ic_ntf_logo, GlobalUserPreferences.showUniformPushNoticationIcons, this::onNotificationStyleChanged)); items.add(new SwitchItem(R.string.mo_disable_dividers, R.drawable.ic_fluent_timeline_24_regular, GlobalUserPreferences.disableDividers, i->{ GlobalUserPreferences.disableDividers=i.checked;