recyclerview onclicklistener kotlin
val data = list[position]holder.itemView.setOnClickListener { cellClickListener.onCellClickListener(data)}
recyclerview onclicklistener kotlin
val data = list[position]holder.itemView.setOnClickListener { cellClickListener.onCellClickListener(data)}
button inside a recycle view in android in kotlin
fun intialize(item: PacketModel, action: onPacketItemClickListener) {
var date = (((item.date) as Timestamp).seconds) * 1000L
fun convertLongToTime(time: Long): String {
val date = Date(time)
val format = SimpleDateFormat("yyyy.MM.dd HH:mm")
format.timeZone = TimeZone.getTimeZone("GMT+5")
return format.format(date)
}
var convertedDate = convertLongToTime(date)
packetTime.text = convertedDate
timeMessage.text = ""
drugs.text = item.drugs
note.text = item.notes
dosage.text = item.dosage
itemView.setOnClickListener {
action.onCardClick(item, adapterPosition)
}
myButton.setOnClickListener {
// Do whatever you want on your button click as like you did to your recycler-view item click
//action.onCardClick(item, adapterPosition)
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us