package Ġorg . simple . clin ic . drug s . selection Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . Image Button Ċ import Ġandroid . widget . TextView Ċ import Ġcom . x wr ay . group ie . ViewHolder Ċ import Ġio . reactivex . subjects . Subject Ċ import Ġk ot ter knife . bind View Ċ import Ġorg . simple . clin ic . R Ċ import Ġorg . simple . clin ic . drug s . Pre scribed Dr ug Ċ import Ġorg . simple . clin ic . summary . Group ie Item With Ui Events Ċ import Ġorg . simple . clin ic . widgets . Ui Event Ċ Ċ data Ġclass ĠCustom Pre scribed Dr ug ListItem ( ĊĠĠĠ Ġval Ġpre scription : ĠPre scribed Dr ug Ċ ) Ġ: ĠGroup ie Item With Ui Events < Custom Pre scribed Dr ug ListItem . Dr ug ViewHolder >( pre scription . hashCode (). to Long ()) Ġ{ ĊĊĠ Ġoverride Ġlateinit Ġvar Ġui Events : ĠSubject < Ui Event > ĊĊĠ Ġoverride Ġfun Ġget Layout () Ġ= ĠR . layout . list _ pre scribed drug s _ custom _ drug ĊĊĠ Ġoverride Ġfun Ġcreate ViewHolder ( item View : ĠView ): ĠDr ug ViewHolder Ġ{ ĊĠĠĠ Ġval Ġholder Ġ= ĠDr ug ViewHolder ( item View ) ĊĠĠĠ Ġholder . delete Button . setOnClickListener Ġ{ ĊĠĠĠĠĠ Ġui Events . onNext ( Delete Custom Pre scription Clicked ( pre scription )) ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġholder ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġbind ( holder : ĠDr ug ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠ Ġholder . name TextView . text Ġ= Ġpre scription . name ĊĠĠĠ Ġholder . dos age TextView . text Ġ= Ġpre scription . dos age ĊĠ Ġ} ĊĊĠ Ġclass ĠDr ug ViewHolder ( root View : ĠView ) Ġ: ĠViewHolder ( root View ) Ġ{ ĊĠĠĠ Ġval Ġname TextView Ġby Ġbind View < TextView >( R . id . pre scribed drug _ item _ custom drug _ name ) ĊĠĠĠ Ġval Ġdos age TextView Ġby Ġbind View < TextView >( R . id . pre scribed drug _ item _ custom drug _ dos age ) ĊĠĠĠ Ġval Ġdelete Button Ġby Ġbind View < Image Button >( R . id . pre scribed drug _ item _ custom drug _ delete ) ĊĠ Ġ} Ċ } Ċ