Search in sources :

Example 1 with TBApplication

use of rocks.tbog.tblauncher.TBApplication in project TBLauncher by TBog.

the class IconsHandler method changeIcon.

public void changeIcon(DialContactEntry dialContactEntry, Drawable drawable) {
    Bitmap bitmap = getIconBitmap(ctx, drawable);
    TBApplication app = TBApplication.getApplication(ctx);
    app.getDataHandler().setCustomStaticEntryIcon(DialContactEntry.SCHEME, bitmap);
    app.drawableCache().cacheDrawable(dialContactEntry.getIconCacheId(), null);
    dialContactEntry.setCustomIcon();
    app.drawableCache().cacheDrawable(dialContactEntry.getIconCacheId(), drawable);
}
Also used : Bitmap(android.graphics.Bitmap) TBApplication(rocks.tbog.tblauncher.TBApplication)

Example 2 with TBApplication

use of rocks.tbog.tblauncher.TBApplication in project TBLauncher by TBog.

the class IconsHandler method restoreDefaultIcon.

public void restoreDefaultIcon(AppEntry appEntry) {
    TBApplication app = TBApplication.getApplication(ctx);
    app.getDataHandler().removeCustomAppIcon(appEntry.getUserComponentName());
    app.drawableCache().cacheDrawable(appEntry.getIconCacheId(), null);
    appEntry.clearCustomIcon();
}
Also used : TBApplication(rocks.tbog.tblauncher.TBApplication)

Example 3 with TBApplication

use of rocks.tbog.tblauncher.TBApplication in project TBLauncher by TBog.

the class IconsHandler method changeIcon.

public void changeIcon(ShortcutEntry shortcutEntry, Drawable drawable) {
    Bitmap bitmap = getIconBitmap(ctx, drawable);
    TBApplication app = TBApplication.getApplication(ctx);
    app.getDataHandler().setCustomStaticEntryIcon(shortcutEntry.id, bitmap);
    app.drawableCache().cacheDrawable(shortcutEntry.getIconCacheId(), null);
    shortcutEntry.setCustomIcon();
    app.drawableCache().cacheDrawable(shortcutEntry.getIconCacheId(), drawable);
}
Also used : Bitmap(android.graphics.Bitmap) TBApplication(rocks.tbog.tblauncher.TBApplication)

Example 4 with TBApplication

use of rocks.tbog.tblauncher.TBApplication in project TBLauncher by TBog.

the class IconsHandler method changeIcon.

public void changeIcon(SearchEntry searchEntry, Drawable drawable) {
    Bitmap bitmap = getIconBitmap(ctx, drawable);
    TBApplication app = TBApplication.getApplication(ctx);
    app.getDataHandler().setCustomStaticEntryIcon(searchEntry.id, bitmap);
    app.drawableCache().cacheDrawable(searchEntry.getIconCacheId(), null);
    searchEntry.setCustomIcon();
    app.drawableCache().cacheDrawable(searchEntry.getIconCacheId(), drawable);
}
Also used : Bitmap(android.graphics.Bitmap) TBApplication(rocks.tbog.tblauncher.TBApplication)

Example 5 with TBApplication

use of rocks.tbog.tblauncher.TBApplication in project TBLauncher by TBog.

the class IconsHandler method restoreDefaultIcon.

public void restoreDefaultIcon(DialContactEntry dialContactEntry) {
    TBApplication app = TBApplication.getApplication(ctx);
    app.getDataHandler().removeCustomStaticEntryIcon(DialContactEntry.SCHEME);
    app.drawableCache().cacheDrawable(dialContactEntry.getIconCacheId(), null);
    dialContactEntry.clearCustomIcon();
}
Also used : TBApplication(rocks.tbog.tblauncher.TBApplication)

Aggregations

TBApplication (rocks.tbog.tblauncher.TBApplication)13 Bitmap (android.graphics.Bitmap)5 Context (android.content.Context)3 AppRecord (rocks.tbog.tblauncher.db.AppRecord)1