We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
切换横屏后应该重新测量位置对吗?希望可以改一下,很多弹幕都是在视频上面,视屏都有横屏全屏播放的,其他功能都挺好的
The text was updated successfully, but these errors were encountered:
遇到同样的问题,请问有解决方案吗?
Sorry, something went wrong.
我这边看的问题是在 DanMuView 这个类的 onDraw方法里会进行 initChannels,里面会把一开始 Canvas 的宽度设置给 Channel,然后就不会变更了。我的处理方法是重写DanMuView 的onConfigurationChanged方法,在里面去更新宽度:
DanMuView
onDraw
initChannels
onConfigurationChanged
// DanMuView.java @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (danMuController != null) { danMuController.updateWidth(DeviceUtil.getScreenWidth(mContext)); } } // DanMuController.java public void initChannels(Canvas canvas) { mCanvas = canvas; if (!channelCreated) { speedController.setWidthPixels(canvas.getWidth()); danMuPoolManager.setSpeedController(speedController); danMuPoolManager.divide(canvas.getWidth(), canvas.getHeight()); channelCreated = true; } } public void updateWidth(final int width){ if(channelCreated && mCanvas != null){ speedController.setWidthPixels(width); danMuPoolManager.divide(width, mCanvas.getHeight()); } }
No branches or pull requests
切换横屏后应该重新测量位置对吗?希望可以改一下,很多弹幕都是在视频上面,视屏都有横屏全屏播放的,其他功能都挺好的
The text was updated successfully, but these errors were encountered: