package Ġtm idev . concat adapter . presentation Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . Diff Util Ċ import Ġandroidx . recyclerview . widget . ListAdapter Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġtm idev . concat adapter . databinding . Item Programming Language Binding Ċ import Ġtm idev . concat adapter . domain . Programming Language Ċ import Ġtm idev . concat adapter . presentation . Programming Language Adapter . Programming Language ViewHolder Ċ Ċ class ĠProgramming Language Adapter Ġ: ĊĠĠĠ ĠList Adapter < Programming Language , ĠProgramming Language ViewHolder >( Programming Language Diff Util ()) Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( ĊĠĠĠĠĠĠĠ Ġparent : ĠViewGroup , Ġview Type : ĠInt ĊĠĠĠ Ġ): ĠProgramming Language ViewHolder Ġ= ĠProgramming Language ViewHolder ( ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠItem Programming Language Binding . inflate ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLayoutInflater . from ( parent . context ), Ġparent , Ġfalse ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠProgramming Language ViewHolder , Ġposition : ĠInt ) Ġ= ĊĠĠĠĠĠĠĠ Ġholder . bind ( getItem ( position )) ĊĊĠĠĠ Ġclass ĠProgramming Language ViewHolder ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġbinding : ĠItem Programming Language Binding ĊĠĠĠ Ġ) Ġ: ĠRecyclerView . ViewHolder ( binding . root ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġbind ( programming Language : ĠProgramming Language ) Ġ= Ġbinding . run Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠtextView Name . text Ġ= Ġprogramming Language . name ĊĠĠĠĠĠĠĠĠĠĠĠ ĠtextView Description . text Ġ= Ġprogramming Language . par adig m ĊĠĠĠĠĠĠĠĠĠĠĠ ĠimageView Logo . setImage Resource ( programming Language . logo ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠProgramming Language Diff Util Ġ: ĠDiff Util . Item Callback < Programming Language >() Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġare Items The Same ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġold Item : ĠProgramming Language , Ġnew Item : ĠProgramming Language ĊĠĠĠĠĠĠĠ Ġ) Ġ= Ġold Item . name Ġ== Ġnew Item . name ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġare Contents The Same ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġold Item : ĠProgramming Language , Ġnew Item : ĠProgramming Language ĊĠĠĠĠĠĠĠ Ġ) Ġ= Ġold Item Ġ== Ġnew Item ĊĠĠĠ Ġ} Ċ }