End select mode when page is closed

This commit is contained in:
ByteHamster 2021-07-11 11:27:38 +02:00
parent 81ea42a2a4
commit 96e34c319d
3 changed files with 8 additions and 5 deletions

View File

@ -120,6 +120,7 @@ public class CompletedDownloadsFragment extends Fragment implements
@Override @Override
public void onDestroyView() { public void onDestroyView() {
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
adapter.endSelectMode();
super.onDestroyView(); super.onDestroyView();
} }

View File

@ -267,6 +267,9 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
if (disposable != null) { if (disposable != null) {
disposable.dispose(); disposable.dispose();
} }
if (adapter != null) {
adapter.endSelectMode();
}
adapter = null; adapter = null;
} }

View File

@ -232,14 +232,13 @@ public class QueueFragment extends Fragment implements Toolbar.OnMenuItemClickLi
} }
} }
private void resetViewState() {
recyclerAdapter = null;
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
resetViewState(); if (recyclerAdapter != null) {
recyclerAdapter.endSelectMode();
}
recyclerAdapter = null;
} }
private final MenuItemUtils.UpdateRefreshMenuItemChecker updateRefreshMenuItemChecker = private final MenuItemUtils.UpdateRefreshMenuItemChecker updateRefreshMenuItemChecker =