Fix fragment issue

This commit is contained in:
Thomas 2022-06-22 18:06:36 +02:00
parent f219b6ef24
commit 0c726d1c55
15 changed files with 2 additions and 100 deletions

View file

@ -197,16 +197,6 @@ public class FragmentAdminAccount extends Fragment {
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (binding != null) {
binding.recyclerView.setAdapter(null);
}
adminAccountAdapter = null;
binding = null;
}
interface Callback {
void accountFetched(AdminAccounts adminAccounts);
}

View file

@ -204,16 +204,6 @@ public class FragmentAdminReport extends Fragment {
super.onPause();
}
@Override
public void onDestroyView() {
if (binding != null) {
binding.recyclerView.setAdapter(null);
}
statusAdapter = null;
binding = null;
super.onDestroyView();
}
/**
* Refresh status in list

View file

@ -44,10 +44,4 @@ public class FragmentLoginJoin extends Fragment {
return root;
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}

View file

@ -233,12 +233,6 @@ public class FragmentLoginMain extends Fragment {
popupMenu.show();
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
private void retrievesClientId(String instance) {
if (!instance.startsWith("http://") && !instance.startsWith("https://")) {
instance = "https://" + instance;

View file

@ -132,10 +132,4 @@ public class FragmentLoginPickInstanceMastodon extends Fragment implements Insta
args, null, FragmentLoginRegisterMastodon.class.getName());
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}

View file

@ -189,10 +189,4 @@ public class FragmentLoginRegisterMastodon extends Fragment {
});
return root;
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}

View file

@ -263,14 +263,4 @@ public class FragmentMastodonAccount extends Fragment {
flagLoading = true;
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (binding != null) {
binding.recyclerView.setAdapter(null);
}
accountAdapter = null;
binding = null;
}
}

View file

@ -110,12 +110,4 @@ public class FragmentMastodonAnnouncement extends Fragment {
binding.recyclerView.scrollToPosition(0);
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding.recyclerView.setAdapter(null);
announcementAdapter = null;
binding = null;
}
}

View file

@ -257,9 +257,6 @@ public class FragmentMastodonContext extends Fragment {
@Override
public void onDestroyView() {
binding.recyclerView.setAdapter(null);
statusAdapter = null;
binding = null;
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action);
super.onDestroyView();
}

View file

@ -152,11 +152,4 @@ public class FragmentMastodonConversation extends Fragment {
binding.recyclerView.scrollToPosition(0);
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding.recyclerView.setAdapter(null);
conversationAdapter = null;
binding = null;
}
}

View file

@ -489,10 +489,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
}).start();
}
super.onDestroyView();
binding.recyclerView.setAdapter(null);
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action);
notificationAdapter = null;
binding = null;
}
@Override

View file

@ -117,11 +117,4 @@ public class FragmentMastodonTag extends Fragment {
binding.recyclerView.setAdapter(tagAdapter);
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding.recyclerView.setAdapter(null);
tagAdapter = null;
binding = null;
}
}

View file

@ -526,16 +526,12 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
}).start();
}
storeMarker();
if (binding != null) {
binding.recyclerView.setAdapter(null);
}
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action);
}
statusAdapter = null;
binding = null;
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action);
super.onDestroyView();
}
private void storeMarker() {
if (timelineType == Timeline.TimeLineEnum.HOME && mLayoutManager != null) {
int position = mLayoutManager.findFirstVisibleItemPosition();

View file

@ -258,10 +258,4 @@ public class FragmentNotificationContainer extends Fragment {
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}

View file

@ -78,10 +78,4 @@ public class FragmentProfileTimeline extends Fragment {
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}