/**
* 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;
}
ResourceUtil.java 文件源码
java
阅读 51
收藏 0
点赞 0
评论 0
项目:apps-android-wikipedia
作者:
评论列表
文章目录