下载链接:http://download.youkuaiyun.com/detail/a876434758/8905773
首先自定义一个view
package com.brucezee.circlewavedemo;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
public class CircleWaveView extends View {
private float mWidth;
private float mHeight;
private float centerX; // 圆心X
private float centerY; // 圆心Y
private float floatRadius; // 变化的半径
private float maxRadius = -1; // 圆半径
private volatile boolean started = false;
private Paint mLinePaint;
private Paint mSolidPaint;
private int waveColor = Color.LTGRAY; // Color.argb(0, 0, 0, 0); //颜色
private int waveInterval = 100; // 圆环的宽度
private boolean centerAlign = true;// 居中
private float bottomMargin = 0;// 底部margin
private boolean fillCircle = true;// 是否填充成实心圆环
public CircleWaveView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleWaveView(Context context) {
this(context, null, 0);
}
public CircleWaveView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initView();
}
private void initView() {
mLinePai