made transproxy app list alphabetical

This commit is contained in:
n8fr8 2012-06-29 11:41:36 -04:00
parent ea7154f2c8
commit 080fd5e249
2 changed files with 15 additions and 1 deletions

View File

@ -5,6 +5,7 @@ package org.torproject.android.settings;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -266,6 +267,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
appIdx++; appIdx++;
} }
Collections.sort(apps);
return apps; return apps;
} }

View File

@ -2,7 +2,7 @@ package org.torproject.android.settings;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
public class TorifiedApp { public class TorifiedApp implements Comparable {
private boolean enabled; private boolean enabled;
private int uid; private int uid;
@ -115,4 +115,16 @@ public class TorifiedApp {
public void setIcon(Drawable icon) { public void setIcon(Drawable icon) {
this.icon = icon; this.icon = icon;
} }
@Override
public int compareTo(Object another) {
return this.toString().compareTo(another.toString());
}
@Override
public String toString ()
{
return getName();
}
} }