End select mode when the number of items got smaller

This commit is contained in:
ByteHamster 2021-10-05 21:18:45 +02:00
parent 160401ad13
commit a540eca0d5

View File

@ -303,6 +303,10 @@ public class SubscriptionFragment extends Fragment
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe( .subscribe(
result -> { 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; listItems = result;
subscriptionAdapter.setItems(result); subscriptionAdapter.setItems(result);
subscriptionAdapter.notifyDataSetChanged(); subscriptionAdapter.notifyDataSetChanged();