Merge commit '87a8000440d92be900a997f89b21e3261df872f0' into eclair-mr2-plus-aosp * commit '87a8000440d92be900a997f89b21e3261df872f0': Bug 2290800 - Use a collator to sort the app labels.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -963,8 +963,8 @@ public class LauncherModel extends BroadcastReceiver {
|
||||
// This builds the icon bitmaps.
|
||||
mAllAppsList.add(AppInfoCache.cache(apps.get(i), context, bubble));
|
||||
}
|
||||
Collections.sort(mAllAppsList.data, sComparator);
|
||||
Collections.sort(mAllAppsList.added, sComparator);
|
||||
Collections.sort(mAllAppsList.data, APP_NAME_COMPARATOR);
|
||||
Collections.sort(mAllAppsList.added, APP_NAME_COMPARATOR);
|
||||
if (DEBUG_LOADERS) {
|
||||
Log.d(TAG, "cached app icons in "
|
||||
+ (SystemClock.uptimeMillis()-t) + "ms");
|
||||
@@ -1220,7 +1220,7 @@ public class LauncherModel extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
private static final Collator sCollator = Collator.getInstance();
|
||||
private static final Comparator<ApplicationInfo> sComparator
|
||||
public static final Comparator<ApplicationInfo> APP_NAME_COMPARATOR
|
||||
= new Comparator<ApplicationInfo>() {
|
||||
public final int compare(ApplicationInfo a, ApplicationInfo b) {
|
||||
return sCollator.compare(a.title.toString(), b.title.toString());
|
||||
|
||||
Reference in New Issue
Block a user