diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index c2056e7acd..466819f28c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -7,6 +7,7 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; +import android.support.v4.app.FragmentManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -114,15 +115,18 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadIn final List items = new ArrayList<>(); final OsmandApplication app = getMyApplication(); - addOpenBetaTravelCard(items, nightMode); + if (!Version.isPaidVersion(app)) { + items.add(new OpenBetaTravelCard(app, nightMode, getFragmentManager())); + } if (app.getTravelDbHelper().getSelectedTravelBook() != null) { - items.add(new HeaderTravelCard(app, nightMode, getString(R.string.popular_destinations))); - List popularArticles = app.getTravelDbHelper().getPopularArticles(); FragmentActivity activity = getActivity(); if (activity != null) { + items.add(new HeaderTravelCard(app, nightMode, getString(R.string.popular_destinations))); + + FragmentManager fm = activity.getSupportFragmentManager(); + List popularArticles = app.getTravelDbHelper().getPopularArticles(); for (TravelArticle article : popularArticles) { - items.add(new ArticleTravelCard(getMyApplication(), nightMode, article, - activity.getSupportFragmentManager())); + items.add(new ArticleTravelCard(app, nightMode, article, fm)); } } } @@ -205,11 +209,4 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadIn adapter.removeDownloadUpdateCard(); downloadUpdateCard = null; } - - private void addOpenBetaTravelCard(List items, final boolean nightMode) { - final OsmandApplication app = getMyApplication(); - if (!Version.isPaidVersion(app)) { - items.add(new OpenBetaTravelCard(app, nightMode, getFragmentManager())); - } - } }