本文整理了Java中android.graphics.drawable.Icon.createWithAdaptiveBitmap()
方法的一些代码示例,展示了Icon.createWithAdaptiveBitmap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Icon.createWithAdaptiveBitmap()
方法的具体详情如下:
包路径:android.graphics.drawable.Icon
类名称:Icon
方法名:createWithAdaptiveBitmap
暂无
代码示例来源:origin: WangDaYeeeeee/Mysplash
@RequiresApi(api = Build.VERSION_CODES.N_MR1)
private static Icon getShortcutsIcon(Context context,
@DrawableRes int id, @DrawableRes int foregroundId) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
try {
DisplayUtils utils = new DisplayUtils(context);
int size = (int) Math.min(utils.dpToPx(108), 288);
Bitmap bitmap = ImageHelper.loadBitmap(context, foregroundId, size, size);
return Icon.createWithAdaptiveBitmap(bitmap);
} catch (ExecutionException | InterruptedException ignored) {
}
}
return Icon.createWithResource(context, id);
}
}
代码示例来源:origin: WangDaYeeeeee/Mysplash
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (bitmap != null) {
icon = Icon.createWithAdaptiveBitmap(bitmap);
} else {
DisplayUtils utils = new DisplayUtils(context);
int size = (int) Math.min(utils.dpToPx(108), 192);
try {
icon = Icon.createWithAdaptiveBitmap(
ImageHelper.loadBitmap(
context,
代码示例来源:origin: WangDaYeeeeee/GeometricWeather
.into(size, size)
.get();
icon = Icon.createWithAdaptiveBitmap(foreground);
} catch (InterruptedException | ExecutionException e) {
icon = Icon.createWithResource(
内容来源于网络,如有侵权,请联系作者删除!