Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
357e387cb7
2 changed files with 30 additions and 43 deletions
|
@ -1,6 +1,5 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
import android.content.ActivityNotFoundException;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -84,17 +83,12 @@ public class DashRateUsFragment extends DashBaseFragment {
|
||||||
positiveButton.setText(getResources().getString(R.string.shared_string_ok));
|
positiveButton.setText(getResources().getString(R.string.shared_string_ok));
|
||||||
negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
|
negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
|
||||||
return;
|
return;
|
||||||
|
<<<<<<< HEAD
|
||||||
case USER_LIKES_APP:
|
case USER_LIKES_APP:
|
||||||
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
|
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
|
||||||
Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
|
Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
|
||||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
try {
|
|
||||||
startActivity(goToMarket);
|
startActivity(goToMarket);
|
||||||
} catch (ActivityNotFoundException e) {
|
|
||||||
startActivity(new Intent(Intent.ACTION_VIEW,
|
|
||||||
|
|
||||||
Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName())));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case USER_DISLIKES_APP:
|
case USER_DISLIKES_APP:
|
||||||
String email = getString(R.string.support_email);
|
String email = getString(R.string.support_email);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.osmand.plus.dialogs;
|
package net.osmand.plus.dialogs;
|
||||||
|
|
||||||
import android.content.ActivityNotFoundException;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -10,6 +9,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
@ -35,11 +35,11 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldShow(OsmandApplication app) {
|
public static boolean shouldShow(OsmandApplication application) {
|
||||||
if(!Version.isMarketEnabled(app)) {
|
if (Version.isMarketEnabled(application)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
OsmandSettings settings = app.getSettings();
|
OsmandSettings settings = application.getSettings();
|
||||||
if(!settings.LAST_DISPLAY_TIME.isSet()) {
|
if(!settings.LAST_DISPLAY_TIME.isSet()) {
|
||||||
settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
|
settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
@ -115,16 +115,9 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
return;
|
return;
|
||||||
case USER_LIKES_APP:
|
case USER_LIKES_APP:
|
||||||
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
|
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
|
||||||
// Assuming GooglePlay
|
Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
|
||||||
Uri uri = Uri.parse("market://details?id=" + getActivity().getPackageName());
|
|
||||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
try {
|
|
||||||
startActivity(goToMarket);
|
startActivity(goToMarket);
|
||||||
} catch (ActivityNotFoundException e) {
|
|
||||||
startActivity(new Intent(Intent.ACTION_VIEW,
|
|
||||||
Uri.parse("http://play.google.com/store/apps/details?id="
|
|
||||||
+ getActivity().getPackageName())));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case USER_DISLIKES_APP:
|
case USER_DISLIKES_APP:
|
||||||
String email = getString(R.string.support_email);
|
String email = getString(R.string.support_email);
|
||||||
|
|
Loading…
Reference in a new issue