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
private val renderer by lazy { TypedDanmakuRenderer( simpleRenderer, DanmakuItemData.DANMAKU_STYLE_USER_AVATAR to UpLogoRenderer( ResourcesCompat.getDrawable(resources, R.drawable.icon_danmaku_input_text_up_icon, theme)!! ) ) } 相当于这个DanmaPlayer都得用这个user_avatar,不是应该不同的弹幕各自设置自己的icon吗? 每次自己发送弹幕时,设置的danmakuStyle使用的icon都是事先设置好的
The text was updated successfully, but these errors were encountered:
DanmakuItemData 可以自定义自己的类,拿到之后可以获取到自己的数据
Sorry, something went wrong.
感谢点拨,我自己自定义了一个AvatarRenderer,其中的drawable不再初始化DanmakuPlayer传入renderer时就设置,而是在解析json updatItem时先加载icon,加载成功后向DanmakuItem传入得到的drawable,最终AvatarRenderer measure和draw时拿取DanmaItem中的drawable进行测量绘制就可以了,这样每一条弹幕都能单独配置自己的Icon。
No branches or pull requests
private val renderer by lazy {
TypedDanmakuRenderer(
simpleRenderer,
DanmakuItemData.DANMAKU_STYLE_USER_AVATAR to UpLogoRenderer(
ResourcesCompat.getDrawable(resources, R.drawable.icon_danmaku_input_text_up_icon, theme)!!
)
)
}
相当于这个DanmaPlayer都得用这个user_avatar,不是应该不同的弹幕各自设置自己的icon吗?
每次自己发送弹幕时,设置的danmakuStyle使用的icon都是事先设置好的
The text was updated successfully, but these errors were encountered: