package Ġcom . raph ael . car val ho . eng _ zap _ challenge _ kotlin . list aim ove is . fragment . adapter Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . recyclerview . widget . RecyclerView . Adapter Ċ import Ġandroidx . recyclerview . widget . RecyclerView . ViewHolder Ċ import Ġcom . raph ael . car val ho . eng _ zap _ challenge _ kotlin . R Ċ import Ġcom . raph ael . car val ho . eng _ zap _ challenge _ kotlin . list aim ove is . fragment . Lista I move is Fragment . On I mo vel Se lecion ado Ċ import Ġcom . raph ael . car val ho . eng _ zap _ challenge _ kotlin . list aim ove is . user case . model . I mo vel Ċ import Ġcom . raph ael . car val ho . eng _ zap _ challenge _ kotlin . util . to Re ais Ċ Ċ class ĠList a I move is Adapter ( ĊĠĠĠ Ġval Ġlistener : ĠOn I mo vel Se lecion ado Ċ ) Ġ: ĠAdapter < I mo vel VH >() Ġ{ ĊĠĠĠ Ġprivate Ġval Ġim ove is Ġ= ĠArrayList < I mo vel >() ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠI mo vel VH Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= ĠLayoutInflater . from ( parent . context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. inflate ( R . layout . item _ imo vel , Ġparent , Ġfalse ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠI mo vel VH ( view , Ġlistener ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count () Ġ= Ġim ove is . size ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠI mo vel VH , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġholder . bind ( im ove is [ position ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġadd I move is ( im ove is : ĠList < I mo vel >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . im ove is . addAll ( im ove is ) ĊĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠI mo vel VH ( ĊĠĠĠ ĠitemView : ĠView , ĊĠĠĠ Ġlistener : ĠOn I mo vel Se lecion ado Ċ ) Ġ: ĠViewHolder ( item View ) Ġ{ ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġim o vel : ĠI mo vel ĊĊĠĠĠ Ġprivate Ġval Ġtv Tipo Neg oc io Ġ= ĠitemView . findViewById < TextView >( R . id . tv _ tipo _ neg oc io ) ĊĠĠĠ Ġprivate Ġval Ġtv Valor Ġ= ĠitemView . findViewById < TextView >( R . id . tv _ valor ) ĊĠĠĠ Ġprivate Ġval Ġtv Q td Qu ar tos Ġ= ĠitemView . findViewById < TextView >( R . id . tv _ q td _ qu ar tos ) ĊĠĠĠ Ġprivate Ġval Ġtv Q td Ban he iros Ġ= ĠitemView . findViewById < TextView >( R . id . tv _ q td _ ban he iros ) ĊĠĠĠ Ġprivate Ġval Ġtv Q td V ag as Ġ= ĠitemView . findViewById < TextView >( R . id . tv _ q td _ v ag as ) ĊĠĠĠ Ġprivate Ġval Ġtv M 2 Ġ= ĠitemView . findViewById < TextView >( R . id . tv _ m 2 ) ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠitemView . setOnClickListener Ġ{ Ġlistener . on I mo vel Se lecion ado ( imo vel ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġbind ( imo vel : ĠI mo vel ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . imo vel Ġ= Ġim o vel ĊĊĠĠĠĠĠĠĠ Ġtv Tipo Neg oc io . context . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtv Tipo Neg oc io . setText ( imo vel . nome Neg oc io ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtv Valor . text Ġ= ĠgetString ( R . string . valor _ imo vel _ 1 s , Ġim o vel . valor I mo vel . to Re ais ()) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtv Q td Qu ar tos . text Ġ= ĠgetString ( R . string . q td _ qu ar tos _ 1 d , Ġim o vel . q td Qu ar tos ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtv Q td Ban he iros . text Ġ= ĠgetString ( R . string . q td _ ban he iros _ 1 d , Ġim o vel . q td Ban he iros ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtv Q td V ag as . text Ġ= ĠgetString ( R . string . q td _ v ag as _ 1 d , Ġim o vel . q td V ag as ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtv M 2 . text Ġ= ĠgetString ( R . string . m 2 _ 1 d , Ġim o vel . area M 2 ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }