This commit is contained in:
叶子维
2025-03-06 09:28:34 +08:00
parent b719763f2d
commit 7e079bc8fa

View File

@ -923,6 +923,7 @@ class GameDetailFragment : LazyFragment(), IScrollable {
// 登录事件/礼包状态变更事件
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(reuse: EBReuse) {
if (!::viewModel.isInitialized) return
if (reuse.type == Constants.LOGIN_TAG || (reuse.type == Constants.LIBAO_CHANGED_TAG && !isSupportVisible)) {
viewModel.getUserRelatedInfoAndGiftStatus()
}
@ -931,6 +932,7 @@ class GameDetailFragment : LazyFragment(), IScrollable {
// 更新评分
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(data: EBStar) {
if (!::binding.isInitialized) return
if (binding.scoreContainer.isVisible) {
val showScore = data.commentCount > 3
binding.scoreIv.setImageResource(if (showScore) R.drawable.text_game_detail_score else R.drawable.text_game_detail_no_score)
@ -996,6 +998,8 @@ class GameDetailFragment : LazyFragment(), IScrollable {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
if (!::binding.isInitialized || !::viewModel.isInitialized) return
binding.coverSfv.run {
setIndicatorBackground(com.gh.gamecenter.common.R.drawable.background_shape_white_radius_999.toDrawable(requireContext()))
setTextColor(