@Override // will be called on UI thread
public void onSurfaceTextureAvailable(SurfaceTexture st, int width, int height) {
Log.d(TAG, "onSurfaceTextureAvailable(" + width + "x" + height + ")");
mWidth = width;
mHeight = height;
mMaxAmpl = height / 2;
mPaints.get(0).setShader(new LinearGradient(0, 0, mWidth, mHeight, Color.parseColor("#CA67B7"), Color.parseColor("#C081C1"), Shader.TileMode.MIRROR));
mPaints.get(0).setStrokeWidth(ScreenUtils.dp2px(getContext(), 2));
mPaints.get(1).setColor(Color.parseColor("#D5E3FA"));
mPaints.get(1).setStrokeWidth(ScreenUtils.dp2px(getContext(), 2));
mPaints.get(2).setStrokeWidth(ScreenUtils.dp2px(getContext(), 1));
mPaints.get(3).setStrokeWidth(ScreenUtils.dp2px(getContext(), 1));
mPaints.get(2).setShader(new LinearGradient(0, 0, mWidth, mHeight, Color.parseColor("#E67EA5"), Color.parseColor("#7F7AE1"), Shader.TileMode.MIRROR));
mPaints.get(3).setShader(new LinearGradient(0, 0, mWidth, mHeight, Color.parseColor("#E67EA5"), Color.parseColor("#7F7AE1"), Shader.TileMode.MIRROR));
synchronized (mLock) {
mSurfaceTexture = st;
mLock.notify();
}
}
VoiceWaveViewTV.java 文件源码
java
阅读 42
收藏 0
点赞 0
评论 0
项目:WaveAudioVizualization
作者:
评论列表
文章目录