Moving some common functionality to IconLoaderLib

Bug: 183641907
Test: Manual
Change-Id: Icfc7ebb140e4e1678b0715beee2e0e513e707b9e
This commit is contained in:
Sunny Goyal
2021-03-24 15:21:39 -07:00
parent 29c1e8437e
commit 572aca4ce2
28 changed files with 44 additions and 1148 deletions

View File

@@ -23,6 +23,7 @@ import android.content.Intent;
import androidx.annotation.Nullable;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.util.PackageManagerHelper;
@@ -216,4 +217,14 @@ public abstract class ItemInfoWithIcon extends ItemInfo {
* @return a copy of this
*/
public abstract ItemInfoWithIcon clone();
/**
* Returns a FastBitmapDrawable with the icon.
*/
public FastBitmapDrawable newIcon(Context context) {
FastBitmapDrawable drawable = bitmap.newIcon(context);
drawable.setIsDisabled(isDisabled());
return drawable;
}
}