package Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers list . presentation . view Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . recyclerview . widget . Default Item Animator Ċ import Ġandroidx . recyclerview . widget . Divider Item Decoration Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . R Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . base . presentation . Base Activity Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers detail . Av enger Detail Activity Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers list . domain . entities . Av enger Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers list . domain . entities . Result Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers list . presentation . presenter . Av engers List Presenter View Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers list . presentation . presenter . List Av enger Presenter Impl Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . features . av engers list . presentation . view . adapter . Av engers ListAdapter Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . utils . Constants . AV EN GER _ KEY Ċ import Ġcom . ad ict os al ain form atic a . kotlin clean . utils . Constants . AV EN GER _ LIST _ PRES ENTER Ċ import Ġkotlinx . android . synt hetic . main . activity _ main .* Ċ import Ġorg . k oin . android . ext . android . inject Ċ import Ġorg . k oin . android . scope . ext . android . bind Scope Ċ import Ġorg . k oin . android . scope . ext . android . get OrCreate Scope Ċ import Ġtim ber . log . Tim ber Ċ Ċ class ĠMainActivity Ġ: ĠBase Activity (), ĠAv engers List Presenter View , ĠAv engers ListAdapter . On Av enger ListItem Clicked Listener Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġav engers List Presenter : ĠList Av enger Presenter Impl Ġby Ġinject () ĊĠĠĠ Ġprivate Ġvar Ġadapter : ĠAv engers ListAdapter ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġbind Scope ( get OrCreate Scope ( AV EN GER _ LIST _ PRES ENTER )) ĊĠĠĠĠĠĠĠ Ġav engers List Presenter . attach View ( this , Ġlifecycle ) ĊĊĠĠĠĠĠĠĠ Ġcreate Av engers ListAdapter () ĊĠĠĠĠĠĠĠ Ġav engers List Presenter . load Av engers () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Av engers ListAdapter () Ġ{ ĊĠĠĠĠĠĠĠ Ġadapter Ġ= ĠAv engers ListAdapter () ĊĠĠĠĠĠĠĠ Ġadapter ?. setOn Av enger ListItem Clicked Listener ( this ) ĊĠĠĠĠĠĠĠ Ġav enger _ list _ recyclerview . layout Manager Ġ= ĠLinearLayoutManager ( this , ĠRecyclerView . VERTICAL , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġav enger _ list _ recyclerview . item Animator Ġ= ĠDefault Item Animator () ĊĠĠĠĠĠĠĠ Ġav enger _ list _ recyclerview . addItem Decoration ( Divider Item Decoration ( this , ĠLinearLayoutManager . VERTICAL )) ĊĠĠĠĠĠĠĠ Ġav enger _ list _ recyclerview . adapter Ġ= Ġadapter ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Av engers List Loaded ( av engers List : ĠList < Result >) Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" Av engers Ġlist Ġloaded ") ĊĠĠĠĠĠĠĠ Ġadapter ?. set Av engers List ( av engers List ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Av enger ListItem Clicked ( av enger Model : ĠResult ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġav enger Model ?. let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" av enger Ġname : Ġ" Ġ+ Ġit . name ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( application Context , ĠAv enger Detail Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval ĠimageUrl Ġ= Ġit . thumbnail ?. path Ġ+ Ġ"." Ġ+ Ġit . thumbnail ?. extension ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġav enger Ġ= ĠAv enger ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( it . name . or Empty ()), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( it . modified . or Empty ()), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( imageUrl ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( it . description . or Empty ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġintent . putExtra ( AV EN GER _ KEY , Ġav enger ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( intent ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ