From 5b0f3461b994299e96bfaf29ff7d24cea182a82b Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 26 Apr 2018 17:35:19 +0300 Subject: [PATCH] change List items to List items --- .../wikivoyage/explore/ExploreRvAdapter.java | 39 ++++++------------- .../explore/ExploreTabFragment.java | 9 +++-- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java index 648375db50..dcf4ee29bb 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java @@ -8,6 +8,7 @@ import android.view.View; import android.view.ViewGroup; import net.osmand.plus.R; +import net.osmand.plus.wikivoyage.explore.travelcards.BaseTravelCard; import net.osmand.plus.wikivoyage.explore.travelcards.ArticleTravelCard; import net.osmand.plus.wikivoyage.explore.travelcards.ArticleTravelCard.ArticleTravelVH; import net.osmand.plus.wikivoyage.explore.travelcards.HeaderTravelCard; @@ -24,7 +25,7 @@ import java.util.List; public class ExploreRvAdapter extends RecyclerView.Adapter { - private final List items = new ArrayList<>(); + private final List items = new ArrayList<>(); @NonNull @Override @@ -60,7 +61,7 @@ public class ExploreRvAdapter extends RecyclerView.Adapter 0; i--) { - Object o = items.get(i); + BaseTravelCard o = items.get(i); if (o instanceof ArticleTravelCard) { return i; } @@ -120,21 +105,21 @@ public class ExploreRvAdapter extends RecyclerView.Adapter getItems() { + public List getItems() { return items; } - public void setItems(List items) { + public void setItems(List items) { this.items.clear(); this.items.addAll(items); } - public boolean addItem(int position, Object item) { + public boolean addItem(int position, BaseTravelCard item) { if (position >= 0 && position <= items.size()) { items.add(position, item); return true; diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index b54d2cffbb..c9c0587e11 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -22,6 +22,7 @@ import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask; import net.osmand.plus.wikivoyage.data.TravelArticle; import net.osmand.plus.wikivoyage.data.TravelDbHelper; import net.osmand.plus.wikivoyage.explore.travelcards.ArticleTravelCard; +import net.osmand.plus.wikivoyage.explore.travelcards.BaseTravelCard; import net.osmand.plus.wikivoyage.explore.travelcards.HeaderTravelCard; import net.osmand.plus.wikivoyage.explore.travelcards.OpenBetaTravelCard; import net.osmand.plus.wikivoyage.explore.travelcards.StartEditingTravelCard; @@ -56,8 +57,8 @@ public class ExploreTabFragment extends BaseOsmAndFragment { return mainView; } - private List generateItems() { - final List items = new ArrayList<>(); + private List generateItems() { + final List items = new ArrayList<>(); final OsmandApplication app = getMyApplication(); addDownloadUpdateCard(); @@ -91,7 +92,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment { popularDestinationsSearchTask.execute(); } - private void addOpenBetaTravelCard(List items, final boolean nightMode) { + private void addOpenBetaTravelCard(List items, final boolean nightMode) { final OsmandApplication app = getMyApplication(); if ((Version.isFreeVersion(app) && !app.getSettings().LIVE_UPDATES_PURCHASED.get() && !app.getSettings().FULL_VERSION_PURCHASED.get())) { @@ -167,7 +168,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment { StartEditingTravelCard startEditingTravelCard = weakStartEditingTravelCard.get(); if (activity != null && adapter != null && startEditingTravelCard != null) { - List adapterItems = adapter.getItems(); + List adapterItems = adapter.getItems(); if (adapterItems.contains(startEditingTravelCard)) { adapterItems.remove(startEditingTravelCard);