package Ġcom . android . m ull ig an marker . adapter Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . android . m ull ig an marker . databinding . Score card Custom Row Binding Ċ import Ġcom . android . m ull ig an marker . model . Score card Ċ Ċ class ĠAdd Score card Adapter : ĠRecyclerView . Adapter < Add Score card Adapter . Add Score card ViewHolder >() Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġscore card List Ġ= Ġempty List < Score card >() ĊĊĠĠĠ Ġclass ĠAdd Score card ViewHolder ( val Ġbinding : ĠScore card Custom Row Binding ): ĠRecyclerView . ViewHolder ( binding . root ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġbind ( item : ĠScore card ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . score card Item Player . text Ġ= Ġitem . player _ id . toString () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . score card Item T ee Box . text Ġ= Ġitem . tee _ box _ id . toString () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠAdd Score card ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠAdd Score card ViewHolder ( Score card Custom Row Binding . inflate ( LayoutInflater . from ( parent . context ), Ġparent , Ġfalse )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠAdd Score card ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcurrent Score card Ġ= Ġscore card List [ position ] ĊĠĠĠĠĠĠĠ Ġholder . bind ( current Score card ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġscore card List . size ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Items ( item List : ĠList < Score card >) Ġ{ ĊĠĠĠĠĠĠĠ Ġscore card List Ġ= Ġitem List ĊĠĠĠ Ġ} Ċ }