am
06/23/2019, 10:58 AMabstract class CardHolder<T:RecyclerView.ViewHolder>{
lateinit var actionListener: CardActionListener
abstract fun onCreateViewHolder(parent: ViewGroup): T
abstract fun onBindViewHolder(holder:T, card: Card, position: Int)
}
which will be extended to do inflationa and other formalities to display data,
class NewCardDelegate:CardViewHolder<NewHolder>{
//Rest of code
}
the reason I was doing this so that I could define a mutableMap<Int,CardHolder> and reduce the Adapter class
val map =mutableMapOf<Int,CardHolder>
map[25] = NewCard() //error
but it seems like its not right way
Please guide me for any other better waykarelpeeters
06/23/2019, 11:00 AMCardHolder<*>
as the map value type.am
06/23/2019, 11:08 AMPavlo Liapota
06/23/2019, 11:28 AM