@@ -0,0 +1,2282 @@
+package com.android.yj.viewlib;%0A%0Aimport android.content.Context;%0Aimport android.graphics.Canvas;%0Aimport android.graphics.Color;%0Aimport android.graphics.Paint;%0Aimport android.util.AttributeSet;%0Aimport android.view.MotionEvent;%0Aimport android.view.View;%0A%0A/**%0A * Created by bertyj on 2017/6/2.%0A */%0A%0Apublic class CircleView extends View %7B%0A    private Paint mCirclePaint;%0A%0A    private float mCenterX;%0A    private float mCenterY;%0A    private float mRadius;%0A%0A    private OnClickListener mClickListener;%0A%0A    public CircleView(Context context) %7B%0A        this(context, null);%0A    %7D%0A%0A    public CircleView(Context context, AttributeSet attrs) %7B%0A        this(context, attrs, 0);%0A    %7D%0A%0A    public CircleView(Context context, AttributeSet attrs, int defStyleAttr) %7B%0A        super(context, attrs, defStyleAttr);%0A        initPaints();%0A    %7D%0A%0A    public void setOnClickListener(OnClickListener listener) %7B%0A        mClickListener = listener;%0A    %7D%0A%0A    private void initPaints() %7B%0A        mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);%0A        mCirclePaint.setStyle(Paint.Style.FILL);%0A        mCirclePaint.setColor(Color.GREEN);%0A    %7D%0A%0A    @Override%0A    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) %7B%0A        int width = MeasureSpec.getSize(widthMeasureSpec);%0A        int height = MeasureSpec.getSize(heightMeasureSpec);%0A        int size = Math.min(width, height);%0A        setMeasuredDimension(size, size);%0A    %7D%0A%0A    @Override%0A    protected void onDraw(Canvas canvas) %7B%0A        canvas.drawCircle(mCenterX, mCenterY, mRadius, mCirclePaint);%0A    %7D%0A%0A    @Override%0A    protected void onSizeChanged(int w, int h, int oldw, int oldh) %7B%0A        mCenterX = w / 2f;%0A        mCenterY = h / 2f;%0A        mRadius = Math.min(w, h) / 4f;%0A    %7D%0A%0A    @Override%0A    public boolean onTouchEvent(MotionEvent event) %7B%0A        int action = event.getAction();%0A        switch (action) %7B%0A            case MotionEvent.ACTION_DOWN:%0A                if (mClickListener != null) %7B%0A                    mClickListener.onClick(this, event);%0A                %7D%0A                return true;%0A            default:%0A                break;%0A        %7D%0A        return super.onTouchEvent(event);%0A    %7D%0A%0A    public interface OnClickListener %7B%0A        void onClick(CircleView circleView, MotionEvent event);%0A    %7D%0A%0A%7D%0A

Add circle view.