Fixed folder sort order

pull/157/head
M66B 5 years ago
parent 851ead228c
commit 7ecfd7a788

@ -413,6 +413,9 @@ public class EntityFolder extends EntityOrder implements Serializable {
if (c != 0)
return c;
if (context == null)
return collator.compare(f1.name, f2.name);
String name1 = f1.getDisplayName(context);
String name2 = f2.getDisplayName(context);
return collator.compare(name1, name2);

@ -617,7 +617,7 @@ public class FragmentAccount extends FragmentBase {
altJunk.type = EntityFolder.JUNK;
if (result.folders.size() > 0)
Collections.sort(result.folders, result.folders.get(0).getComparator(context));
Collections.sort(result.folders, result.folders.get(0).getComparator(null));
}
return result;
@ -1221,7 +1221,7 @@ public class FragmentAccount extends FragmentBase {
List<EntityFolder> folders = db.folder().getFolders(account);
if (folders != null && folders.size() > 0)
Collections.sort(folders, folders.get(0).getComparator(context));
Collections.sort(folders, folders.get(0).getComparator(null));
return folders;
}

@ -621,7 +621,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
for (EntityAccount account : accounts) {
List<EntityFolder> folders = db.folder().getFolders(account.id);
if (folders.size() > 0)
Collections.sort(folders, folders.get(0).getComparator(context));
Collections.sort(folders, folders.get(0).getComparator(null));
result.put(account, folders);
}
@ -640,7 +640,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
.addSubMenu(Menu.NONE, 0, order++, account.name);
int sorder = 1;
for (EntityFolder folder : result.get(account)) {
MenuItem item = smenu.add(Menu.NONE, 1, sorder++, folder.getDisplayName(getContext()));
MenuItem item = smenu.add(Menu.NONE, 1, sorder++,
Helper.localizeFolderName(getContext(), folder.name));
item.setIntent(new Intent().putExtra("target", folder.id));
}
}

@ -380,7 +380,7 @@ public class FragmentRule extends FragmentBase {
data.folders = new ArrayList<>();
if (data.folders.size() > 0)
Collections.sort(data.folders, data.folders.get(0).getComparator(context));
Collections.sort(data.folders, data.folders.get(0).getComparator(null));
data.identities = db.identity().getIdentities(aid);
data.answers = db.answer().getAnswers(false);

Loading…
Cancel
Save