From 37622ba9ce15a748a920c5742b020762a780915f Mon Sep 17 00:00:00 2001 From: sk Date: Sat, 3 Jun 2023 22:47:20 +0200 Subject: [PATCH] generalize notification handling, open reports in browser --- .../joinmastodon/android/MainActivity.java | 14 +------------ .../fragments/NotificationsListFragment.java | 21 ++++--------------- .../android/ui/utils/UiUtils.java | 17 +++++++++++++++ 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java b/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java index fd43c387b..1f19516b8 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java +++ b/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java @@ -117,25 +117,13 @@ public class MainActivity extends FragmentStackActivity implements ProvidesAssis } private void showFragmentForNotification(Notification notification, String accountID){ - Fragment fragment; - Bundle args=new Bundle(); - args.putString("account", accountID); - args.putBoolean("_can_go_back", true); try{ notification.postprocess(); }catch(ObjectValidationException x){ Log.w("MainActivity", x); return; } - if(notification.status!=null){ - fragment=new ThreadFragment(); - args.putParcelable("status", Parcels.wrap(notification.status)); - }else{ - fragment=new ProfileFragment(); - args.putParcelable("profileAccount", Parcels.wrap(notification.account)); - } - fragment.setArguments(args); - showFragment(fragment); + UiUtils.showFragmentForNotification(this, notification, accountID, null); } private void showFragmentForExternalShare(Bundle args) { diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index 176adcfe1..6650e6752 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -192,23 +192,10 @@ public class NotificationsListFragment extends BaseStatusListFragment