mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Debug: order answers by usage
This commit is contained in:
parent
e2b6227bc6
commit
6344653f2f
2 changed files with 21 additions and 0 deletions
|
@ -1752,6 +1752,16 @@ public class FragmentCompose extends FragmentBase {
|
|||
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc
|
||||
Collections.sort(groups, collator);
|
||||
|
||||
Collections.sort(answers, new Comparator<EntityAnswer>() {
|
||||
@Override
|
||||
public int compare(EntityAnswer a1, EntityAnswer a2) {
|
||||
if (!BuildConfig.DEBUG || a1.applied.equals(a2.applied))
|
||||
return collator.compare(a1.name, a2.name);
|
||||
else
|
||||
return -a1.applied.compareTo(a2.applied);
|
||||
}
|
||||
});
|
||||
|
||||
Collections.sort(favorites, new Comparator<EntityAnswer>() {
|
||||
@Override
|
||||
public int compare(EntityAnswer a1, EntityAnswer a2) {
|
||||
|
|
|
@ -199,6 +199,7 @@ import java.util.Arrays;
|
|||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -2661,6 +2662,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc
|
||||
Collections.sort(groups, collator);
|
||||
|
||||
Collections.sort(answers, new Comparator<EntityAnswer>() {
|
||||
@Override
|
||||
public int compare(EntityAnswer a1, EntityAnswer a2) {
|
||||
if (!BuildConfig.DEBUG || a1.applied.equals(a2.applied))
|
||||
return collator.compare(a1.name, a2.name);
|
||||
else
|
||||
return -a1.applied.compareTo(a2.applied);
|
||||
}
|
||||
});
|
||||
|
||||
int order = 0;
|
||||
|
||||
Map<String, SubMenu> map = new HashMap<>();
|
||||
|
|
Loading…
Reference in a new issue