/* Ċ Ġ* ĠÂ© Ġ 2 0 1 8 ĠMatch ĠGroup , ĠLLC . Ċ Ġ*/ Ċ Ċ package Ġcom . t inder . app . sse . stock price . view Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . t inder . R Ċ import Ġcom . t inder . app . sse . stock price . domain . Stock Price Ċ Ċ class ĠStock Price Adapter Ġ: ĠRecyclerView . Adapter < Stock Price ViewHolder >() Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġstock Prices : ĠList < Stock Price > Ġ= Ġempty List () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠStock Price ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= ĠLayoutInflater . from ( parent . context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. inflate ( R . layout . view _ stock _ price _ item , Ġparent , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn ĠStock Price ViewHolder ( view ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ= Ġstock Prices . size ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠStock Price ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstock Price Ġ= Ġstock Prices [ position ] ĊĠĠĠĠĠĠĠ Ġholder . stock Name . text Ġ= Ġstock Price . title ĊĠĠĠĠĠĠĠ Ġholder . stock Price . text Ġ= Ġ"\ $ ${ stock Price . price }" ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Stock Prices ( stock Prices : ĠList < Stock Price >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . stock Prices Ġ= Ġstock Prices ĊĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠ Ġ} Ċ } Ċ