*/
private int mHei;
/**
- 控件颜色
*/
private int mColor;
private MsgHandler mHandler = new MsgHandler(this);
public WhiteWindmills(Context context) {
this(context, null);
}
public WhiteWindmills(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public WhiteWindmills(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView(context, attrs);
}
private void initView(Context context, AttributeSet attrs) {
TypedArray array 《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》无偿开源 徽信搜索公众号【编程进阶路】 = context.obtainStyledAttributes(attrs, R.styleable.WhiteWindmills);
if (array != null) {
mColor = array.getColor(R.styleable.WhiteWindmills_windColor, Color.WHITE);
array.recycle();
}
//抗锯齿
mPaint.setAntiAlias(true);
mPaint.setColor(mColor);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int heiMeasure = MeasureSpec.getSize(heightMeasureSpec);
int heiMode = MeasureSpec.getMod