override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { val thing = things.get(position) if (thing is Animal) { (holder as AnimalViewHolder).bind(thing as Animal) } else if (thing is Car) { (holder as CarViewHolder).bind(thing as Car) } ... }
Writing Better Adapters
Danny Preussler
76020

How will you fix that code?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.