Fix ExploreRvAdapter

This commit is contained in:
Dima-1 2020-12-29 11:16:11 +02:00
parent 75afb2b227
commit 8716d49a25
2 changed files with 7 additions and 2 deletions

View file

@ -142,7 +142,9 @@ public class ExploreRvAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
public void addNeededMapsCard(TravelNeededMapsCard card) {
this.neededMapsCard = card;
if (addItem(getNeededMapsCardPosition(), card)) {
if (neededMapsCardExists(getNeededMapsCardPosition())) {
updateNeededMapsCard(false);
} else if (addItem(getNeededMapsCardPosition(), card)) {
notifyDataSetChanged();
}
}
@ -183,7 +185,9 @@ public class ExploreRvAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
public void addDownloadUpdateCard(TravelDownloadUpdateCard card) {
this.downloadCard = card;
if (addItem(getDownloadUpdateCardPosition(), card)) {
if (downloadUpdateCardExists(getDownloadUpdateCardPosition())) {
updateDownloadUpdateCard(false);
} else if (addItem(getDownloadUpdateCardPosition(), card)) {
notifyDataSetChanged();
}
}

View file

@ -319,6 +319,7 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
private void onDataLoaded() {
switchProgressBarVisibility(false);
updateSearchBarVisibility();
updateFragments();
}
public void updateFragments() {