Show old rate dialog if not google play installed

This commit is contained in:
cepprice 2021-02-25 13:59:35 +05:00
parent 16593e1a34
commit e084416ce1

View file

@ -11,6 +11,7 @@ import com.google.android.play.core.tasks.Task;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.Version; import net.osmand.plus.Version;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dialogs.RateUsBottomSheetDialogFragment; import net.osmand.plus.dialogs.RateUsBottomSheetDialogFragment;
import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.settings.backend.OsmandSettings;
@ -81,12 +82,12 @@ public class RateUsHelper {
return false; return false;
} }
public static void showRateDialog(FragmentActivity activity) { public static void showRateDialog(MapActivity mapActivity) {
boolean inAppReviewSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; boolean inAppReviewSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
if (inAppReviewSupported) { if (inAppReviewSupported && Version.isGooglePlayInstalled(mapActivity.getMyApplication())) {
showInAppRateDialog(activity); showInAppRateDialog(mapActivity);
} else { } else {
RateUsBottomSheetDialogFragment.showInstance(activity.getSupportFragmentManager()); RateUsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager());
} }
} }