From 4ca665e8abd167c7f8f8e74c5995b5acb1c44190 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 1 Oct 2012 16:43:57 -0700 Subject: [PATCH] Billing activity should finish after dialog if billing not available, various robustness improvements to UpdateMessageService --- astrid/src/com/todoroo/astrid/billing/BillingActivity.java | 7 ++++++- .../com/todoroo/astrid/service/UpdateMessageService.java | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java index de9bafa82..cf5854df3 100644 --- a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java +++ b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java @@ -258,7 +258,12 @@ public class BillingActivity extends FragmentActivity { .setIcon(android.R.drawable.stat_sys_warning) .setMessage(messageId) .setCancelable(false) - .setPositiveButton(android.R.string.ok, null) + .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }) .setNegativeButton(R.string.subscriptions_learn_more, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java b/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java index 068f3cd85..fecf03cbf 100644 --- a/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java +++ b/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java @@ -119,6 +119,7 @@ public class UpdateMessageService { textView.setTextSize(16); textView.setTextColor(activity.getResources().getColor(ThemeService.getDialogTextColor())); textView.setMovementMethod(LinkMovementMethod.getInstance()); + textView.setPadding(10, 0, 10, 0); ds = new DialogShower() { @Override public void showDialog(Activity a) { @@ -238,7 +239,9 @@ public class UpdateMessageService { return null; final ArrayList screenList = new ArrayList(); for (int i = 0; i < screens.length(); i++) { - screenList.add(screens.getString(i)); + String screen = screens.getString(i).trim(); + if (!TextUtils.isEmpty(screen)) + screenList.add(screen); } return new ClickableSpan() { @Override