feat:恢复创建游戏房间功能
This commit is contained in:
@@ -4,6 +4,8 @@ import android.annotation.SuppressLint
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.avroom.adapter.CreateRoomGameAdapter
|
||||
import com.chwl.app.base.BaseActivity
|
||||
@@ -30,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()
|
||||
|
@@ -61,7 +61,6 @@
|
||||
android:button="@null" />
|
||||
|
||||
<RadioButton
|
||||
android:visibility="gone"
|
||||
android:id="@+id/rb_game_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
Reference in New Issue
Block a user