Skip to content

Commit

Permalink
Merge pull request #143 from bitmold/app-sorting-case-insensitive
Browse files Browse the repository at this point in the history
App sorting for TorifiedApps is case sensitive
  • Loading branch information
n8fr8 committed Apr 20, 2018
2 parents e244df9 + 1c9afcb commit d0cc453
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().compareToIgnoreCase(o2.getName());
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().compareToIgnoreCase(another.toString());
}

@Override
Expand Down

0 comments on commit d0cc453

Please sign in to comment.