Add a util method of creating Icon with Drawable

- Add a util method to help create Icon with Drawable so that
users don't need to handle bitmaps
- Add support for creating with ColorDrawable

Test: robotest
Fixes: 124407373
Change-Id: I1897256821cc804a5e599d967feb84a3bcd689a9
This commit is contained in:
Jason Chiu
2019-02-13 16:07:57 +08:00
parent 0e060dad97
commit c78c54a9c6
7 changed files with 67 additions and 43 deletions

View File

@@ -220,7 +220,7 @@ public class BluetoothDevicesSlice implements CustomSliceable {
.getBtClassDrawableWithDescription(mContext, device);
if (pair.first != null) {
return IconCompat.createWithBitmap(Utils.drawableToBitmap(pair.first));
return Utils.createIconWithDrawable(pair.first);
} else {
return IconCompat.createWithResource(mContext,
com.android.internal.R.drawable.ic_settings_bluetooth);