|
|
|
@ -10,21 +10,25 @@ import com.todoroo.astrid.activity.AstridActivity;
|
|
|
|
|
|
|
|
|
|
public class FeedbackPromptDialogs {
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("nls")
|
|
|
|
|
public static void showFeedbackDialog(final AstridActivity activity, boolean positive) {
|
|
|
|
|
final AstridDialog d = new AstridDialog(activity, false);
|
|
|
|
|
|
|
|
|
|
int titleRes = positive ? R.string.feedback_positive_title : R.string.feedback_negative_title;
|
|
|
|
|
int bodyRes = positive ? R.string.feedback_positive_body : R.string.feedback_negative_body;
|
|
|
|
|
int buttonRes = positive ? R.string.feedback_positive_button : R.string.feedback_negative_button;
|
|
|
|
|
|
|
|
|
|
final String url = positive ? "https://play.google.com/store/apps/details?id=com.timsu.astrid&write_review=true" : "http://weloveastrid.com/problem_astrid_android.html";
|
|
|
|
|
|
|
|
|
|
d.setAstridTitle(titleRes)
|
|
|
|
|
.setAstridText(bodyRes)
|
|
|
|
|
.setButtonText(R.string.feedback_button, 0)
|
|
|
|
|
.setButtonText(buttonRes, 0)
|
|
|
|
|
.setButtonText(R.string.feedback_not_now, 1)
|
|
|
|
|
.setButtonListeners(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(Intent.ACTION_VIEW,
|
|
|
|
|
Uri.parse("https://play.google.com/store/apps/details?id=com.timsu.astrid&write_review=true")); //$NON-NLS-1$
|
|
|
|
|
Uri.parse(url));
|
|
|
|
|
try {
|
|
|
|
|
activity.startActivity(intent);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|