package Ġcom . ruby food . features . stock Comp et et or Stock . adapter Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġandroid . view . ContextMenu Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . ruby food . R Ċ import Ġcom . ruby food . app . domain . Comp et et or Stock Entry Product Model Entity Ċ import Ġkotlinx . android . synt hetic . main . row _ com _ stock _ product _ list . view .* Ċ Ċ class ĠAdapter Com Stock Product ( val Ġcontext : ĠContext , val Ġstock List : List < Comp et et or Stock Entry Product Model Entity >): ĠRecyclerView . Adapter < Adapter Com Stock Product . Com Stock Product ViewHolder > (){ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠCom Stock Product ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= ĠLayoutInflater . from ( context ). inflate ( R . layout . row _ com _ stock _ product _ list , parent , false ) ĊĠĠĠĠĠĠĠ Ġreturn ĠCom Stock Product ViewHolder ( view ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġstock List ?. size ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠCom Stock Product ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġholder . tv _ brand . text = stock List ?. get ( position )?. brand _ name ĊĠĠĠĠĠĠĠ Ġholder . tv _ product . text = stock List ?. get ( position )?. product _ name ĊĠĠĠĠĠĠĠ Ġholder . tv _ qty . text = stock List ?. get ( position )?. qty ĊĠĠĠĠĠĠĠ Ġholder . tv _ mr p . text = stock List ?. get ( position )?. mr p ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinner Ġclass ĠCom Stock Product ViewHolder ( item View : ĠView ): ĠRecyclerView . ViewHolder ( item View ){ ĊĠĠĠĠĠĠĠ Ġval Ġtv _ brand = item View . tv _ row _ view _ stock _ products _ brand ĊĠĠĠĠĠĠĠ Ġval Ġtv _ product = item View . tv _ row _ view _ stock _ products _ product ĊĠĠĠĠĠĠĠ Ġval Ġtv _ qty = item View . tv _ row _ view _ stock _ products _ qty ĊĠĠĠĠĠĠĠ Ġval Ġtv _ mr p = item View . tv _ row _ view _ stock _ products _ mr p ĊĠĠĠ Ġ} Ċ Ċ }