From 6daeb6b7490260c787f5b4a51edf2ac3342984de Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 13 Nov 2009 03:20:31 +0000 Subject: [PATCH] Sort the "NONE" folder to the top of the auto-expand folder list --- .../android/email/activity/ChooseFolder.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/android/email/activity/ChooseFolder.java b/src/com/android/email/activity/ChooseFolder.java index 0f5cc67dc..71a3b0d10 100644 --- a/src/com/android/email/activity/ChooseFolder.java +++ b/src/com/android/email/activity/ChooseFolder.java @@ -228,7 +228,7 @@ public class ChooseFolder extends K9ListActivity localFolders.add(folder.getName()); } - + if (showOptionNone) { localFolders.add(Email.FOLDER_NONE); @@ -237,6 +237,14 @@ public class ChooseFolder extends K9ListActivity Collections.sort(localFolders, new Comparator() { public int compare(String aName, String bName) { + if (Email.FOLDER_NONE.equalsIgnoreCase(aName)) + { + return -1; + } + if (Email.FOLDER_NONE.equalsIgnoreCase(bName)) + { + return 1; + } if (Email.INBOX.equalsIgnoreCase(aName)) { return -1; @@ -245,14 +253,6 @@ public class ChooseFolder extends K9ListActivity { return 1; } - if (Email.FOLDER_NONE.equalsIgnoreCase(aName)) - { - return 1; - } - if (Email.FOLDER_NONE.equalsIgnoreCase(bName)) - { - return -1; - } return aName.compareToIgnoreCase(bName); }