/**
* Load the color from xml attributes or fallback to the default if not found
*
* @param typedArray attributes typed array
* @param index the styleable index
* @param defaultColor the default color resource id
* @return the color to use
*/
@ColorInt
private int loadColor(TypedArray typedArray, @StyleableRes int index, @ColorRes int defaultColor) {
int loadedColor = ContextCompat.getColor(getContext(), defaultColor);
ColorStateList colorList = typedArray.getColorStateList(index);
if (colorList != null) {
loadedColor = colorList.getDefaultColor();
}
return loadedColor;
}
MPLoadingSpinner.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:px-android
作者:
评论列表
文章目录