Add the ability to show christmas dialog instead of notification
This commit is contained in:
parent
33c81b34dd
commit
42d94c5dd5
2 changed files with 9 additions and 10 deletions
|
@ -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,14 +806,9 @@ 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)) {
|
||||
} else if (!isFirstScreenShowing() && OsmLiveCancelledDialog.shouldShowDialog(app)) {
|
||||
OsmLiveCancelledDialog.showInstance(getSupportFragmentManager());
|
||||
}
|
||||
}
|
||||
FirstUsageWelcomeFragment.SHOW = false;
|
||||
|
||||
if (SecondSplashScreenFragment.SHOW) {
|
||||
|
|
|
@ -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,10 +138,14 @@ 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());
|
||||
if (showChristmasDialog) {
|
||||
new XMasDialogFragment().show(mapActivity.getSupportFragmentManager(), XMasDialogFragment.TAG);
|
||||
} else {
|
||||
showDiscountBanner(mapActivity, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logError("JSON parsing error: ", e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue