diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonAccount.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonAccount.java index c4006b0f..f55c7492 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonAccount.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonAccount.java @@ -82,6 +82,11 @@ public class FragmentMastodonAccount extends Fragment { instance = currentInstance; token = currentToken; + flagLoading = false; + binding = FragmentPaginationBinding.inflate(inflater, container, false); + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); + boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false); + binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar); if (getArguments() != null) { long bundleId = getArguments().getLong(Helper.ARG_INTENT_ID, -1); if (bundleId != -1) { @@ -100,11 +105,7 @@ public class FragmentMastodonAccount extends Fragment { initializeAfterBundle(null); } - flagLoading = false; - binding = FragmentPaginationBinding.inflate(inflater, container, false); - SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); - boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false); - binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar); + return binding.getRoot(); }