Dismiss splash screen before showing Christmas dialog

This commit is contained in:
Alex Sytnyk 2018-10-22 18:34:33 +03:00
parent a9cf25ad64
commit 04ca2ba789
2 changed files with 7 additions and 2 deletions

View file

@ -82,6 +82,7 @@ import net.osmand.plus.dashboard.DashboardOnMap;
import net.osmand.plus.dialogs.ErrorBottomSheetDialog; import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
import net.osmand.plus.dialogs.RateUsBottomSheetDialog; import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
import net.osmand.plus.dialogs.WhatsNewDialogFragment; import net.osmand.plus.dialogs.WhatsNewDialogFragment;
import net.osmand.plus.dialogs.XMasDialogFragment;
import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
import net.osmand.plus.download.ui.DataStoragePlaceDialogFragment; import net.osmand.plus.download.ui.DataStoragePlaceDialogFragment;
@ -890,6 +891,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return true; return true;
} }
public void showXMasDialog() {
dismissSecondSplashScreen();
new XMasDialogFragment().show(getSupportFragmentManager(), XMasDialogFragment.TAG);
}
private void dismissSecondSplashScreen() { private void dismissSecondSplashScreen() {
if (SecondSplashScreenFragment.VISIBLE) { if (SecondSplashScreenFragment.VISIBLE) {
SecondSplashScreenFragment.VISIBLE = false; SecondSplashScreenFragment.VISIBLE = false;

View file

@ -25,7 +25,6 @@ import net.osmand.plus.R;
import net.osmand.plus.Version; import net.osmand.plus.Version;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; import net.osmand.plus.chooseplan.ChoosePlanDialogFragment;
import net.osmand.plus.dialogs.XMasDialogFragment;
import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.poi.PoiFiltersHelper; import net.osmand.plus.poi.PoiFiltersHelper;
import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.poi.PoiUIFilter;
@ -151,7 +150,7 @@ public class DiscountHelper {
settings.DISCOUNT_SHOW_NUMBER_OF_STARTS.set(app.getAppInitializer().getNumberOfStarts()); settings.DISCOUNT_SHOW_NUMBER_OF_STARTS.set(app.getAppInitializer().getNumberOfStarts());
settings.DISCOUNT_SHOW_DATETIME_MS.set(System.currentTimeMillis()); settings.DISCOUNT_SHOW_DATETIME_MS.set(System.currentTimeMillis());
if (showChristmasDialog) { if (showChristmasDialog) {
new XMasDialogFragment().show(mapActivity.getSupportFragmentManager(), XMasDialogFragment.TAG); mapActivity.showXMasDialog();
} else { } else {
showDiscountBanner(mapActivity, data); showDiscountBanner(mapActivity, data);
} }