最近使用到了音频播放跳动的动画view,随即自己写了一个使用。
演示效果图:
giphy.gif
AudioWaveView类:
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.View;
import java.util.Random;
public class AudioWaveView extends View {
private Paint paint;
private RectF rectF1;
private RectF rectF2;
private RectF rectF3;
private RectF rectF4;
private RectF rectF5;
private int viewWidth;
private int viewHeight;
/** 每个条的宽度 */</