Fix updating of saved articles list
This commit is contained in:
parent
c4d386d7f5
commit
b298eb299c
1 changed files with 2 additions and 1 deletions
|
@ -58,8 +58,9 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Wiki
|
||||||
public void savedArticlesUpdated() {
|
public void savedArticlesUpdated() {
|
||||||
List<Object> newItems = getItems();
|
List<Object> newItems = getItems();
|
||||||
SavedArticlesDiffCallback diffCallback = new SavedArticlesDiffCallback(adapter.getItems(), newItems);
|
SavedArticlesDiffCallback diffCallback = new SavedArticlesDiffCallback(adapter.getItems(), newItems);
|
||||||
|
DiffUtil.DiffResult diffRes = DiffUtil.calculateDiff(diffCallback);
|
||||||
adapter.setItems(newItems);
|
adapter.setItems(newItems);
|
||||||
DiffUtil.calculateDiff(diffCallback).dispatchUpdatesTo(adapter);
|
diffRes.dispatchUpdatesTo(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Object> getItems() {
|
private List<Object> getItems() {
|
||||||
|
|
Loading…
Reference in a new issue