first sb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public (Context context) {
this(context, null);
}
public (Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public (Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
* 获取自定义参数
*/
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TipView,defStyleAttr,0);
radius = ta.getDimension(R.styleable.TipView_radius,radius);
arrowHeight = ta.getDimension(R.styleable.TipView_arrowHeight, arrowHeight);
bgColor = ta.getColor(R.styleable.TipView_bgColor, bgColor);
bgColor_pressed = ta.getColor(R.styleable.TipView_bgColor_pressed, bgColor_pressed);
direction = ta.getInt(R.styleable.TipView_direction, direction);
nowColor = bgColor;
ta.recycle();
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
init();
}

noce

goog