Protect against individual item updates being put into an invalidated list.
This commit is contained in:
parent
1a9d785cbb
commit
ef7d5d55cb
1 changed files with 20 additions and 0 deletions
|
@ -142,6 +142,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
|
|||
return;
|
||||
}
|
||||
|
||||
if (invalidated) {
|
||||
Log.w(TAG, "Invalidated! Just before individual change was loaded for position " + position);
|
||||
return;
|
||||
}
|
||||
|
||||
Data item = dataSource.load(key);
|
||||
|
||||
if (item == null) {
|
||||
|
@ -149,6 +154,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
|
|||
return;
|
||||
}
|
||||
|
||||
if (invalidated) {
|
||||
Log.w(TAG, "Invalidated! Just after individual change was loaded for position " + position);
|
||||
return;
|
||||
}
|
||||
|
||||
List<Data> updatedList = new CompressedList<>(data);
|
||||
|
||||
updatedList.set(position, item);
|
||||
|
@ -165,6 +175,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
|
|||
return;
|
||||
}
|
||||
|
||||
if (invalidated) {
|
||||
Log.w(TAG, "Invalidated! Just before individual insert was loaded for position " + position);
|
||||
return;
|
||||
}
|
||||
|
||||
Data item = dataSource.load(key);
|
||||
|
||||
if (item == null) {
|
||||
|
@ -172,6 +187,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
|
|||
return;
|
||||
}
|
||||
|
||||
if (invalidated) {
|
||||
Log.w(TAG, "Invalidated! Just after individual insert was loaded for position " + position);
|
||||
return;
|
||||
}
|
||||
|
||||
List<Data> updatedList = new CompressedList<>(data);
|
||||
|
||||
updatedList.add(position, item);
|
||||
|
|
Loading…
Add table
Reference in a new issue