diff options
Diffstat (limited to 'app/src/main/java/app/fedilab/android/mastodon/ui/pageadapter/FedilabProfileTLPageAdapter.java')
-rw-r--r-- | app/src/main/java/app/fedilab/android/mastodon/ui/pageadapter/FedilabProfileTLPageAdapter.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/pageadapter/FedilabProfileTLPageAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/pageadapter/FedilabProfileTLPageAdapter.java index 748b01ae8..c71043029 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/pageadapter/FedilabProfileTLPageAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/pageadapter/FedilabProfileTLPageAdapter.java @@ -54,26 +54,29 @@ public class FedilabProfileTLPageAdapter extends FragmentStatePagerAdapter { @NonNull @Override public Fragment getItem(int position) { + Bundle bundle; switch (position) { - case 0: + case 0 -> { FragmentProfileTimeline fragmentProfileTimeline = new FragmentProfileTimeline(); - Bundle bundle = new Bundle(); - bundle.putSerializable(Helper.ARG_ACCOUNT, account); + bundle = new Bundle(); + bundle.putString(Helper.ARG_CACHED_ACCOUNT_ID, account.id); bundle.putSerializable(Helper.ARG_CHECK_REMOTELY, checkRemotely); fragmentProfileTimeline.setArguments(bundle); return fragmentProfileTimeline; - case 1: - case 2: + } + case 1, 2 -> { FragmentMastodonAccount fragmentMastodonAccount = new FragmentMastodonAccount(); bundle = new Bundle(); - bundle.putSerializable(Helper.ARG_ACCOUNT, account); + bundle.putString(Helper.ARG_CACHED_ACCOUNT_ID, account.id); bundle.putSerializable(Helper.ARG_CHECK_REMOTELY, checkRemotely); bundle.putString(Helper.ARG_VIEW_MODEL_KEY, "FEDILAB_" + position); bundle.putSerializable(Helper.ARG_FOLLOW_TYPE, position == 1 ? follow_type.FOLLOWING : follow_type.FOLLOWERS); fragmentMastodonAccount.setArguments(bundle); return fragmentMastodonAccount; - default: + } + default -> { return new FragmentMastodonTimeline(); + } } } |