TicketView.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:ticket-view 作者:
private void init(AttributeSet attrs) {
    eraser.setXfermode(new PorterDuffXfermode(Mode.CLEAR));

    dashPaint.setARGB(255, 200, 200, 200);
    dashPaint.setStyle(Style.STROKE);
    dashPaint.setStrokeWidth(4);
    dashPaint.setPathEffect(new DashPathEffect(new float[] { 4, 8 }, 0));

    borderPaint.setARGB(255, 200, 200, 200);
    borderPaint.setStyle(Style.STROKE);
    borderPaint.setStrokeWidth(4);

    setLayerType(LAYER_TYPE_HARDWARE, null);

    TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.TicketView);
    try {
        orientation = a.getInt(R.styleable.TicketView_tv_orientation, Orientation.VERTICAL);
        holeRadius = a.getFloat(R.styleable.TicketView_tv_holeRadius, DEFAULT_RADIUS);
        anchorViewId = a.getResourceId(R.styleable.TicketView_tv_anchor, NO_VALUE);
    } finally {
        a.recycle();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号