Merge pull request #5266 from ByteHamster/fix-multi-select-staying

End select mode when page is closed
This commit is contained in:
ByteHamster 2021-07-11 14:45:33 +02:00 committed by GitHub
commit e45f62c727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

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

View File

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

View File

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