Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-11-30 22:39:16 +01:00
commit 357e387cb7
2 changed files with 30 additions and 43 deletions

View file

@ -1,6 +1,5 @@
package net.osmand.plus.dashboard;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@ -84,17 +83,12 @@ public class DashRateUsFragment extends DashBaseFragment {
positiveButton.setText(getResources().getString(R.string.shared_string_ok));
negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
return;
<<<<<<< HEAD
case USER_LIKES_APP:
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName())));
}
break;
case USER_DISLIKES_APP:
String email = getString(R.string.support_email);

View file

@ -1,6 +1,5 @@
package net.osmand.plus.dialogs;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@ -10,6 +9,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
@ -35,11 +35,11 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
return view;
}
public static boolean shouldShow(OsmandApplication app) {
if(!Version.isMarketEnabled(app)) {
public static boolean shouldShow(OsmandApplication application) {
if (Version.isMarketEnabled(application)) {
return false;
}
OsmandSettings settings = app.getSettings();
OsmandSettings settings = application.getSettings();
if(!settings.LAST_DISPLAY_TIME.isSet()) {
settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
}
@ -115,16 +115,9 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
return;
case USER_LIKES_APP:
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
// Assuming GooglePlay
Uri uri = Uri.parse("market://details?id=" + getActivity().getPackageName());
Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id="
+ getActivity().getPackageName())));
}
break;
case USER_DISLIKES_APP:
String email = getString(R.string.support_email);