|
@@ -134,6 +134,19 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
|
|
|
binding.rvAudioUser.layoutManager = LinearLayoutManager(activity,RecyclerView.HORIZONTAL,false)
|
|
|
binding.rvAudioUser.adapter = adapter
|
|
|
adapter.setOnItemClickListener { _, view, position ->
|
|
|
+ if (type == 2){
|
|
|
+ if (adapter.data[position].selected){
|
|
|
+ return@setOnItemClickListener
|
|
|
+ }
|
|
|
+ adapter.data.forEachIndexed { index, maiUserInfo ->
|
|
|
+ adapter.data[index].selected = false
|
|
|
+ }
|
|
|
+ adapter.data[position].selected = true
|
|
|
+ selectedUserList.clear()
|
|
|
+ selectedUserList.add(adapter.data[position].user_id)
|
|
|
+ adapter.notifyDataSetChanged()
|
|
|
+ return@setOnItemClickListener
|
|
|
+ }
|
|
|
adapter.data[position].selected = !adapter.data[position].selected
|
|
|
if (adapter.data[position].selected){
|
|
|
selectedUserList.add(adapter.data[position].user_id)
|
|
@@ -326,6 +339,15 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
|
|
|
override fun onPageSelected(position: Int) {
|
|
|
type = position + 1
|
|
|
binding.combo.visibility = View.GONE
|
|
|
+ if (type == 2 && adapter.data.size > 0){
|
|
|
+ adapter.data.forEachIndexed { index, _ ->
|
|
|
+ adapter.data[index].selected = false
|
|
|
+ }
|
|
|
+ adapter.data[0].selected = true
|
|
|
+ selectedUserList.clear()
|
|
|
+ selectedUserList.add(adapter.data[0].user_id)
|
|
|
+ adapter.notifyDataSetChanged()
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|