mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-29 09:01:30 +01:00
Sort folders on display name
This commit is contained in:
@@ -259,7 +259,7 @@ public class EntityFolder implements Serializable {
|
||||
return folder;
|
||||
}
|
||||
|
||||
static void sort(List<EntityFolder> folders) {
|
||||
static void sort(final Context context, List<EntityFolder> folders) {
|
||||
final Collator collator = Collator.getInstance(Locale.getDefault());
|
||||
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc
|
||||
|
||||
@@ -274,9 +274,9 @@ public class EntityFolder implements Serializable {
|
||||
int c = -f1.synchronize.compareTo(f2.synchronize);
|
||||
if (c != 0)
|
||||
return c;
|
||||
return collator.compare(
|
||||
f1.name == null ? "" : f1.name,
|
||||
f2.name == null ? "" : f2.name);
|
||||
String name1 = f1.getDisplayName(context);
|
||||
String name2 = f2.getDisplayName(context);
|
||||
return collator.compare(name1, name2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user