package Ġnet . rf 4 3 . roy ale api kit _ example . top _ players Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . ProgressBar Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . Global Scope Ċ import Ġkotlinx . coroutines . launch Ċ import Ġnet . rf 4 3 . roy ale api kit . provider . Top Player Model Ċ import Ġnet . rf 4 3 . roy ale api kit _ example . R Ċ import Ġnet . rf 4 3 . roy ale api kit _ example . common . Base Activity Ċ import Ġnet . rf 4 3 . roy ale api kit _ example . top _ players . adapters . Top Players ListAdapter Ċ Ċ class ĠActivity Top Players Ġ: ĠBase Activity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġtop Players Adapter : ĠTop Players ListAdapter ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġtop Player Loading Indicator : ĠProgress Bar ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main _ top _ players ) ĊĊĠĠĠĠĠĠĠ Ġtop Player Loading Indicator Ġ= ĠfindViewById ( R . id . top _ player _ loading _ indicator ) ĊĠĠĠĠĠĠĠ Ġtop Player Loading Indicator . visibility Ġ= ĠView . VISIBLE ĊĊĠĠĠĠĠĠĠ Ġval Ġtop Player RecyclerView Ġ= ĠfindViewById < RecyclerView >( R . id . recycler _ top _ players ) ĊĠĠĠĠĠĠĠ Ġtop Player RecyclerView . layout Manager Ġ= ĠLinearLayoutManager ( this ) ĊĠĠĠĠĠĠĠ Ġtop Player RecyclerView . adapter Ġ= ĠTop Players ListAdapter ( context Ġ= Ġthis ) ĊĊĠĠĠĠĠĠĠ Ġtop Players Adapter Ġ= Ġtop Player RecyclerView . adapter Ġas ĠTop Players ListAdapter ĊĊĠĠĠĠĠĠĠ ĠGlobal Scope . launch ( Dispatch ers . Main ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġload Players Into List ( roy ale Api Kit . get Top Players ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtop Player Loading Indicator . visibility Ġ= ĠView . GONE ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġload Players Into List ( players : ĠList < Top Player Model . Top Player >) Ġ{ ĊĠĠĠĠĠĠĠ Ġtop Players Adapter . add Players ( players ) ĊĠĠĠ Ġ} Ċ }