use of org.adw.launcher2.IconItemInfo in project ADWLauncher2 by boombuler.
the class Preferences method getLaunchCountComparator.
private Comparator<IconItemInfo> getLaunchCountComparator() {
final AppDB myAppDB = mLauncher.getAppDB();
return new Comparator<IconItemInfo>() {
@Override
public int compare(IconItemInfo a, IconItemInfo b) {
int valA = Integer.MAX_VALUE;
int valB = Integer.MAX_VALUE;
if (a instanceof ShortcutInfo)
valA = myAppDB.getLaunchCounter((ShortcutInfo) a);
if (b instanceof ShortcutInfo)
valB = myAppDB.getLaunchCounter((ShortcutInfo) b);
return valB - valA;
}
};
}
use of org.adw.launcher2.IconItemInfo in project ADWLauncher2 by boombuler.
the class Preferences method getAppNameComparator.
private Comparator<IconItemInfo> getAppNameComparator() {
final IconCache myIconCache = mLauncher.getIconCache();
final Collator sCollator = Collator.getInstance();
return new Comparator<IconItemInfo>() {
@Override
public final int compare(IconItemInfo a, IconItemInfo b) {
return sCollator.compare(a.getTitle(myIconCache), b.getTitle(myIconCache));
}
};
}
Aggregations