Merge pull request #5452 from ByteHamster/end-select-fewer

End select mode when the number of items got smaller
This commit is contained in:
ByteHamster 2021-10-05 22:00:10 +02:00 committed by GitHub
commit 63d6f3f2e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -304,6 +304,10 @@ public class SubscriptionFragment extends Fragment
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
result -> {
if (listItems != null && listItems.size() > result.size()) {
// We have fewer items. This can result in items being selected that are no longer visible.
subscriptionAdapter.endSelectMode();
}
listItems = result;
subscriptionAdapter.setItems(result);
subscriptionAdapter.notifyDataSetChanged();