All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.sceyt.chatuikit.presentation.components.role.adapter.ChooseRoleViewHolder.kt Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package com.sceyt.chatuikit.presentation.components.role.adapter

import androidx.recyclerview.widget.RecyclerView
import com.sceyt.chatuikit.databinding.SceytItemChooseRoleBinding

class ChooseRoleViewHolder(private val binding: SceytItemChooseRoleBinding,
                           private val clickListener: ChooseRoleAdapter.ChooseRoleListener
) : RecyclerView.ViewHolder(binding.root) {

    fun bindTo(roleItem: RoleItem) {
        with(binding) {
            rbRole.text = roleItem.role.name
            rbRole.isChecked = roleItem.checked

            rbRole.setOnClickListener {
                if (roleItem.checked) return@setOnClickListener
                clickListener.onRoleClick(roleItem)
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy