Merge branch 'r3.9'
# Conflicts: # OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java # OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java
This commit is contained in:
commit
83fe5fa0d8
15 changed files with 78 additions and 77 deletions
|
@ -23,7 +23,7 @@ public class Version {
|
|||
return getBuildFlavor().contains("huawei");
|
||||
}
|
||||
|
||||
private static boolean isAmazon() {
|
||||
public static boolean isAmazon() {
|
||||
return getBuildFlavor().contains("amazon");
|
||||
}
|
||||
|
||||
|
|
|
@ -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())));
|
||||
|
|
|
@ -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<? extends ChoosePlanDialogFragment> fragmentClass;
|
||||
|
||||
ChoosePlanDialogType(String errorName, String tag, Class<? extends ChoosePlanDialogFragment> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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())));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -42,6 +42,7 @@ import net.osmand.plus.liveupdates.LiveUpdatesClearDialogFragment.RefreshLiveUpd
|
|||
import net.osmand.plus.liveupdates.LiveUpdatesFragmentNew;
|
||||
import net.osmand.plus.liveupdates.LoadLiveMapsTask;
|
||||
import net.osmand.plus.liveupdates.LoadLiveMapsTask.LocalIndexInfoAdapter;
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -32,6 +32,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;
|
||||
|
@ -210,7 +211,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()) {
|
||||
|
@ -246,7 +247,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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,6 +19,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.inapp.InAppPurchaseHelper;
|
||||
|
||||
|
@ -79,7 +80,7 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements ChooseP
|
|||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (!InAppPurchaseHelper.isSubscribedToLiveUpdates(getMyApplication()) && showSettingOnly) {
|
||||
ChoosePlanDialogFragment.showOsmLiveInstance(getSupportFragmentManager());
|
||||
ChoosePlanDialogFragment.showDialogInstance(getMyApplication(), getSupportFragmentManager(), ChoosePlanDialogType.OSM_LIVE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@ import net.osmand.plus.chooseplan.ChoosePlanDialogFragment;
|
|||
import net.osmand.plus.helpers.GpxUiHelper;
|
||||
import net.osmand.plus.helpers.GpxUiHelper.GPXInfo;
|
||||
import net.osmand.plus.search.listitems.QuickSearchBannerListItem;
|
||||
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;
|
||||
|
@ -51,9 +53,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<QuickSearchListItem> {
|
||||
|
||||
|
@ -286,8 +288,7 @@ public class QuickSearchListAdapter extends ArrayAdapter<QuickSearchListItem> {
|
|||
btnGet.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ChoosePlanDialogFragment.showWikipediaInstance(
|
||||
activity.getSupportFragmentManager());
|
||||
ChoosePlanDialogFragment.showDialogInstance(app, activity.getSupportFragmentManager(), ChoosePlanDialogType.WIKIPEDIA);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue