if (component1 != null && component2 != null) { if (!component1.equals(component2)) { return component1.compareTo(component2);
(activity==null || currentActivity.compareTo(activity)==0)) return true;
@Override public int compareTo(MyActivityInfo another) { int cmp_name = this.name.compareTo(another.name); if (cmp_name != 0) return cmp_name; int cmp_component = this.component_name.compareTo(another.component_name); return cmp_component; }
public final int compare(AppInfo a, AppInfo b) { if (a.user.equals(b.user)) { int result = collator.compare(a.title.toString().trim(), b.title.toString().trim()); if (result == 0) { result = a.componentName.compareTo(b.componentName); } return result; } else { // TODO Need to figure out rules for sorting // profiles, this puts work second. return a.user.toString().compareTo(b.user.toString()); } } };
@Override public final int compare(ItemInfo a, ItemInfo b) { // Order by the title in the current locale int result = compareTitles(a.title.toString(), b.title.toString()); if (result == 0 && a instanceof AppInfo && b instanceof AppInfo) { AppInfo aAppInfo = (AppInfo) a; AppInfo bAppInfo = (AppInfo) b; // If two apps have the same title, then order by the component name result = aAppInfo.componentName.compareTo(bAppInfo.componentName); if (result == 0) { // If the two apps are the same component, then prioritize by the order that // the app user was created (prioritizing the main user's apps) return super.compare(a, b); } } return result; } };
@Override public final int compare(ItemInfo a, ItemInfo b) { // Order by the title in the current locale int result = compareTitles(a.title.toString(), b.title.toString()); if (result == 0 && a instanceof AppInfo && b instanceof AppInfo) { AppInfo aAppInfo = (AppInfo) a; AppInfo bAppInfo = (AppInfo) b; // If two apps have the same title, then order by the component name result = aAppInfo.componentName.compareTo(bAppInfo.componentName); if (result == 0) { // If the two apps are the same component, then prioritize by the order that // the app user was created (prioritizing the main user's apps) return super.compare(a, b); } } return result; } };
@Override public final int compare(ItemInfo a, ItemInfo b) { // Order by the title in the current locale int result = compareTitles(a.title.toString(), b.title.toString()); if (result == 0 && a instanceof AppInfo && b instanceof AppInfo) { AppInfo aAppInfo = (AppInfo) a; AppInfo bAppInfo = (AppInfo) b; // If two apps have the same title, then order by the component name result = aAppInfo.componentName.compareTo(bAppInfo.componentName); if (result == 0) { // If the two apps are the same component, then prioritize by the order that // the app user was created (prioritizing the main user's apps) return super.compare(a, b); } } return result; } };
@Override public int compare(AppInfo a, AppInfo b) { // Order by the title in the current locale int result = mLabelComparator.compare(a.title.toString(), b.title.toString()); if (result != 0) { return result; } // If labels are same, compare component names result = a.componentName.compareTo(b.componentName); if (result != 0) { return result; } if (mMyUser.equals(a.user)) { return -1; } else { Long aUserSerial = mUserManager.getSerialNumberForUser(a.user); Long bUserSerial = mUserManager.getSerialNumberForUser(b.user); return aUserSerial.compareTo(bUserSerial); } } }
if (component1 != null && component2 != null) { if (!component1.equals(component2)) { return component1.compareTo(component2);
if (component1 != null && component2 != null) { if (!component1.equals(component2)) { return component1.compareTo(component2);
(activity==null || currentActivity.compareTo(activity)==0)) return true;