From 4c49b4a2205da555c93e7d506af0d71218690039 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 7 Dec 2011 15:05:30 -0800 Subject: [PATCH] Use LOCALIZED collation for mailbox names * Our mailbox sort order varies from that of other clients due to our not having used LOCALIZED collation Bug: 2347066 Change-Id: I334feb9fa5690118401e2fe2b4a767eb3f29b25f --- src/com/android/email/activity/MailboxFragmentAdapter.java | 2 +- src/com/android/email/activity/MailboxMoveToAdapter.java | 4 ++-- src/com/android/email/activity/RecentMailboxManager.java | 3 ++- src/com/android/email/activity/ShortcutPickerFragment.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/android/email/activity/MailboxFragmentAdapter.java b/src/com/android/email/activity/MailboxFragmentAdapter.java index a86a2ab3c..4321eb62d 100644 --- a/src/com/android/email/activity/MailboxFragmentAdapter.java +++ b/src/com/android/email/activity/MailboxFragmentAdapter.java @@ -157,7 +157,7 @@ class MailboxFragmentAdapter extends CursorAdapter { + " WHEN " + Mailbox.TYPE_JUNK + " THEN 5" // Other mailboxes (i.e. of Mailbox.TYPE_MAIL) are shown in alphabetical order. + " ELSE 10 END" - + " ," + MailboxColumns.DISPLAY_NAME; + + " ," + MailboxColumns.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; /** View is of a "normal" row */ private static final int ITEM_VIEW_TYPE_NORMAL = 0; diff --git a/src/com/android/email/activity/MailboxMoveToAdapter.java b/src/com/android/email/activity/MailboxMoveToAdapter.java index bbcb8560a..0e4702851 100644 --- a/src/com/android/email/activity/MailboxMoveToAdapter.java +++ b/src/com/android/email/activity/MailboxMoveToAdapter.java @@ -83,12 +83,12 @@ class MailboxMoveToAdapter extends CursorAdapter { private static final String MOVE_TO_ORDER_BY_SERVER_ID = MOVE_TO_ORDER_BY_STATIC // All other mailboxes are shown in alphabetical order. - + ", " + MailboxColumns.SERVER_ID; + + ", " + MailboxColumns.SERVER_ID + " COLLATE LOCALIZED ASC"; /** Display name sort order */ private static final String MOVE_TO_ORDER_BY_DISPLAY_NAME = MOVE_TO_ORDER_BY_STATIC // All other mailboxes are shown in alphabetical order. - + ", " + MailboxColumns.DISPLAY_NAME; + + ", " + MailboxColumns.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; // Column 0 is only for ListView; we don't use it in our code. private static final int COLUMN_ID = 1; diff --git a/src/com/android/email/activity/RecentMailboxManager.java b/src/com/android/email/activity/RecentMailboxManager.java index c11e6fe2f..b3f2414dd 100644 --- a/src/com/android/email/activity/RecentMailboxManager.java +++ b/src/com/android/email/activity/RecentMailboxManager.java @@ -42,7 +42,8 @@ public class RecentMailboxManager { @VisibleForTesting static RecentMailboxManager sInstance; - public static String RECENT_MAILBOXES_SORT_ORDER = MailboxColumns.DISPLAY_NAME; + public static String RECENT_MAILBOXES_SORT_ORDER = + MailboxColumns.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; /** The maximum number of results to retrieve */ private static final int LIMIT_RESULTS = 5; diff --git a/src/com/android/email/activity/ShortcutPickerFragment.java b/src/com/android/email/activity/ShortcutPickerFragment.java index 2cc41abd1..76442b5a4 100644 --- a/src/com/android/email/activity/ShortcutPickerFragment.java +++ b/src/com/android/email/activity/ShortcutPickerFragment.java @@ -380,7 +380,7 @@ public abstract class ShortcutPickerFragment extends ListFragment final String selection; if (recvAuth.isEasConnection()) { projection = EAS_PROJECTION; - orderBy = MailboxColumns.DISPLAY_NAME; + orderBy = MailboxColumns.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; } else { projection = IMAP_PROJECTION; orderBy = MailboxColumns.SERVER_ID;