From aaa80f80f1991a59c879fea3730d8bda7db6defa Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sun, 23 Apr 2023 14:50:00 +0200 Subject: [PATCH] refactor: move miscellanious settings --- .../fragments/settings/NotificationsFragment.java | 13 +++++++++++++ .../fragments/settings/TimeLineFragment.java | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/NotificationsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/NotificationsFragment.java index 75d9d9326..6904ac153 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/NotificationsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/NotificationsFragment.java @@ -1,5 +1,6 @@ package org.joinmastodon.android.fragments.settings; +import org.joinmastodon.android.GlobalUserPreferences; import org.joinmastodon.android.R; import org.joinmastodon.android.model.PushNotification; import org.joinmastodon.android.model.PushSubscription; @@ -21,5 +22,17 @@ public class NotificationsFragment extends SettingsBaseFragment { items.add(new SwitchItem(R.string.sk_notify_update, R.drawable.ic_fluent_history_24_regular, pushSubscription.alerts.update, i -> onNotificationsChanged(PushNotification.Type.UPDATE, i.checked), switchEnabled)); items.add(new SwitchItem(R.string.sk_notify_poll_results, R.drawable.ic_fluent_poll_24_regular, pushSubscription.alerts.poll, i -> onNotificationsChanged(PushNotification.Type.POLL, i.checked), switchEnabled)); + items.add(new HeaderItem(R.string.mo_miscellaneous_settings)); + 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_single_notification, R.drawable.ic_fluent_convert_range_24_regular, GlobalUserPreferences.keepOnlyLatestNotification, i->{ + GlobalUserPreferences.keepOnlyLatestNotification=i.checked; + GlobalUserPreferences.save(); + })); + + } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/TimeLineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/TimeLineFragment.java index 528a06fd3..3ff44655b 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/TimeLineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/TimeLineFragment.java @@ -100,6 +100,11 @@ public class TimeLineFragment extends SettingsBaseFragment{ GlobalUserPreferences.save(); needAppRestart=true; })); + items.add(new SwitchItem(R.string.mo_disable_dividers, R.drawable.ic_fluent_timeline_24_regular, GlobalUserPreferences.disableDividers, i->{ + GlobalUserPreferences.disableDividers=i.checked; + GlobalUserPreferences.save(); + needAppRestart=true; + })); } private boolean onReplyVisibilityChanged(MenuItem item, Button btn){