/**
* Returns the drawable object from the given attributes.
*
* <p>This method supports inflation of {@code <vector>} and {@code <animated-vector>} resources
* on devices where platform support is not available.
*/
@Nullable
public static Drawable getDrawable(
Context context, TypedArray attributes, @StyleableRes int index) {
if (attributes.hasValue(index)) {
int resourceId = attributes.getResourceId(index, 0);
if (resourceId != 0) {
Drawable value = AppCompatResources.getDrawable(context, resourceId);
if (value != null) {
return value;
}
}
}
return attributes.getDrawable(index);
}
MaterialResources.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:material-components-android
作者:
评论列表
文章目录