先看看效果,圆形波纹无线扩散,大概就是这个样子
github地址:https://github.com/Larissa-x/WaveView
直接依赖
implementation 'com.github.Larissa-x:WaveView:1.0.1'
别忘了添加支持jitpack库
repositories {
maven { url 'https://jitpack.io' }
}
上代码,使用自定义View
public class WaveView extends View {
private Paint paint;
private int maxWidth = 360;
// 是否运行
private boolean isStarting = false;
private List<String> alphaList = new ArrayList<String>();
private List<String> startWidthList = new ArrayList<String>();
public WaveView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
public WaveView(Context co