[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] made transproxy app list alphabetical
commit 080fd5e249086713219351f80331f351150717a9
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date: Fri Jun 29 11:41:36 2012 -0400
made transproxy app list alphabetical
---
.../torproject/android/settings/AppManager.java | 2 ++
.../torproject/android/settings/TorifiedApp.java | 14 +++++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/org/torproject/android/settings/AppManager.java b/src/org/torproject/android/settings/AppManager.java
index db641ae..0733030 100644
--- a/src/org/torproject/android/settings/AppManager.java
+++ b/src/org/torproject/android/settings/AppManager.java
@@ -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;
}
diff --git a/src/org/torproject/android/settings/TorifiedApp.java b/src/org/torproject/android/settings/TorifiedApp.java
index 8e53321..a786800 100644
--- a/src/org/torproject/android/settings/TorifiedApp.java
+++ b/src/org/torproject/android/settings/TorifiedApp.java
@@ -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();
+ }
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits