package Ġandroid . ih ork ost enko . anime pedia . presentation . ui . adapters Ċ Ċ import Ġandroid . ih ork ost enko . anime pedia . domain . entities . An ime Character Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġan ime pedia . android . ih ork ost enko . anime pedia . databinding . Item Character Binding Ċ Ċ class ĠChar acters RecyclerView Adapter ( ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġcharacters : ĠList < An ime Character >) ĊĠĠĠ Ġ: ĠRecyclerView . Adapter < Characters RecyclerView Adapter . ViewHolder >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinflater Ġ= ĠLayoutInflater . from ( parent . context ) ĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= ĠItem Character Binding . inflate ( in flater , Ġparent , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn ĠViewHolder ( binding ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠnewValue ( characters : ĠList < An ime Character >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . characters Ġ= Ġcharacters ĊĠĠĠĠĠĠĠ Ġnotify Item Inserted ( 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ= Ġcharacters . size ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠViewHolder , Ġposition : ĠInt ) Ġ= Ġholder . bind ( characters [ position ]) ĊĊĠĠĠ Ġinner Ġclass ĠViewHolder ( private Ġval Ġbinding : ĠItem Character Binding ) Ġ: ĠRecyclerView . ViewHolder ( binding . root ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġbind ( item : ĠAn ime Character ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . data Ġ= Ġitem ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . execute Pending Bindings () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ