From 75316bd12c59281d5c9af49fc99c254dc6d9d906 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 17 Mar 2021 18:45:18 +0300 Subject: [PATCH 1/7] Fix huawei build (cherry picked from commit 078e037ac2c7b7b27858c8eeafefcdc65a708a21) --- OsmAnd/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index c862101bc8..3b512b1090 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -91,7 +91,7 @@ android { java.srcDirs = ["src-nogms", "src-google"] } huawei { - java.srcDirs = ["src-nogms", "src-google"] + java.srcDirs = ["src-nogms", "src-huawei"] manifest.srcFile "AndroidManifest-huawei.xml" } From 4c4196aa2bfa8383710141635f2c22082c224795 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 17 Mar 2021 18:59:52 +0300 Subject: [PATCH 2/7] Fix huawei build (cherry picked from commit 1bdc56d52a450132b3d172284d8c66d2ba908ad9) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e59a694b17..48bcc21248 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.google.gms:google-services:3.0.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - if (gradle.startParameter.taskNames.toString().contains("huawei")) { + if (gradle.startParameter.taskNames.toString().toLowerCase().contains("huawei")) { classpath 'com.huawei.agconnect:agcp:1.4.1.300' } } From b58d06f290c40f92c908ac84ba83dd0f7e395240 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 17 Mar 2021 18:52:17 +0200 Subject: [PATCH 3/7] Fix compilation (cherry picked from commit c4cf068f1b4ea83fe1802bdcd226850468e7893f) --- .../plus/inapp/InAppPurchaseHelperImpl.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java b/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java index 0f3536e5d0..9f05c1a70c 100644 --- a/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java +++ b/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java @@ -31,7 +31,6 @@ import net.osmand.plus.inapp.InAppPurchases.InAppSubscription; import net.osmand.plus.inapp.InAppPurchases.InAppSubscriptionIntroductoryInfo; import net.osmand.plus.inapp.InAppPurchasesImpl.InAppPurchaseLiveUpdatesOldSubscription; import net.osmand.plus.settings.backend.OsmandSettings; -import net.osmand.plus.settings.backend.OsmandPreference; import net.osmand.util.Algorithms; import java.lang.ref.WeakReference; @@ -268,7 +267,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { InAppSubscription s = (InAppSubscription) inAppPurchase; try { s.setIntroductoryInfo(new InAppSubscriptionIntroductoryInfo(s, introductoryPrice, - introductoryPriceAmountMicros, introductoryPricePeriod, String.valueOf(introductoryPriceCycles))); + introductoryPriceAmountMicros, introductoryPricePeriod, introductoryPriceCycles)); } catch (ParseException e) { LOG.error(e); } @@ -542,20 +541,12 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { } } } - OsmandPreference subscriptionCancelledTime = ctx.getSettings().LIVE_UPDATES_PURCHASE_CANCELLED_TIME; if (!subscribedToLiveUpdates && ctx.getSettings().LIVE_UPDATES_PURCHASED.get()) { - if (subscriptionCancelledTime.get() == 0) { - subscriptionCancelledTime.set(System.currentTimeMillis()); - ctx.getSettings().LIVE_UPDATES_PURCHASE_CANCELLED_FIRST_DLG_SHOWN.set(false); - ctx.getSettings().LIVE_UPDATES_PURCHASE_CANCELLED_SECOND_DLG_SHOWN.set(false); - } else if (System.currentTimeMillis() - subscriptionCancelledTime.get() > SUBSCRIPTION_HOLDING_TIME_MSEC) { - ctx.getSettings().LIVE_UPDATES_PURCHASED.set(false); - if (!isDepthContoursPurchased(ctx)) { - ctx.getSettings().getCustomRenderBooleanProperty("depthContours").set(false); - } + ctx.getSettings().LIVE_UPDATES_PURCHASED.set(false); + if (!isDepthContoursPurchased(ctx)) { + ctx.getSettings().getCustomRenderBooleanProperty("depthContours").set(false); } } else if (subscribedToLiveUpdates) { - subscriptionCancelledTime.set(0L); ctx.getSettings().LIVE_UPDATES_PURCHASED.set(true); } From 067422823e8bf9eb4cc0684c6946230f910ddd15 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 18 Mar 2021 10:43:56 +0200 Subject: [PATCH 4/7] Add src-amazon (cherry picked from commit 2910df88e1a03bb4d96c3f364e38a9669eeebf7e) --- OsmAnd/AndroidManifest-amazon.xml | 27 ++++++++ OsmAnd/build.gradle | 6 +- .../plus/inapp/InAppPurchaseHelperImpl.java | 69 +++++++++++++++++++ .../osmand/plus/inapp/InAppPurchasesImpl.java | 41 +++++++++++ 4 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 OsmAnd/AndroidManifest-amazon.xml create mode 100644 OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java create mode 100644 OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java diff --git a/OsmAnd/AndroidManifest-amazon.xml b/OsmAnd/AndroidManifest-amazon.xml new file mode 100644 index 0000000000..93e028dd17 --- /dev/null +++ b/OsmAnd/AndroidManifest-amazon.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index 3b512b1090..f757952560 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -84,11 +84,11 @@ android { manifest.srcFile "AndroidManifest-nightlyFree.xml" } amazonFree { - java.srcDirs = ["src-nogms", "src-google"] - manifest.srcFile "AndroidManifest-gplayFree.xml" + java.srcDirs = ["src-nogms", "src-amazon"] + manifest.srcFile "AndroidManifest-amazon.xml" } amazonFull { - java.srcDirs = ["src-nogms", "src-google"] + java.srcDirs = ["src-nogms", "src-amazon"] } huawei { java.srcDirs = ["src-nogms", "src-huawei"] diff --git a/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java b/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java new file mode 100644 index 0000000000..f59569ecc2 --- /dev/null +++ b/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java @@ -0,0 +1,69 @@ +package net.osmand.plus.inapp; + +import android.app.Activity; +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.plus.OsmandApplication; + +import java.lang.ref.WeakReference; + +public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { + + public InAppPurchaseHelperImpl(OsmandApplication ctx) { + super(ctx); + purchases = new InAppPurchasesImpl(ctx); + } + + @Override + public void isInAppPurchaseSupported(@NonNull Activity activity, @Nullable InAppPurchaseInitCallback callback) { + + } + + @Override + protected void execImpl(@NonNull InAppPurchaseTaskType taskType, @NonNull InAppCommand command) { + + } + + @Override + public void purchaseFullVersion(@NonNull Activity activity) throws UnsupportedOperationException { + + } + + @Override + public void purchaseDepthContours(@NonNull Activity activity) throws UnsupportedOperationException { + + } + + @Override + public void purchaseContourLines(@NonNull Activity activity) throws UnsupportedOperationException { + + } + + @Override + public void manageSubscription(@NonNull Context ctx, @Nullable String sku) { + + } + + @Override + protected InAppCommand getPurchaseLiveUpdatesCommand(WeakReference activity, String sku, String userInfo) throws UnsupportedOperationException { + return null; + } + + @Override + protected InAppCommand getRequestInventoryCommand() throws UnsupportedOperationException { + return null; + } + + @Override + protected boolean isBillingManagerExists() { + return false; + } + + @Override + protected void destroyBillingManager() { + + } +} \ No newline at end of file diff --git a/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java b/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java new file mode 100644 index 0000000000..c67c90308f --- /dev/null +++ b/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java @@ -0,0 +1,41 @@ +package net.osmand.plus.inapp; + +import net.osmand.plus.OsmandApplication; + +public class InAppPurchasesImpl extends InAppPurchases { + + private static final InAppSubscription[] LIVE_UPDATES_FREE = new InAppSubscription[] {}; + + public InAppPurchasesImpl(OsmandApplication ctx) { + super(ctx); + inAppPurchases = new InAppPurchase[] {}; + liveUpdates = new LiveUpdatesInAppPurchasesFree(); + } + + @Override + public boolean isFullVersion(String sku) { + return false; + } + + @Override + public boolean isDepthContours(String sku) { + return false; + } + + @Override + public boolean isContourLines(String sku) { + return false; + } + + @Override + public boolean isLiveUpdates(String sku) { + return false; + } + + private static class LiveUpdatesInAppPurchasesFree extends InAppSubscriptionList { + + public LiveUpdatesInAppPurchasesFree() { + super(LIVE_UPDATES_FREE); + } + } +} \ No newline at end of file From 8db153db32975dcacdca8c4f83427132a5dd5cd7 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 18 Mar 2021 11:14:57 +0200 Subject: [PATCH 5/7] Remove unnecessary changes (cherry picked from commit 67039222c5ad7cf465e785ace9b484f1acd44103) --- OsmAnd/AndroidManifest-amazon.xml | 27 ------------------- OsmAnd/build.gradle | 2 +- .../osmand/plus/inapp/InAppPurchasesImpl.java | 10 +++---- 3 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 OsmAnd/AndroidManifest-amazon.xml diff --git a/OsmAnd/AndroidManifest-amazon.xml b/OsmAnd/AndroidManifest-amazon.xml deleted file mode 100644 index 93e028dd17..0000000000 --- a/OsmAnd/AndroidManifest-amazon.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index f757952560..f6139bab8a 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -85,7 +85,7 @@ android { } amazonFree { java.srcDirs = ["src-nogms", "src-amazon"] - manifest.srcFile "AndroidManifest-amazon.xml" + manifest.srcFile "AndroidManifest-gplayFree.xml" } amazonFull { java.srcDirs = ["src-nogms", "src-amazon"] diff --git a/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java b/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java index c67c90308f..00bbea9693 100644 --- a/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java +++ b/OsmAnd/src-amazon/net/osmand/plus/inapp/InAppPurchasesImpl.java @@ -4,12 +4,10 @@ import net.osmand.plus.OsmandApplication; public class InAppPurchasesImpl extends InAppPurchases { - private static final InAppSubscription[] LIVE_UPDATES_FREE = new InAppSubscription[] {}; - public InAppPurchasesImpl(OsmandApplication ctx) { super(ctx); inAppPurchases = new InAppPurchase[] {}; - liveUpdates = new LiveUpdatesInAppPurchasesFree(); + liveUpdates = new EmptyLiveUpdatesList(); } @Override @@ -32,10 +30,10 @@ public class InAppPurchasesImpl extends InAppPurchases { return false; } - private static class LiveUpdatesInAppPurchasesFree extends InAppSubscriptionList { + private static class EmptyLiveUpdatesList extends InAppSubscriptionList { - public LiveUpdatesInAppPurchasesFree() { - super(LIVE_UPDATES_FREE); + public EmptyLiveUpdatesList() { + super(new InAppSubscription[] {}); } } } \ No newline at end of file From dce13081c162110b5841e919bf601edfefea35f3 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 18 Mar 2021 19:14:21 +0200 Subject: [PATCH 6/7] Fix compilation --- .../net/osmand/plus/inapp/InAppPurchaseHelperImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java b/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java index 9f05c1a70c..885e018ab2 100644 --- a/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java +++ b/OsmAnd/src-huawei/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java @@ -267,7 +267,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { InAppSubscription s = (InAppSubscription) inAppPurchase; try { s.setIntroductoryInfo(new InAppSubscriptionIntroductoryInfo(s, introductoryPrice, - introductoryPriceAmountMicros, introductoryPricePeriod, introductoryPriceCycles)); + introductoryPriceAmountMicros, introductoryPricePeriod, String.valueOf(introductoryPriceCycles))); } catch (ParseException e) { LOG.error(e); } From 44f45f4b6638a80a0aee752ce9fc5cfe7c641187 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 19 Mar 2021 08:58:01 +0200 Subject: [PATCH 7/7] Open market for free amazon version --- OsmAnd/src/net/osmand/plus/Version.java | 2 +- .../plus/activities/PluginInfoFragment.java | 3 +- .../chooseplan/ChoosePlanDialogFragment.java | 85 ++++++++----------- .../plus/chooseplan/OsmLiveGoneDialog.java | 3 +- .../plus/dashboard/DashPluginsFragment.java | 3 +- .../plus/download/DownloadActivity.java | 9 +- .../plus/download/ui/ItemViewHolder.java | 7 +- .../download/ui/UpdatesIndexFragment.java | 3 +- .../osmand/plus/helpers/DiscountHelper.java | 15 ++-- .../plus/liveupdates/LiveUpdatesFragment.java | 5 +- .../plus/liveupdates/OsmLiveActivity.java | 3 +- .../plus/search/QuickSearchListAdapter.java | 12 +-- .../plus/srtmplugin/ContourLinesMenu.java | 4 +- .../WikipediaArticleWikiLinkFragment.java | 3 +- .../explore/ExploreTabFragment.java | 5 +- 15 files changed, 79 insertions(+), 83 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/Version.java b/OsmAnd/src/net/osmand/plus/Version.java index 1ad99c96e8..1d5d5088d7 100644 --- a/OsmAnd/src/net/osmand/plus/Version.java +++ b/OsmAnd/src/net/osmand/plus/Version.java @@ -23,7 +23,7 @@ public class Version { return getBuildFlavor().contains("huawei"); } - private static boolean isAmazon() { + public static boolean isAmazon() { return getBuildFlavor().contains("amazon"); } diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java b/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java index 7deb85768c..5fdf2eab46 100644 --- a/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java @@ -31,6 +31,7 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.dialogs.PluginInstalledBottomSheetDialog.PluginStateListener; import net.osmand.plus.settings.fragments.BaseSettingsFragment; import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType; @@ -168,7 +169,7 @@ public class PluginInfoFragment extends BaseOsmAndFragment implements PluginStat if (plugin instanceof SRTMPlugin) { FragmentManager fragmentManager = getActivity().getSupportFragmentManager(); if (fragmentManager != null) { - ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(fragmentManager); + ChoosePlanDialogFragment.showDialogInstance(app, fragmentManager, ChoosePlanDialogType.HILLSHADE_SRTM_PLUGIN); } } else { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL()))); diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java index 256a845dc7..543d7a9c46 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java @@ -5,6 +5,8 @@ import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.text.TextUtils; @@ -27,6 +29,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatImageView; import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; @@ -34,7 +37,6 @@ import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.Version; @@ -48,6 +50,7 @@ import net.osmand.plus.inapp.InAppPurchases.InAppPurchase; import net.osmand.plus.inapp.InAppPurchases.InAppSubscription; import net.osmand.plus.inapp.InAppPurchases.InAppSubscriptionIntroductoryInfo; import net.osmand.plus.liveupdates.SubscriptionFragment; +import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.widgets.TextViewEx; import net.osmand.util.Algorithms; @@ -709,57 +712,41 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment } } - public static void showFreeVersionInstance(@NonNull FragmentManager fm) { - try { - ChoosePlanFreeBannerDialogFragment fragment = new ChoosePlanFreeBannerDialogFragment(); - fragment.show(fm, ChoosePlanFreeBannerDialogFragment.TAG); - } catch (RuntimeException e) { - LOG.error("showFreeVersionInstance", e); + public enum ChoosePlanDialogType { + + FREE_VERSION("showFreeVersionInstance", ChoosePlanFreeBannerDialogFragment.TAG, ChoosePlanFreeBannerDialogFragment.class), + WIKIPEDIA("showWikipediaInstance", ChoosePlanWikipediaDialogFragment.TAG, ChoosePlanWikipediaDialogFragment.class), + WIKIVOYAGE("showWikivoyageInstance", ChoosePlanWikivoyageDialogFragment.TAG, ChoosePlanWikivoyageDialogFragment.class), + SEA_DEPTH_MAPS("showSeaDepthMapsInstance", ChoosePlanSeaDepthMapsDialogFragment.TAG, ChoosePlanSeaDepthMapsDialogFragment.class), + HILLSHADE_SRTM_PLUGIN("showHillshadeSrtmPluginInstance", ChoosePlanHillshadeSrtmDialogFragment.TAG, ChoosePlanHillshadeSrtmDialogFragment.class), + OSM_LIVE("showOsmLiveInstance", ChoosePlanOsmLiveBannerDialogFragment.TAG, ChoosePlanOsmLiveBannerDialogFragment.class); + + private final String tag; + private final String errorName; + private final Class fragmentClass; + + ChoosePlanDialogType(String errorName, String tag, Class fragmentClass) { + this.tag = tag; + this.errorName = errorName; + this.fragmentClass = fragmentClass; } } - public static void showWikipediaInstance(@NonNull FragmentManager fm) { - try { - ChoosePlanWikipediaDialogFragment fragment = new ChoosePlanWikipediaDialogFragment(); - fragment.show(fm, ChoosePlanWikipediaDialogFragment.TAG); - } catch (RuntimeException e) { - LOG.error("showWikipediaInstance", e); - } - } - - public static void showWikivoyageInstance(@NonNull FragmentManager fm) { - try { - ChoosePlanWikivoyageDialogFragment fragment = new ChoosePlanWikivoyageDialogFragment(); - fragment.show(fm, ChoosePlanWikivoyageDialogFragment.TAG); - } catch (RuntimeException e) { - LOG.error("showWikivoyageInstance", e); - } - } - - public static void showSeaDepthMapsInstance(@NonNull FragmentManager fm) { - try { - ChoosePlanSeaDepthMapsDialogFragment fragment = new ChoosePlanSeaDepthMapsDialogFragment(); - fragment.show(fm, ChoosePlanSeaDepthMapsDialogFragment.TAG); - } catch (RuntimeException e) { - LOG.error("showSeaDepthMapsInstance", e); - } - } - - public static void showHillshadeSrtmPluginInstance(@NonNull FragmentManager fm) { - try { - ChoosePlanHillshadeSrtmDialogFragment fragment = new ChoosePlanHillshadeSrtmDialogFragment(); - fragment.show(fm, ChoosePlanHillshadeSrtmDialogFragment.TAG); - } catch (RuntimeException e) { - LOG.error("showHillshadeSrtmPluginInstance", e); - } - } - - public static void showOsmLiveInstance(@NonNull FragmentManager fm) { - try { - ChoosePlanOsmLiveBannerDialogFragment fragment = new ChoosePlanOsmLiveBannerDialogFragment(); - fragment.show(fm, ChoosePlanOsmLiveBannerDialogFragment.TAG); - } catch (RuntimeException e) { - LOG.error("showOsmLiveInstance", e); + public static void showDialogInstance(@NonNull OsmandApplication app, @NonNull FragmentManager manager, + @NonNull ChoosePlanDialogType dialogType) { + if (Version.isAmazon() && !Version.isPaidVersion(app)) { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.getUrlWithUtmRef(app, "net.osmand.plus"))); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + if (AndroidUtils.isIntentSafe(app, intent)) { + app.startActivity(intent); + } + } else { + try { + ChoosePlanDialogFragment fragment = (ChoosePlanDialogFragment) Fragment.instantiate(app, dialogType.fragmentClass.getName()); + fragment.show(manager, dialogType.tag); + } catch (RuntimeException e) { + LOG.error(dialogType.errorName, e); + } } } } diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveGoneDialog.java b/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveGoneDialog.java index fdbce9a076..a4dba21024 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveGoneDialog.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveGoneDialog.java @@ -28,6 +28,7 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.BaseOsmAndDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.OsmAndFeature; import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchases.InAppSubscription; @@ -235,7 +236,7 @@ public abstract class OsmLiveGoneDialog extends BaseOsmAndDialogFragment { dismiss(); FragmentActivity activity = getActivity(); if (activity != null) { - ChoosePlanDialogFragment.showOsmLiveInstance(activity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(app, activity.getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); } } }); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java index 15d222a980..58d8302f63 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java @@ -21,6 +21,7 @@ import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.activities.PluginsFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.dashboard.tools.DashFragmentData; import net.osmand.plus.development.OsmandDevelopmentPlugin; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; @@ -55,7 +56,7 @@ public class DashPluginsFragment extends DashBaseFragment { if (plugin instanceof SRTMPlugin) { FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null) { - ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(fragmentManager); + ChoosePlanDialogFragment.showDialogInstance(getMyApplication(), fragmentManager, ChoosePlanDialogType.HILLSHADE_SRTM_PLUGIN); } } else { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL()))); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index ebbd7d4e3b..ed45d50e84 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -22,8 +22,6 @@ import android.widget.ProgressBar; import android.widget.Space; import android.widget.TextView; -import com.ibm.icu.impl.IllegalIcuArgumentException; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; @@ -35,6 +33,8 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.viewpager.widget.ViewPager; +import com.ibm.icu.impl.IllegalIcuArgumentException; + import net.osmand.AndroidUtils; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; @@ -52,7 +52,9 @@ import net.osmand.plus.activities.TabActivity; import net.osmand.plus.base.BasicProgressAsyncTask; import net.osmand.plus.base.BottomSheetDialogFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; +import net.osmand.plus.download.ReloadIndexesTask.ReloadIndexesListener; import net.osmand.plus.download.ui.ActiveDownloadsDialogFragment; import net.osmand.plus.download.ui.DownloadResourceGroupFragment; import net.osmand.plus.download.ui.LocalIndexesFragment; @@ -63,7 +65,6 @@ import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; import net.osmand.plus.settings.backend.OsmandSettings; -import net.osmand.plus.download.ReloadIndexesTask.ReloadIndexesListener; import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.util.Algorithms; @@ -407,7 +408,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo collapseBanner(); } else { ctx.getMyApplication().logEvent("click_free_dialog"); - ChoosePlanDialogFragment.showFreeVersionInstance(ctx.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(ctx.getMyApplication(), ctx.getSupportFragmentManager(), ChoosePlanDialogType.FREE_VERSION); } } }; diff --git a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java index 7a8deaf506..a24e2c5b2a 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java @@ -32,6 +32,7 @@ import net.osmand.plus.activities.LocalIndexInfo; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.PluginsFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.download.CityItem; import net.osmand.plus.download.CustomIndexItem; import net.osmand.plus.download.DownloadItem; @@ -353,10 +354,10 @@ public class ItemViewHolder { switch (clickAction) { case ASK_FOR_FULL_VERSION_PURCHASE: context.getMyApplication().logEvent("in_app_purchase_show_from_wiki_context_menu"); - ChoosePlanDialogFragment.showWikipediaInstance(context.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(context.getMyApplication(), context.getSupportFragmentManager(), ChoosePlanDialogType.WIKIPEDIA); break; case ASK_FOR_DEPTH_CONTOURS_PURCHASE: - ChoosePlanDialogFragment.showSeaDepthMapsInstance(context.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(context.getMyApplication(), context.getSupportFragmentManager(), ChoosePlanDialogType.SEA_DEPTH_MAPS); break; case ASK_FOR_SEAMARKS_PLUGIN: showPluginsScreen(); @@ -364,7 +365,7 @@ public class ItemViewHolder { context.getString(R.string.activate_seamarks_plugin), Toast.LENGTH_SHORT).show(); break; case ASK_FOR_SRTM_PLUGIN_PURCHASE: - ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(context.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(context.getMyApplication(), context.getSupportFragmentManager(), ChoosePlanDialogType.HILLSHADE_SRTM_PLUGIN); break; case ASK_FOR_SRTM_PLUGIN_ENABLE: showPluginsScreen(); diff --git a/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java index faf39a56f7..f12639a805 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java @@ -24,6 +24,7 @@ import net.osmand.Collator; import net.osmand.OsmAndCollator; import net.osmand.map.OsmandRegions; import net.osmand.plus.OsmandApplication; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.base.OsmAndListFragment; @@ -190,7 +191,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download if (listAdapter.isShowOsmLiveBanner() && position == 0) { DownloadActivity activity = getMyActivity(); if (activity != null) { - ChoosePlanDialogFragment.showOsmLiveInstance(activity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(activity.getMyApplication(), activity.getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); } } else { final IndexItem e = (IndexItem) getListAdapter().getItem(position); diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java index a4bb6ec74f..c91655dafc 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java @@ -28,6 +28,7 @@ import net.osmand.osm.PoiType; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.activities.OsmandInAppPurchaseActivity; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.Version; @@ -322,7 +323,7 @@ public class DiscountHelper { } else { for (InAppPurchase p : purchaseHelper.getLiveUpdates().getAllSubscriptions()) { if (url.contains(p.getSku())) { - ChoosePlanDialogFragment.showOsmLiveInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(app, mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); break; } } @@ -367,17 +368,17 @@ public class DiscountHelper { } else if (url.startsWith(SHOW_CHOOSE_PLAN_PREFIX)) { String planType = url.substring(SHOW_CHOOSE_PLAN_PREFIX.length()).trim(); if (CHOOSE_PLAN_TYPE_FREE.equals(planType)) { - ChoosePlanDialogFragment.showFreeVersionInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.FREE_VERSION); } else if (CHOOSE_PLAN_TYPE_LIVE.equals(planType)) { - ChoosePlanDialogFragment.showOsmLiveInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); } else if (CHOOSE_PLAN_TYPE_SEA_DEPTH.equals(planType)) { - ChoosePlanDialogFragment.showSeaDepthMapsInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.SEA_DEPTH_MAPS); } else if (CHOOSE_PLAN_TYPE_HILLSHADE.equals(planType)) { - ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.HILLSHADE_SRTM_PLUGIN); } else if (CHOOSE_PLAN_TYPE_WIKIPEDIA.equals(planType)) { - ChoosePlanDialogFragment.showWikipediaInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.WIKIPEDIA); } else if (CHOOSE_PLAN_TYPE_WIKIVOYAGE.equals(planType)) { - ChoosePlanDialogFragment.showWikivoyageInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.WIKIVOYAGE); } } else { Intent intent = new Intent(Intent.ACTION_VIEW); diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index c503162910..eb8e2abff4 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -35,6 +35,7 @@ import androidx.fragment.app.FragmentManager; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import net.osmand.plus.OsmandApplication; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.settings.backend.CommonPreference; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; @@ -213,7 +214,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc subscriptionsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - ChoosePlanDialogFragment.showOsmLiveInstance(getActivity().getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(app, getActivity().getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); } }); if (isDonationSupported()) { @@ -249,7 +250,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc public void onClick(View v) { FragmentActivity activity = getActivity(); if (activity != null) { - ChoosePlanDialogFragment.showOsmLiveInstance(activity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(app, activity.getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); } } }); diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java b/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java index 6014ebbc88..f6df0d3690 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java @@ -22,6 +22,7 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogListener; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.download.AbstractDownloadActivity; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.inapp.InAppPurchaseHelper; @@ -95,7 +96,7 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa protected void onResume() { super.onResume(); if (!InAppPurchaseHelper.isSubscribedToLiveUpdates(getMyApplication()) && showSettingOnly) { - ChoosePlanDialogFragment.showOsmLiveInstance(getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(getMyApplication(), getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE); } } diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java index 9251e555b0..d8ab361a82 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java @@ -10,12 +10,9 @@ import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.ListView; import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.view.ContextThemeWrapper; import androidx.core.content.ContextCompat; import androidx.core.view.ViewCompat; @@ -32,9 +29,9 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities.UpdateLocationViewCache; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; -import net.osmand.plus.search.listitems.QuickSearchBannerListItem; -import net.osmand.plus.search.listitems.QuickSearchFreeBannerListItem; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.mapcontextmenu.MenuController; +import net.osmand.plus.search.listitems.QuickSearchBannerListItem; import net.osmand.plus.search.listitems.QuickSearchHeaderListItem; import net.osmand.plus.search.listitems.QuickSearchListItem; import net.osmand.plus.search.listitems.QuickSearchListItemType; @@ -50,9 +47,9 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; +import static net.osmand.plus.search.listitems.QuickSearchBannerListItem.ButtonItem; import static net.osmand.plus.search.listitems.QuickSearchBannerListItem.INVALID_ID; import static net.osmand.search.core.ObjectType.POI_TYPE; -import static net.osmand.plus.search.listitems.QuickSearchBannerListItem.ButtonItem; public class QuickSearchListAdapter extends ArrayAdapter { @@ -265,8 +262,7 @@ public class QuickSearchListAdapter extends ArrayAdapter { btnGet.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - ChoosePlanDialogFragment.showWikipediaInstance( - activity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(app, activity.getSupportFragmentManager(), ChoosePlanDialogType.WIKIPEDIA); } }); } diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java b/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java index 86abdee880..ed3d781745 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java @@ -8,6 +8,7 @@ import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuItem; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.settings.backend.CommonPreference; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; @@ -139,7 +140,8 @@ public class ContourLinesMenu { } }); } else if (itemId == R.string.srtm_plugin_name) { - ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(mapActivity.getSupportFragmentManager()); + ChoosePlanDialogFragment.showDialogInstance(mapActivity.getMyApplication(), + mapActivity.getSupportFragmentManager(), ChoosePlanDialogType.HILLSHADE_SRTM_PLUGIN); closeDashboard(mapActivity); } else if (contourWidthProp != null && itemId == contourWidthName.hashCode()) { plugin.selectPropertyValue(mapActivity, contourWidthProp, widthPref, new Runnable() { diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java index 1c34b823ab..df66f651df 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java @@ -16,6 +16,7 @@ import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleDividerItem; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.wikivoyage.article.WikivoyageArticleWikiLinkFragment; @@ -78,7 +79,7 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm public void onClick(View v) { FragmentManager fm = getFragmentManager(); if (fm != null) { - ChoosePlanDialogFragment.showWikivoyageInstance(fm); + ChoosePlanDialogFragment.showDialogInstance(getMyApplication(), fm, ChoosePlanDialogType.WIKIVOYAGE); } dismiss(); } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index 396da70e43..80b3c50da4 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.R; import net.osmand.plus.Version; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment.ChoosePlanDialogType; import net.osmand.plus.download.DownloadActivityType; import net.osmand.plus.download.DownloadIndexesThread; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; @@ -300,7 +301,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv || item.getType() == DownloadActivityType.TRAVEL_FILE) && !Version.isPaidVersion(app)) { FragmentManager fm = getFragmentManager(); if (fm != null) { - ChoosePlanDialogFragment.showWikipediaInstance(fm); + ChoosePlanDialogFragment.showDialogInstance(app, fm, ChoosePlanDialogType.WIKIPEDIA); } } else { DownloadIndexesThread downloadThread = app.getDownloadThread(); @@ -356,7 +357,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv || item.getType() == DownloadActivityType.TRAVEL_FILE) && !Version.isPaidVersion(app)) { FragmentManager fm = getFragmentManager(); if (fm != null) { - ChoosePlanDialogFragment.showWikipediaInstance(fm); + ChoosePlanDialogFragment.showDialogInstance(app, fm, ChoosePlanDialogType.WIKIPEDIA); } } else { DownloadIndexesThread downloadThread = app.getDownloadThread();