package Ġcom . an ang kur . wall paper . features . home . adapter Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . an ang kur . wall paper . data . model . Wall paper Ċ import Ġcom . an ang kur . wall paper . features . home . databinding . Item Suggestion Binding Ċ import Ġcom . an ang kur . wall paper . utils . setImage Url Ċ Ċ class ĠSuggest ion Adapter ( private Ġval ĠonClick : Ġ( Wall paper ) Ġ-> ĠUnit ) Ġ: ĠRecyclerView . Adapter < Suggestion Adapter . ViewHolder >() Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġitems Ġ= ĠArrayList < Wall paper >() ĊĊĠĠĠ Ġinner Ġclass ĠViewHolder ( private Ġval Ġbinding : ĠItem Suggestion Binding ) Ġ: ĠRecyclerView . ViewHolder ( binding . root ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġbind ( item : ĠWall paper ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . iv Suggestion . setImage Url ( item . thumbnail Url ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . root . setOnClickListener Ġ{ ĠonClick ( item ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠViewHolder ( Item Suggestion Binding . inflate ( LayoutInflater . from ( parent . context ), Ġparent , Ġfalse )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġholder . bind ( items [ position ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġitems . size ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Items ( items : ĠList < Wall paper >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . items . clear () ĊĠĠĠĠĠĠĠ Ġthis . items . addAll ( items ) ĊĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠ Ġ} Ċ }