android.graphics.drawable.Icon.createWithAdaptiveBitmap()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中android.graphics.drawable.Icon.createWithAdaptiveBitmap()方法的一些代码示例,展示了Icon.createWithAdaptiveBitmap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Icon.createWithAdaptiveBitmap()方法的具体详情如下:
包路径:android.graphics.drawable.Icon
类名称:Icon
方法名:createWithAdaptiveBitmap

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(

相关文章