From 3f8f15256db92d0c0627cc09051e288bea210ecf Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 20 Nov 2022 15:37:09 +0100 Subject: [PATCH] Fix issue #496 - wrong label for new reports and user sign-up --- .../ui/drawer/NotificationAdapter.java | 20 +++++++++++++++---- .../FragmentMastodonConversation.java | 4 +++- .../FragmentMastodonNotification.java | 14 +++++++++++-- app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java index 4009f56e..8e44aec4 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java @@ -67,6 +67,8 @@ public class NotificationAdapter extends RecyclerView.Adapter 0) { if (notification.type.equals("favourite")) { diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java index 98c3a187..eddc97b7 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java @@ -103,6 +103,8 @@ public class FragmentMastodonConversation extends Fragment implements Conversati isViewInitialized = true; if (initialConversations != null) { initializeConversationCommonView(initialConversations); + } else { + route(null, false); } } } @@ -247,7 +249,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati binding.recyclerView.setVisibility(View.GONE); timelinesVM = new ViewModelProvider(FragmentMastodonConversation.this).get(TimelinesVM.class); max_id = null; - route(null, false); + } /** diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java index 50ca2d89..f87a09cf 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java @@ -176,7 +176,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati binding.recyclerView.setVisibility(View.GONE); max_id = null; initialNotifications = null; - route(null, false); + } @@ -213,6 +213,8 @@ public class FragmentMastodonNotification extends Fragment implements Notificati excludeType.add("mention"); excludeType.add("update"); excludeType.add("status"); + excludeType.add("admin.sign_up"); + excludeType.add("admin.report"); if (notificationType == NotificationTypeEnum.ALL) { aggregateNotification = sharedpreferences.getBoolean(getString(R.string.SET_AGGREGATE_NOTIFICATION), true); if (excludedCategories != null) { @@ -234,6 +236,10 @@ public class FragmentMastodonNotification extends Fragment implements Notificati excludeType.remove("update"); } else if (notificationType == NotificationTypeEnum.TOOTS) { excludeType.remove("status"); + } else if (notificationType == NotificationTypeEnum.ADMIN_SIGNUP) { + excludeType.remove("admin.sign_up"); + } else if (notificationType == NotificationTypeEnum.ADMIN_REPORT) { + excludeType.remove("admin.report"); } else if (notificationType == NotificationTypeEnum.FOLLOWS) { excludeType.remove("follow"); excludeType.remove("follow_request"); @@ -343,7 +349,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati if (initialNotifications != null) { initializeNotificationView(initialNotifications); } else { - recreate(); + route(null, false); } } } @@ -684,6 +690,10 @@ public class FragmentMastodonNotification extends Fragment implements Notificati REBLOGS("REBLOGS"), @SerializedName("POLLS") POLLS("POLLS"), + @SerializedName("ADMIN_SIGNUP") + ADMIN_SIGNUP("ADMIN_SIGNUP"), + @SerializedName("ADMIN_REPORT") + ADMIN_REPORT("ADMIN_REPORT"), @SerializedName("TOOTS") TOOTS("TOOTS"), @SerializedName("FOLLOWS") diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index da99dea1..502ec56f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1902,4 +1902,6 @@ Display remote profile The app cannot find remote data! Delete timeline + Submitted a report + Signed up \ No newline at end of file