Improve updating of saved articles list
This commit is contained in:
parent
f85a67beec
commit
135352725d
1 changed files with 7 additions and 0 deletions
|
@ -122,6 +122,9 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Wiki
|
|||
if (oldItem instanceof String && newItem instanceof String) {
|
||||
return false;
|
||||
} else if (oldItem instanceof WikivoyageArticle && newItem instanceof WikivoyageArticle) {
|
||||
if (newItemPosition == newItems.size() - 1 && lastItemChanged()) {
|
||||
return false;
|
||||
}
|
||||
WikivoyageArticle oldArticle = (WikivoyageArticle) oldItem;
|
||||
WikivoyageArticle newArticle = (WikivoyageArticle) newItem;
|
||||
return oldArticle.getCityId() == newArticle.getCityId()
|
||||
|
@ -129,5 +132,9 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Wiki
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean lastItemChanged() {
|
||||
return newItems.get(newItems.size() - 1) != oldItems.get(oldItems.size() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue