Utilities.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:SimpleUILauncher 作者:
/**
 * Badges the provided icon with the user badge if required.
 */
public static Bitmap badgeIconForUser(Bitmap icon,  UserHandleCompat user, Context context) {
    if (Utilities.ATLEAST_LOLLIPOP && user != null
            && !UserHandleCompat.myUserHandle().equals(user)) {
        BitmapDrawable drawable = new FixedSizeBitmapDrawable(icon);
        Drawable badged = context.getPackageManager().getUserBadgedIcon(
                drawable, user.getUser());
        if (badged instanceof BitmapDrawable) {
            return ((BitmapDrawable) badged).getBitmap();
        } else {
            return createIconBitmap(badged, context);
        }
    } else {
        return icon;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号