diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 63ec2a257..e26d405bc 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -3094,14 +3094,21 @@ public class LauncherModel extends BroadcastReceiver { } }; } - public static final Comparator<AppInfo> APP_INSTALL_TIME_COMPARATOR - = new Comparator<AppInfo>() { - public final int compare(AppInfo a, AppInfo b) { - if (a.firstInstallTime < b.firstInstallTime) return 1; - if (a.firstInstallTime > b.firstInstallTime) return -1; - return 0; - } - }; + public static final Comparator<AppInfo> getAppInstallTimeComparator() { + final Collator collator = Collator.getInstance(); + return new Comparator<AppInfo>() { + public final int compare(AppInfo a, AppInfo b) { + if (a.firstInstallTime < b.firstInstallTime) return 1; + if (a.firstInstallTime > b.firstInstallTime) return -1; + int result = collator.compare(a.title.toString().trim(), + b.title.toString().trim()); + if (result == 0) { + result = a.componentName.compareTo(b.componentName); + } + return result; + } + }; + } public static final Comparator<AppWidgetProviderInfo> getWidgetNameComparator() { final Collator collator = Collator.getInstance(); return new Comparator<AppWidgetProviderInfo>() { |