Skip to content

Commit

Permalink
App sorting for TorifiedApps is case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
lexi committed Apr 13, 2018
1 parent a4ce29d commit 0675600
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -130,7 +130,12 @@ private void loadApps (SharedPreferences prefs)

Collections.sort(mApps,new Comparator<TorifiedApp>() {
public int compare(TorifiedApp o1, TorifiedApp o2) {
if (o1.isTorified() == o2.isTorified()) return o1.getName().compareTo(o2.getName());
/* Some apps start with lowercase letters and without the sorting being case
insensitive they'd appear at the end of the grid of apps, a position where users
would likely not expect to find them.
*/
if (o1.isTorified() == o2.isTorified())
return o1.getName().toUpperCase().compareTo(o2.getName().toUpperCase());
if (o1.isTorified()) return -1;
return 1;
}
Expand Down
Expand Up @@ -133,8 +133,7 @@ public void setIcon(Drawable icon) {

@Override
public int compareTo(Object another) {

return this.toString().compareTo(another.toString());
return this.toString().toUpperCase().compareTo(another.toString().toUpperCase());
}

@Override
Expand Down

0 comments on commit 0675600

Please sign in to comment.