Utils.java 文件源码

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

项目:TreebolicLib 作者:
/**
 * Get drawable
 *
 * @param context context
 * @param resId   drawable id
 * @return drawable
 */
static public Drawable getDrawable(@NonNull final Context context, int resId)
{
    final Resources resources = context.getResources();
    Drawable drawable;
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP)
    {
        final Resources.Theme theme = context.getTheme();
        drawable = resources.getDrawable(resId, theme);
    }
    else
    {
        drawable = resources.getDrawable(resId);
    }
    return drawable;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号