package Ġk entic o . kont ent . delivery . sample . d ancing go at . app . articles čĊč Ċ import Ġandroid . support . v 7 . app . AppCompatActivity č Ċ import Ġandroid . os . Bundle č Ċ import Ġandroid . support . annotation . Worker Thread č Ċ import Ġandroid . widget . Array Adapter č Ċ import Ġandroid . widget . ListView č Ċ import Ġk entic o . kont ent . delivery .* č Ċ import Ġk entic o . kont ent . delivery . sample . d ancing go at . R č Ċ import Ġk entic o . kont ent . delivery . sample . d ancing go at . data . Delivery Client Provider č Ċ import Ġk entic o . kont ent . delivery . sample . d ancing go at . models . Article č Ċ import Ġkotlinx . coroutines .* č Ċ import Ġkotlinx . coroutines . future . await čĊč Ċ class ĠArticles Activity Ġ: ĠAppCompatActivity () Ġ{ čĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠlistView : ĠListView čĊčĊčĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ čĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) čĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . articles _ activity ) čĊčĊĠĠĠĠĠĠĠ ĠlistView Ġ= ĠfindViewById < ListView >( R . id . articles _ list _ view ); čĊčĊĠĠĠĠĠĠĠ ĠGlobal Scope . launch ( Dispatch ers . Main ) Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġarticles Ġ= Ġwith Context ( Dispatch ers . IO ) Ġ{ Ġload Articles () Ġ} čĊĠĠĠĠĠĠĠĠĠĠĠ Ġdisplay Articles ( articles ); čĊĠĠĠĠĠĠĠ Ġ} čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġprivate Ġfun Ġdisplay Articles ( articles : ĠMutable List < Article >) Ġ{ čĊĠĠĠĠĠĠĠ ĠlistView . adapter Ġ= ĠArticles Adapter ( this , Ġ Ġarticles . toList ()) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Worker Thread čĊĠĠĠ Ġprivate Ġsuspend Ġfun Ġload Articles (): ĠMutable List < Article > Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġclient Ġ= ĠDelivery Client Provider . client ; čĊčĊĠĠĠĠĠĠĠ Ġval Ġparams Ġ= ĠDelivery Parameter Builder . params (). filter Equals (" system . type ", Ġ" article "). build () čĊĠĠĠĠĠĠĠ Ġreturn Ġclient . getItems ( Article :: class . java , Ġparams ). await (); čĊĠĠĠ Ġ} čĊč Ċ }