Debug: order answers by usage

This commit is contained in:
M66B 2021-05-13 21:27:40 +02:00
parent e2b6227bc6
commit 6344653f2f
2 changed files with 21 additions and 0 deletions

View File

@ -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) {

View File

@ -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<>();