package Ġcom . mo hs en oid . rick and mort y . view . episode . list . adapter Ċ Ċ import Ġandroid . annotation . Suppress Lint Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . mo hs en oid . rick and mort y . databinding . Item Episode Binding Ċ import Ġcom . mo hs en oid . rick and mort y . view . model . View Episode Item Ċ import Ġjava . util . ArrayList Ċ Ċ class ĠEp isode ListAdapter Ġ: ĊĠĠĠ ĠRecyclerView . Adapter < Episode ViewHolder >() Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġepisode s : ĠMutable List < View Episode Item > Ġ= ĠArrayList () ĊĊĠĠĠ Ġ@ Suppress Lint (" Notify DataSet Changed ") ĊĠĠĠ Ġfun Ġset Episode s ( episodes : ĠList < View Episode Item >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . episodes Ġ= Ġepisode s . to Mutable List () ĊĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠEp isode ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= ĠItem Episode Binding . inflate ( LayoutInflater . from ( parent . context ), Ġparent , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn ĠEp isode ViewHolder ( binding ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠEp isode ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġepisode : ĠView Episode Item Ġ= Ġepisode s [ position ] ĊĠĠĠĠĠĠĠ Ġholder . set Episode ( episode ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġepisode s . size ĊĠĠĠ Ġ} Ċ } Ċ