Search in sources :

Example 1 with BaseIconFactory

use of com.android.launcher3.icons.BaseIconFactory in project android_packages_apps_Launcher3 by crdroidandroid.

the class TaskIconCache method getBitmapInfo.

@WorkerThread
private BitmapInfo getBitmapInfo(Drawable drawable, int userId, int primaryColor, boolean isInstantApp) {
    try (BaseIconFactory bif = getIconFactory()) {
        bif.disableColorExtraction();
        bif.setWrapperBackgroundColor(primaryColor);
        // User version code O, so that the icon is always wrapped in an adaptive icon container
        return bif.createBadgedIconBitmap(drawable, UserHandle.of(userId), Build.VERSION_CODES.O, isInstantApp);
    }
}
Also used : BaseIconFactory(com.android.launcher3.icons.BaseIconFactory) WorkerThread(androidx.annotation.WorkerThread)

Example 2 with BaseIconFactory

use of com.android.launcher3.icons.BaseIconFactory in project android_packages_apps_Launcher3 by AOSPA.

the class TaskIconCache method getBitmapInfo.

@WorkerThread
private BitmapInfo getBitmapInfo(Drawable drawable, int userId, int primaryColor, boolean isInstantApp) {
    try (BaseIconFactory bif = getIconFactory()) {
        bif.disableColorExtraction();
        bif.setWrapperBackgroundColor(primaryColor);
        // User version code O, so that the icon is always wrapped in an adaptive icon container
        return bif.createBadgedIconBitmap(drawable, UserHandle.of(userId), Build.VERSION_CODES.O, isInstantApp);
    }
}
Also used : BaseIconFactory(com.android.launcher3.icons.BaseIconFactory) WorkerThread(androidx.annotation.WorkerThread)

Example 3 with BaseIconFactory

use of com.android.launcher3.icons.BaseIconFactory in project android_packages_apps_Launcher3 by ArrowOS.

the class TaskIconCache method getBitmapInfo.

@WorkerThread
private BitmapInfo getBitmapInfo(Drawable drawable, int userId, int primaryColor, boolean isInstantApp) {
    try (BaseIconFactory bif = getIconFactory()) {
        bif.disableColorExtraction();
        bif.setWrapperBackgroundColor(primaryColor);
        // User version code O, so that the icon is always wrapped in an adaptive icon container
        return bif.createBadgedIconBitmap(drawable, UserHandle.of(userId), Build.VERSION_CODES.O, isInstantApp);
    }
}
Also used : BaseIconFactory(com.android.launcher3.icons.BaseIconFactory) WorkerThread(androidx.annotation.WorkerThread)

Example 4 with BaseIconFactory

use of com.android.launcher3.icons.BaseIconFactory in project android_packages_apps_Launcher3 by ProtonAOSP.

the class TaskIconCache method getBitmapInfo.

@WorkerThread
private BitmapInfo getBitmapInfo(Drawable drawable, int userId, int primaryColor, boolean isInstantApp) {
    try (BaseIconFactory bif = getIconFactory()) {
        bif.disableColorExtraction();
        bif.setWrapperBackgroundColor(primaryColor);
        // User version code O, so that the icon is always wrapped in an adaptive icon container
        return bif.createBadgedIconBitmap(drawable, UserHandle.of(userId), Build.VERSION_CODES.O, isInstantApp);
    }
}
Also used : BaseIconFactory(com.android.launcher3.icons.BaseIconFactory) WorkerThread(androidx.annotation.WorkerThread)

Example 5 with BaseIconFactory

use of com.android.launcher3.icons.BaseIconFactory in project android_packages_apps_404Launcher by P-404.

the class TaskIconCache method getBitmapInfo.

@WorkerThread
private BitmapInfo getBitmapInfo(Drawable drawable, int userId, int primaryColor, boolean isInstantApp) {
    try (BaseIconFactory bif = getIconFactory()) {
        bif.disableColorExtraction();
        bif.setWrapperBackgroundColor(primaryColor);
        // User version code O, so that the icon is always wrapped in an adaptive icon container
        return bif.createBadgedIconBitmap(drawable, UserHandle.of(userId), Build.VERSION_CODES.O, isInstantApp);
    }
}
Also used : BaseIconFactory(com.android.launcher3.icons.BaseIconFactory) WorkerThread(androidx.annotation.WorkerThread)

Aggregations

BaseIconFactory (com.android.launcher3.icons.BaseIconFactory)7 WorkerThread (androidx.annotation.WorkerThread)5 ComponentKey (com.android.launcher3.util.ComponentKey)2 ContentValues (android.content.ContentValues)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 PackageInfo (android.content.pm.PackageInfo)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 BitmapInfo (com.android.launcher3.icons.BitmapInfo)1