summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsView.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-12-01 16:19:38 -0800
committerJoe Onorato <joeo@android.com>2009-12-01 16:20:30 -0800
commitb0c27f254a9929be208d5e04554f438076c833bc (patch)
tree0d271951fc2e888dade2c2d7e099555802b30043 /src/com/android/launcher2/AllAppsView.java
parenteaa01f68f24d78b15275a0ee39bc2d6e53f6733e (diff)
downloadandroid_packages_apps_Trebuchet-b0c27f254a9929be208d5e04554f438076c833bc.tar.gz
android_packages_apps_Trebuchet-b0c27f254a9929be208d5e04554f438076c833bc.tar.bz2
android_packages_apps_Trebuchet-b0c27f254a9929be208d5e04554f438076c833bc.zip
Bug 2290800 - Use a collator to sort the app labels.
SHAME ON ME for using String.compareTo().
Diffstat (limited to 'src/com/android/launcher2/AllAppsView.java')
-rw-r--r--src/com/android/launcher2/AllAppsView.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 9b521b971..fe8ded12b 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -676,7 +676,8 @@ public class AllAppsView extends RSSurfaceView
for (int i=0; i<N; i++) {
final ApplicationInfo item = list.get(i);
- int index = Collections.binarySearch(mAllAppsList, item, mAppNameComp);
+ int index = Collections.binarySearch(mAllAppsList, item,
+ LauncherModel.APP_NAME_COMPARATOR);
if (index < 0) {
index = -(index+1);
}
@@ -725,16 +726,6 @@ public class AllAppsView extends RSSurfaceView
addApps(list);
}
- private Comparator<ApplicationInfo> mAppNameComp = new Comparator<ApplicationInfo>() {
- public int compare(ApplicationInfo a, ApplicationInfo b) {
- int result = a.title.toString().compareTo(b.toString());
- if (result != 0) {
- return result;
- }
- return a.intent.getComponent().compareTo(b.intent.getComponent());
- }
- };
-
private static int findAppByComponent(ArrayList<ApplicationInfo> list, ApplicationInfo item) {
ComponentName component = item.intent.getComponent();
final int N = list.size();