From dffe2f486d9c6e12255830372597b5d9ff7bfc49 Mon Sep 17 00:00:00 2001 From: satok Date: Mon, 15 Feb 2010 15:29:39 +0900 Subject: [PATCH] Make "Message deleted" be plural Bug: 2264751 --- res/values/strings.xml | 7 +++++-- src/com/android/email/activity/MessageList.java | 9 ++++----- src/com/android/email/activity/MessageView.java | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index a4bb07a58..b8c175a39 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -150,7 +150,7 @@ in %d accounts - + Inbox @@ -261,7 +261,10 @@ Fetching attachment %s - Message deleted. + + Message deleted. + Messages deleted. + Message discarded. diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index 4c972f08b..54f1e4a8c 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -32,7 +32,6 @@ import com.android.email.provider.EmailContent.MailboxColumns; import com.android.email.provider.EmailContent.MessageColumns; import com.android.email.service.MailService; -import android.app.Activity; import android.app.ListActivity; import android.app.NotificationManager; import android.content.ContentResolver; @@ -58,7 +57,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.view.Window; import android.view.ContextMenu.ContextMenuInfo; import android.view.View.OnClickListener; import android.view.animation.AnimationUtils; @@ -637,7 +635,8 @@ public class MessageList extends ListActivity implements OnItemClickListener, On private void onDelete(long messageId, long accountId) { mController.deleteMessage(messageId, accountId); - Toast.makeText(this, R.string.message_deleted_toast, Toast.LENGTH_SHORT).show(); + Toast.makeText(this, getResources().getQuantityString( + R.plurals.message_deleted_toast, 1), Toast.LENGTH_SHORT).show(); } private void onSetMessageRead(long messageId, boolean newRead) { @@ -701,8 +700,8 @@ public class MessageList extends ListActivity implements OnItemClickListener, On for (Long id : cloneSet) { mController.deleteMessage(id, -1); } - // TODO: count messages and show "n messages deleted" - Toast.makeText(this, R.string.message_deleted_toast, Toast.LENGTH_SHORT).show(); + Toast.makeText(this, getResources().getQuantityString( + R.plurals.message_deleted_toast, cloneSet.size()), Toast.LENGTH_SHORT).show(); selectedSet.clear(); showMultiPanel(false); } diff --git a/src/com/android/email/activity/MessageView.java b/src/com/android/email/activity/MessageView.java index 757ba5dc6..06f12961b 100644 --- a/src/com/android/email/activity/MessageView.java +++ b/src/com/android/email/activity/MessageView.java @@ -488,7 +488,8 @@ public class MessageView extends Activity implements OnClickListener { long messageIdToDelete = mMessageId; boolean moved = moveToOlder() || moveToNewer(); mController.deleteMessage(messageIdToDelete, mMessage.mAccountKey); - Toast.makeText(this, R.string.message_deleted_toast, Toast.LENGTH_SHORT).show(); + Toast.makeText(this, getResources().getQuantityString(R.plurals.message_deleted_toast, + 1), Toast.LENGTH_SHORT).show(); if (!moved) { // this generates a benign warning "Duplicate finish request" because // repositionMessageListCursor() will fail to reposition and do its own finish()