Random strings for missed call dialog

pull/14/head
Sam Bosley 13 years ago
parent c469c9afd2
commit cf68f97aa4

@ -26,6 +26,7 @@ import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences; import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.reminders.NotificationFragment.SnoozeDialog; import com.todoroo.astrid.reminders.NotificationFragment.SnoozeDialog;
import com.todoroo.astrid.reminders.Notifications;
import com.todoroo.astrid.reminders.SnoozeCallback; import com.todoroo.astrid.reminders.SnoozeCallback;
import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.service.ThemeService;
@ -131,16 +132,13 @@ public class MissedCallActivity extends Activity {
addListeners(); addListeners();
String dialog;
if (TextUtils.isEmpty(name)) { if (!Preferences.getBoolean(R.string.p_rmd_nagging, true)) {
dialog = getString(R.string.MCA_dialog_without_name, number); findViewById(R.id.missed_calls_speech_bubble).setVisibility(View.GONE);
} else { } 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() { private void addListeners() {

@ -128,7 +128,7 @@ public class Notifications extends BroadcastReceiver {
// --- notification creation // --- notification creation
/** @return a random reminder string */ /** @return a random reminder string */
static String getRandomReminder(String[] reminders) { public static String getRandomReminder(String[] reminders) {
int next = ReminderService.random.nextInt(reminders.length); int next = ReminderService.random.nextInt(reminders.length);
String reminder = reminders[next]; String reminder = reminders[next];
return reminder; return reminder;

@ -31,7 +31,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="3dip" android:layout_marginTop="3dip"
android:textSize="20sp" android:textSize="24sp"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/MCA_title"/> android:text="@string/MCA_title"/>
@ -53,7 +53,7 @@
android:layout_marginRight="10dip" android:layout_marginRight="10dip"
android:layout_marginBottom="10dip" android:layout_marginBottom="10dip"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="20sp" android:textSize="24sp"
android:gravity="center" android:gravity="center"
android:text="@string/MCA_return_call"/> android:text="@string/MCA_return_call"/>
<TextView <TextView
@ -64,7 +64,7 @@
android:layout_marginRight="10dip" android:layout_marginRight="10dip"
android:layout_marginBottom="10dip" android:layout_marginBottom="10dip"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="20sp" android:textSize="24sp"
android:gravity="center" android:gravity="center"
android:text="@string/MCA_add_task"/> android:text="@string/MCA_add_task"/>
<TextView <TextView
@ -75,11 +75,11 @@
android:layout_marginRight="10dip" android:layout_marginRight="10dip"
android:layout_marginBottom="10dip" android:layout_marginBottom="10dip"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="20sp" android:textSize="24sp"
android:gravity="center" android:gravity="center"
android:text="@string/MCA_ignore" android:text="@string/MCA_ignore"
android:background="#707070"/> android:background="#707070"/>
<include layout="@layout/astrid_speech_bubble"/> <include layout="@layout/astrid_speech_bubble" android:id="@+id/missed_calls_speech_bubble"/>
</LinearLayout> </LinearLayout>

@ -477,12 +477,6 @@
<!-- Missed call: return call --> <!-- Missed call: return call -->
<string name="MCA_ignore">Ignore</string> <string name="MCA_ignore">Ignore</string>
<!-- Missed call: dialog with name. %s->caller name -->
<string name="MCA_dialog_with_name">%s just called. What do you want to do?</string>
<!-- Missed call: dialog without name. %s->phone number -->
<string name="MCA_dialog_without_name">Someone just called you from %s. What do you want to do?</string>
<!-- Missed call: dialog to ignore all missed calls title --> <!-- Missed call: dialog to ignore all missed calls title -->
<string name="MCA_ignore_title">Ignore all missed calls?</string> <string name="MCA_ignore_title">Ignore all missed calls?</string>
@ -510,6 +504,15 @@
<!-- Missed call: schedule dialog title (%s -> name or number)--> <!-- Missed call: schedule dialog title (%s -> name or number)-->
<string name="MCA_schedule_dialog_title">Call %s back in...</string> <string name="MCA_schedule_dialog_title">Call %s back in...</string>
<!-- Missed call speech bubble options -->
<string-array name="MCA_dialog_speech_options">
<item>It must be nice to be so popular!</item>
<item>Yay! People like you!</item>
<item>Make their day, give \'em a call!</item>
<item>Wouldn\'t you be happy if people called you back?</item>
<item>You can do it!</item>
<item>You can always send a text...</item>
</string-array>
<!-- ===================================================== HelpActivity == --> <!-- ===================================================== HelpActivity == -->

Loading…
Cancel
Save