Minor bugs fixed in PostFragment and ViewPostDetailFragment.

This commit is contained in:
Docile-Alligator 2025-05-23 12:45:16 -04:00
parent dfcbbc2b67
commit bac56b1fe3
2 changed files with 5 additions and 14 deletions

View File

@ -1384,11 +1384,9 @@ public class PostFragment extends PostFragmentBase implements FragmentCommunicat
}
@Override
public void onDestroy() {
if (mAdapter != null && binding.recyclerViewPostFragment != null) {
binding.recyclerViewPostFragment.addOnWindowFocusChangedListener(null);
}
super.onDestroy();
public void onDestroyView() {
binding.recyclerViewPostFragment.addOnWindowFocusChangedListener(null);
super.onDestroyView();
}
private void onWindowFocusChanged(boolean hasWindowsFocus) {

View File

@ -1203,16 +1203,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
@Override
public void onDestroyView() {
Bridge.clear(this);
super.onDestroyView();
}
@Override
public void onDestroy() {
EventBus.getDefault().unregister(this);
if (binding.postDetailRecyclerViewViewPostDetailFragment != null) {
binding.postDetailRecyclerViewViewPostDetailFragment.addOnWindowFocusChangedListener(null);
}
super.onDestroy();
binding.postDetailRecyclerViewViewPostDetailFragment.addOnWindowFocusChangedListener(null);
super.onDestroyView();
}
@SuppressLint("RestrictedApi")