package Ġcom . the ath let ic . inter view . articles . ui Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . the ath let ic . inter view . R Ċ import Ġcom . the ath let ic . inter view . main . Main Application Ċ import Ġcom . the ath let ic . inter view . mvp . Base Activity Ċ import Ġkotlinx . android . synt hetic . main . activity _ article _ detail .* Ċ import Ġkotlinx . android . synt hetic . main . fragment _ articles .* Ċ import Ġorg . k oin . android x . view model . ext . android . get ViewModel Ċ import Ġtim ber . log . Tim ber Ċ Ċ class ĠArticle Detail Activity : ĠBase Activity < Article Detail Presenter , ĠArticle Detail Contract . ViewState > (){ ĊĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ article _ detail ) ĊĠĠĠĠĠĠĠ Ġsetup Presenter () ĊĊĠĠĠĠĠĠĠ Ġval Ġarticle Id Ġ= Ġintent . getString Extra ( Article Detail Activity :: class . java . simple Name ) !! ĊĠĠĠĠĠĠĠ Ġpresenter . get Article ById ( article Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsetup Presenter () Ġ= Ġget ViewModel < Article Detail Presenter >() ĊĊĊĠĠĠ Ġoverride Ġfun Ġrender State ( view State : ĠArticle Detail Contract . ViewState ) Ġ{ ĊĠĠĠĠĠĠĠ Ġview State . article Model ?. let Ġ{ Ġarticle Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdetail _ title . text Ġ= Ġarticle . title ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdetail _ body . text Ġ= Ġarticle . body ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMain Application . pic asso With Cache . load ( article . imageUrl ). into ( detail _ im v ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }