made transproxy app list alphabetical
This commit is contained in:
parent
ea7154f2c8
commit
080fd5e249
|
@ -5,6 +5,7 @@ package org.torproject.android.settings;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -266,6 +267,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
|
|||
appIdx++;
|
||||
}
|
||||
|
||||
Collections.sort(apps);
|
||||
|
||||
return apps;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.torproject.android.settings;
|
|||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class TorifiedApp {
|
||||
public class TorifiedApp implements Comparable {
|
||||
|
||||
private boolean enabled;
|
||||
private int uid;
|
||||
|
@ -115,4 +115,16 @@ public class TorifiedApp {
|
|||
public void setIcon(Drawable icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object another) {
|
||||
|
||||
return this.toString().compareTo(another.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue