Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.4系统,ENVolumeView喇叭不显示 #3

Closed
9468lgy opened this issue Nov 28, 2016 · 4 comments
Closed

4.4系统,ENVolumeView喇叭不显示 #3

9468lgy opened this issue Nov 28, 2016 · 4 comments

Comments

@9468lgy
Copy link

9468lgy commented Nov 28, 2016

4.4系统,ENVolumeView喇叭不显示,声波显示,暂时没有其他4的系统,5.0及以上测没事...

@codeestX
Copy link
Owner

@9468lgy Hello,这个库中绘制圆弧使用的都是仅支持5.0以上的API public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, @NonNull Paint paint) 如果需要兼容5.0以下需要自己把源码中相应的方法替换为public void drawArc(@NonNull RectF oval, float startAngle, float sweepAngle, boolean useCenter, @NonNull Paint paint)这种写法

@9468lgy
Copy link
Author

9468lgy commented Nov 28, 2016

@codeestX 这个我替换了,声波可以展示,但是喇叭没有了 ,,我看绘制喇叭用的是
mDstPath.reset(); //嗷~ 在这画喇叭
mPathMeasure.getSegment(0, mPathLength * 0.38f - mPathLength * 0.13f * mFraction, mDstPath, true);
canvas.drawPath(mDstPath, mBgPaint);
mDstPath.reset();
还是我看错方法了??

@9468lgy
Copy link
Author

9468lgy commented Nov 28, 2016

@codeestX 坑.. 不是代码问题,,是硬件加速问题
setLayerType(View.LAYER_TYPE_SOFTWARE, null); 设置了之后就好了...谢谢你及时的回答,控件很好用:)

@9468lgy 9468lgy closed this as completed Nov 28, 2016
@codeestX
Copy link
Owner

@9468lgy 嗯嗯 这里有提到 如果在安卓4.4或者之前的版本,在默认开启硬件加速的情况下,更改 dst 的内容后可能绘制会出现问题,请关闭硬件加速或者给 dst 添加一个单个操作,例如: dst.rLineTo(0, 0) 问题解决了就好^ ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants