feat:屏蔽房间入口

This commit is contained in:
Max
2023-11-26 12:04:10 +08:00
parent 7fc1285ad7
commit f430241d9f

View File

@@ -32,35 +32,35 @@ class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
@SuppressLint("CheckResult")
override fun init() {
if(isHomeGame){
binding?.tvPlayType?.isVisible = false
binding?.rgType?.isVisible = false
binding?.rvGame?.isVisible = true
}
binding?.rvGame?.itemAnimator = null
rvDelegate = RVDelegate.Builder<GameInfo>()
.setAdapter(gameAdapter)
.setRecyclerView(binding?.rvGame)
.setLayoutManager(LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false))
.build()
// if(isHomeGame){
// binding?.tvPlayType?.isVisible = false
// binding?.rgType?.isVisible = false
// binding?.rvGame?.isVisible = true
// }
// binding?.rvGame?.itemAnimator = null
// rvDelegate = RVDelegate.Builder<GameInfo>()
// .setAdapter(gameAdapter)
// .setRecyclerView(binding?.rvGame)
// .setLayoutManager(LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false))
// .build()
gameAdapter.setOnItemClickListener { _, _, position ->
if (selectIndex != -1) {
gameAdapter.data.getOrNull(selectIndex)?.isSelect = false
gameAdapter.notifyItemChanged(selectIndex)
}
selectIndex = position
gameAdapter.data.getOrNull(selectIndex)?.isSelect = true
gameAdapter.notifyItemChanged(selectIndex)
checkCreateEnable()
}
// gameAdapter.setOnItemClickListener { _, _, position ->
// if (selectIndex != -1) {
// gameAdapter.data.getOrNull(selectIndex)?.isSelect = false
// gameAdapter.notifyItemChanged(selectIndex)
// }
// selectIndex = position
// gameAdapter.data.getOrNull(selectIndex)?.isSelect = true
// gameAdapter.notifyItemChanged(selectIndex)
// checkCreateEnable()
// }
binding?.rbGameRoom?.setOnCheckedChangeListener { _, isChecked ->
checkCreateEnable()
if (isChecked) {
binding?.rvGame?.isVisible = true
}
}
// binding?.rbGameRoom?.setOnCheckedChangeListener { _, isChecked ->
// checkCreateEnable()
// if (isChecked) {
// binding?.rvGame?.isVisible = true
// }
// }
binding?.rbPartyRoom?.setOnCheckedChangeListener { _, isChecked ->
checkCreateEnable()