Я устанавливаю базу данных в виде базы данных firebase с помощью recyclerView, используя kotlin
Я хочу работать с нумерацией строк в tableVieew
override fun onBindViewHolder(p0: ViewHolder, p1: Int) {
val recyclerView1 = listAdapter[p1]
p0.name.text = recyclerView1.name
p0.numbringRow = here I want code
p0.scoreVaule.text = recyclerView1.scoreVaule.toString()
Picasso.get().load(recyclerView1.profileImageurl).into(p0.imageView)
}
Я хочу нумерацию и сортировку по большому номеру
val RV4 = findViewById(R.id.recyclerView3) as RecyclerView
RV4.layoutManager = LinearLayoutManager(this, LinearLayout.VERTICAL, false)
val Recycler33 = ArrayList<ListCellForLeaderBoard>()
ref.child("Score").orderByChild("scoreVaule").limitToLast(200).addValueEventListener(object : ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
try{
val td = dataSnapshot.value as HashMap<String,Any>
Recycler33.clear()
for (q2 in td.keys){
val data = td[q2] as HashMap<String,Any>
Recycler33.add(ListCellForLeaderBoard(
data["name"] as String?,
data["profileImageurl"] as String?,
data["scoreVaule"] as Long?
))
}
val adapter3 = RecyclerViewAdapterLeaderBoard(Recycler33)
RV4.adapter = adapter3
}catch (ex:Exception){
println("It is not found")
}
}})