From cf68f97aa4179d39f73ca51f2266015b812ee378 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 30 Apr 2012 21:09:00 -0700 Subject: [PATCH] Random strings for missed call dialog --- .../todoroo/astrid/calls/MissedCallActivity.java | 12 +++++------- .../todoroo/astrid/reminders/Notifications.java | 2 +- astrid/res/layout/astrid_missed_call_view.xml | 10 +++++----- astrid/res/values/strings-core.xml | 15 +++++++++------ 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java b/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java index d3120c5b6..784ed6c47 100644 --- a/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java @@ -26,6 +26,7 @@ import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.reminders.NotificationFragment.SnoozeDialog; +import com.todoroo.astrid.reminders.Notifications; import com.todoroo.astrid.reminders.SnoozeCallback; import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.ThemeService; @@ -131,16 +132,13 @@ public class MissedCallActivity extends Activity { addListeners(); - String dialog; - if (TextUtils.isEmpty(name)) { - dialog = getString(R.string.MCA_dialog_without_name, number); + if (!Preferences.getBoolean(R.string.p_rmd_nagging, true)) { + findViewById(R.id.missed_calls_speech_bubble).setVisibility(View.GONE); } else { - dialog = getString(R.string.MCA_dialog_with_name, name); + TextView dialogView = (TextView) findViewById(R.id.reminder_message); + dialogView.setText(Notifications.getRandomReminder(getResources().getStringArray(R.array.MCA_dialog_speech_options))); } - - TextView dialogView = (TextView) findViewById(R.id.reminder_message); - dialogView.setText(dialog); } private void addListeners() { diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java index 64cb2cfc5..2cf63655c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java @@ -128,7 +128,7 @@ public class Notifications extends BroadcastReceiver { // --- notification creation /** @return a random reminder string */ - static String getRandomReminder(String[] reminders) { + public static String getRandomReminder(String[] reminders) { int next = ReminderService.random.nextInt(reminders.length); String reminder = reminders[next]; return reminder; diff --git a/astrid/res/layout/astrid_missed_call_view.xml b/astrid/res/layout/astrid_missed_call_view.xml index d5b27eb55..15e86a493 100644 --- a/astrid/res/layout/astrid_missed_call_view.xml +++ b/astrid/res/layout/astrid_missed_call_view.xml @@ -31,7 +31,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="3dip" - android:textSize="20sp" + android:textSize="24sp" android:textColor="@android:color/white" android:layout_weight="1" android:text="@string/MCA_title"/> @@ -53,7 +53,7 @@ android:layout_marginRight="10dip" android:layout_marginBottom="10dip" android:textColor="@android:color/white" - android:textSize="20sp" + android:textSize="24sp" android:gravity="center" android:text="@string/MCA_return_call"/> - + \ No newline at end of file diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index e4e9dd612..801f2709b 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -477,12 +477,6 @@ Ignore - - %s just called. What do you want to do? - - - Someone just called you from %s. What do you want to do? - Ignore all missed calls? @@ -510,6 +504,15 @@ Call %s back in... + + + It must be nice to be so popular! + Yay! People like you! + Make their day, give \'em a call! + Wouldn\'t you be happy if people called you back? + You can do it! + You can always send a text... +