@SuppressWarnings("deprecation")
public void init(AttributeSet attrs, int defStyleAttr) {
if (isInEditMode())
return;
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.CheckBox, defStyleAttr, 0);
drawable = new CheckableDrawable(getContext(), R.raw.carbon_checkbox_checked, R.raw.carbon_checkbox_unchecked, R.raw.carbon_checkbox_filled, new PointF(-0.09f, 0.11f));
setButtonDrawable(getResources().getDrawable(android.R.color.transparent));
setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
ColorStateList csl = a.getColorStateList(R.styleable.CheckBox_carbon_checkColor);
if (csl != null)
drawable.setColor(csl);
setCheckedImmediate(isChecked());
a.recycle();
}
CheckBox.java 文件源码
java
阅读 48
收藏 0
点赞 0
评论 0
项目:XERUNG
作者:
评论列表
文章目录