Skip to content

seochaeyeoni/databinding-nested-recyclerview-issue

Repository files navigation

databinding-nested-recyclerview-issue

ISSUE Expected Result
screenshot screenshot

Description

When databinding is used in nested recyclerview, as much as the number of last recyclerview item, the number of other recyclerview item is equally forced.

Code

   override fun onBindViewHolder(holder: ViewHolder, position: Int) {
       /**
       There is an issue when writing the code as follows.
       holder.onBind(data[position])
        or
       holder.binding.times = data[position]
       **/

       //If you write the code as follows, it works as expected.
       holder.binding.day.text = data[position].day
       holder.binding.time.text = "${data[position].startTime} - ${data[position].endTime}"
   }

   class ViewHolder(val binding: MyScheduleTimeListBinding) : RecyclerView.ViewHolder(binding.root) {
       fun onBind(data: MainActivity.Times) {
           binding.times = data
       }
   }

Issue Tracker

https://issuetracker.google.com/207003888

Releases

No releases published

Packages

No packages published

Languages