Package com example computergraphics import android os. Bundle


} binding.image.setOnClickListener {



Download 200,3 Kb.
bet2/20
Sana08.01.2022
Hajmi200,3 Kb.
#331779
1   2   3   4   5   6   7   8   9   ...   20
Bog'liq
Kompyuter Grafikasi

}
binding.image.setOnClickListener {
listener?.invoke(adapterPosition)

}

}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): Vh {


return Vh(ItemInfoBinding.inflate(LayoutInflater.from(parent.context), parent, false))
}

override fun onBindViewHolder(holder: Vh, position: Int) {


holder.onBind(list[position])

}

override fun getItemCount(): Int = list.size



fun setListener(block: (Int) -> Unit) {
listener = block

}
}


interface OnMyClickListener1 {
fun onMyClick(position: Int, info: Info)
fun setImage(position: Int, info: Info, imageView: Int)
}

package com.example.computergraphics.adapters

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import androidx.recyclerview.widget.RecyclerView
import com.example.computergraphics.R
import com.example.computergraphics.databinding.ItemRvBinding
import com.example.computergraphics.utils.Lectures

class RvAdapter(var list: ArrayList, val onMyClickListener: OnMyClickListener) :


RecyclerView.Adapter() {

inner class Vh(var binding: ItemRvBinding) : RecyclerView.ViewHolder(binding.root) {


fun onBind(lectures: Lectures) {
binding.syllabus.text = lectures.name
binding.imageView.setImageResource(lectures.image!!)
binding.lectures.text = lectures.countLectures
binding.textCount.text = lectures.progressCount.toString()
binding.progressBar.progress = lectures.progressCount!!.toInt()
binding.item.setOnClickListener {
onMyClickListener.onMyClick(adapterPosition, lectures)

Download 200,3 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   20




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish