package Ġcom . example . gh oul s Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . example . gh oul s . databinding . Front Song View Binding Ċ Ċ class ĠS ongs Adapter ( private Ġval Ġcontext : ĠContext , Ġprivate Ġval Ġmusic List : ĠArrayList < Music >): RecyclerView . Adapter < S ongs Adapter . My Holder >() Ġ{ ĊĠĠĠ Ġclass ĠMy Holder Ġ( binding : ĠFront Song View Binding ): RecyclerView . ViewHolder ( binding . root ){ ĊĠĠĠĠĠĠĠ Ġval Ġtitle Ġ= Ġbinding . song Name ĊĠĠĠĠĠĠĠ Ġval Ġalbum Ġ= Ġbinding . song Album ĊĠĠĠĠĠĠĠ Ġval Ġimage Ġ= Ġbinding . image view ĊĠĠĠĠĠĠĠ Ġval Ġduration Ġ= Ġbinding . song Duration ĊĠĠĠĠĠĠĠ Ġval Ġroot Ġ= Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠS ongs Adapter . My Holder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMy Holder ( Front Song View Binding . inflate ( LayoutInflater . from ( context ), parent , false )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠS ongs Adapter . My Holder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġholder . title . text Ġ= Ġmusic List [ position ]. title ĊĠĠĠĠĠĠĠ Ġholder . album . text Ġ= Ġmusic List [ position ]. album ĊĠĠĠĠĠĠĠ Ġholder . duration . text Ġ= Ġmusic List [ position ]. duration . toString () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġmusic List . size ĊĠĠĠ Ġ} ĊĊ Ċ }