ResourceUtil.java 文件源码

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

项目:apps-android-wikipedia 作者:
/**
 * Resolves the resource ID of a theme-dependent attribute (for example, a color value
 * that changes based on the selected theme)
 * @param context The context whose theme contains the attribute.
 * @param id Theme-dependent attribute ID to be resolved.
 * @return The actual resource ID of the requested theme-dependent attribute.
 */
@AnyRes public static int getThemedAttributeId(@NonNull Context context, @AttrRes int id) {
    TypedValue typedValue = getThemedAttribute(context, id);
    if (typedValue == null) {
        throw new IllegalArgumentException("Attribute not found; ID=" + id);
    }
    return typedValue.resourceId;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号