package Ġgr ack . dev . mov ied agger . ui . caster Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . databinding . ViewData Binding Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġgr ack . dev . mov ied agger . BR Ċ import Ġgr ack . dev . mov ied agger . R Ċ import Ġgr ack . dev . mov ied agger . databinding . Item K now s As Binding Ċ import Ġkotlinx . android . synt hetic . main . item _ know s _ as . view .* Ċ Ċ class ĠC aster Adapter ( val Ġlist : ĠList < String >) Ġ: ĠRecyclerView . Adapter < C aster Adapter . ViewHolder >() Ġ{ ĊĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠViewHolder Ġ{ ĊĠĠĠ Ġval Ġinflater Ġ= ĠLayoutInflater . from ( parent . context ) ĊĠĠĠ Ġval Ġview Ġ= ĠItem K now s As Binding . inflate ( in flater , Ġparent , Ġfalse ) ĊĊĠĠĠ Ġreturn ĠViewHolder ( view ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠgetItem Count () Ġ= Ġlist . size ĊĊĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠ Ġholder . bind ( list [ position ]) ĊĊĠĠĠ Ġif Ġ( position Ġ% Ġ 2 Ġ== Ġ 0 ) Ġ{ ĊĠĠĠĠĠ Ġholder . binding . root . text _ known _ as . setBackground Resource ( R . color . nob el _ B 3 B 3 B 3 ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġholder . binding . root . text _ known _ as . setBackground Resource ( R . color . white _ FFFFFF ) ĊĠĠĠ Ġ} ĊĊĠ Ġ} ĊĊĠ Ġinner Ġclass ĠViewHolder ( val Ġbinding : ĠView Data Binding ) Ġ: ĠRecyclerView . ViewHolder ( binding . root ) Ġ{ ĊĊĠĠĠ Ġfun Ġbind ( response : ĠString ) Ġ{ ĊĠĠĠĠĠ Ġbinding . set Variable ( BR . viewModel , Ġresponse ) ĊĠĠĠĠĠ Ġbinding . execute Pending Bindings () ĊĠĠĠ Ġ} ĊĊĠ Ġ} Ċ Ċ }