Search in sources :

Example 1 with IconCache

use of org.adw.launcher2.IconCache in project ADWLauncher2 by boombuler.

the class LauncherApplication method onCreate.

@Override
public void onCreate() {
    //VMRuntime.getRuntime().setMinimumHeapSize(4 * 1024 * 1024);
    super.onCreate();
    mIconCache = new IconCache(this);
    mAppDB = new AppDB(this, mIconCache);
    mModel = new LauncherModel(this, mIconCache);
    // Register intent receivers
    IntentFilter filter = new IntentFilter(AppDB.INTENT_DB_CHANGED);
    registerReceiver(mModel, filter);
    filter = new IntentFilter();
    filter.addAction(ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
    filter.addAction(ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
    registerReceiver(mModel, filter);
    // Register for changes to the favorites
    ContentResolver resolver = getContentResolver();
    resolver.registerContentObserver(LauncherSettings.Favorites.CONTENT_URI, true, mFavoritesObserver);
}
Also used : IntentFilter(android.content.IntentFilter) AppDB(org.adw.launcher2.appdb.AppDB) ContentResolver(android.content.ContentResolver)

Example 2 with IconCache

use of org.adw.launcher2.IconCache 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));
        }
    };
}
Also used : IconCache(org.adw.launcher2.IconCache) IconItemInfo(org.adw.launcher2.IconItemInfo) Collator(java.text.Collator) Comparator(java.util.Comparator)

Aggregations

ContentResolver (android.content.ContentResolver)1 IntentFilter (android.content.IntentFilter)1 Collator (java.text.Collator)1 Comparator (java.util.Comparator)1 IconCache (org.adw.launcher2.IconCache)1 IconItemInfo (org.adw.launcher2.IconItemInfo)1 AppDB (org.adw.launcher2.appdb.AppDB)1