diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 980ba16c00..3dc7b3af65 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -82,7 +82,6 @@ import net.osmand.plus.dashboard.DashboardOnMap; import net.osmand.plus.dialogs.ErrorBottomSheetDialog; import net.osmand.plus.dialogs.RateUsBottomSheetDialog; import net.osmand.plus.dialogs.WhatsNewDialogFragment; -import net.osmand.plus.dialogs.XMasDialogFragment; import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.ui.DataStoragePlaceDialogFragment; @@ -96,7 +95,6 @@ import net.osmand.plus.helpers.ImportHelper.ImportGpxBottomSheetDialogFragment; import net.osmand.plus.helpers.WakeLockHelper; import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment; import net.osmand.plus.mapcontextmenu.MapContextMenu; -import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController.MenuState; import net.osmand.plus.mapcontextmenu.builders.cards.dialogs.ContextMenuCardDialogFragment; import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu; @@ -808,13 +806,8 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven getSupportFragmentManager().beginTransaction() .add(R.id.fragmentContainer, new FirstUsageWelcomeFragment(), FirstUsageWelcomeFragment.TAG).commitAllowingStateLoss(); - } else if (!isFirstScreenShowing()) { - if (XMasDialogFragment.shouldShowXmasDialog(app)) { - SecondSplashScreenFragment.SHOW = false; - new XMasDialogFragment().show(getSupportFragmentManager(), XMasDialogFragment.TAG); - } else if (OsmLiveCancelledDialog.shouldShowDialog(app)) { - OsmLiveCancelledDialog.showInstance(getSupportFragmentManager()); - } + } else if (!isFirstScreenShowing() && OsmLiveCancelledDialog.shouldShowDialog(app)) { + OsmLiveCancelledDialog.showInstance(getSupportFragmentManager()); } FirstUsageWelcomeFragment.SHOW = false; diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java index d9ff47628c..4a1a3a0f90 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java @@ -21,6 +21,7 @@ import net.osmand.plus.R; import net.osmand.plus.Version; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.dialogs.XMasDialogFragment; import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarControllerType; @@ -106,6 +107,7 @@ public class DiscountHelper { double showDayFrequency = obj.getDouble("show_day_frequency"); int maxTotalShow = obj.getInt("max_total_show"); JSONObject application = obj.getJSONObject("application"); + boolean showChristmasDialog = obj.optBoolean("show_christmas_dialog", false); if (data.url.startsWith(INAPP_PREFIX) && data.url.length() > INAPP_PREFIX.length()) { String inAppSku = data.url.substring(INAPP_PREFIX.length()); @@ -136,7 +138,11 @@ public class DiscountHelper { settings.DISCOUNT_TOTAL_SHOW.set(settings.DISCOUNT_TOTAL_SHOW.get() + 1); settings.DISCOUNT_SHOW_NUMBER_OF_STARTS.set(app.getAppInitializer().getNumberOfStarts()); settings.DISCOUNT_SHOW_DATETIME_MS.set(System.currentTimeMillis()); - showDiscountBanner(mapActivity, data); + if (showChristmasDialog) { + new XMasDialogFragment().show(mapActivity.getSupportFragmentManager(), XMasDialogFragment.TAG); + } else { + showDiscountBanner(mapActivity, data); + } } } }