-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于ProgressBar的问题 #36
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AppCompatProgressBarHelper.loadFromAttribute(){
TypedArray array = mView.getContext().obtainStyledAttributes(attrs, ATTR, defStyleAttr, 0);
if (array.hasValue(0)) {
mProgressTintResId = array.getResourceId(0, 0);
setSupportProgressTint(array.getColorStateList(0));
}
if (array.hasValue(1)) {
mIndeterminateTintResId = array.getResourceId(1, 0);
setSupportIndeterminateTint(array.getColorStateList(1));
}
array.recycle();
}
改成下面
AppCompatProgressBarHelper.loadFromAttribute(){
TypedArray array = mView.getContext().obtainStyledAttributes(attrs, ATTR, defStyleAttr, 0);
if (array.hasValue(0)) {
mProgressTintResId = array.getResourceId(0, 0);
setSupportProgressTint(hemeUtil.getThemeColorStateList(mProgressTintResId));
}
if (array.hasValue(1)) {
mIndeterminateTintResId = array.getResourceId(1, 0);
setSupportIndeterminateTint(ThemeUtil.getThemeColorStateList(mIndeterminateTintResId));
}
array.recycle();
}
这样可以避免replaceColor这个方法里面替换颜色 感觉这个方法太不可靠了, 只需要replaceColorById 这个里面替换颜色id就行, id替换感觉更加可靠。
The text was updated successfully, but these errors were encountered: