package Ġcom . pr ate ek j . sn ooper . network sn ooper . presenter Ċ Ċ import Ġcom . pr ate ek j . sn ooper . network sn ooper . adapter . Http Call List ClickListener Ċ import Ġcom . pr ate ek j . sn ooper . network sn ooper . database . Sn ooper Repo Ċ import Ġcom . pr ate ek j . sn ooper . network sn ooper . model . Http Call Record Ċ import Ġcom . pr ate ek j . sn ooper . network sn ooper . views . Http ListView Ċ Ċ class ĠHttp Call List Presenter ( ĊĠ Ġprivate Ġval Ġhttp ListView : ĠHttp ListView , ĊĠ Ġprivate Ġval Ġsn ooper Repo : ĠSn ooper Repo Ċ ) Ġ: ĠHttp Call List ClickListener Ġ{ ĊĠ Ġprivate Ġvar Ġlast Call Id : ĠLong Ġ= Ġ 0 ĊĊĠ Ġfun Ġinit () Ġ{ ĊĠĠĠ Ġval Ġhttp Call Records Ġ= Ġsn ooper Repo . findAll Sort By Date After (- 1 , ĠPAGE _ SIZE ) ĊĠĠĠ Ġif Ġ( http Call Records . isEmpty ()) Ġ{ ĊĠĠĠĠĠ Ġhttp ListView . render No Calls Found View () ĊĠĠĠĠĠ Ġreturn ĊĠĠĠ Ġ} ĊĠĠĠ Ġlast Call Id Ġ= Ġhttp Call Records . last (). id ĊĠĠĠ Ġhttp ListView . init Http Call Record List ( http Call Records ) ĊĠ Ġ} ĊĊĠ Ġfun Ġon Next Page Call () Ġ{ ĊĠĠĠ Ġval Ġhttp Call Records Ġ= Ġsn ooper Repo . findAll Sort By Date After ( last Call Id , ĠPAGE _ SIZE ) ĊĠĠĠ Ġlast Call Id Ġ= Ġif ( http Call Records . isNotEmpty ()) Ġhttp Call Records . last (). id Ġelse Ġlast Call Id ĊĠĠĠ Ġhttp ListView . append Record List ( http Call Records ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠonClick ( http Call : ĠHttp Call Record ) Ġ{ ĊĠĠĠ Ġhttp ListView . navigate To ResponseBody ( http Call . id ) ĊĠ Ġ} ĊĊĠ Ġfun Ġon Done Click () Ġ{ ĊĠĠĠ Ġhttp ListView . finish View () ĊĠ Ġ} ĊĊĠ Ġfun ĠonDelete Records Clicked () Ġ{ ĊĠĠĠ Ġhttp ListView . show Delete Confirmation Dialog () ĊĠ Ġ} ĊĊĠ Ġfun Ġconfirm Delete Records () Ġ{ ĊĠĠĠ Ġsn ooper Repo . delete All () ĊĠĠĠ Ġhttp ListView . update ListView After Delete () ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġconst Ġval ĠPAGE _ SIZE Ġ= Ġ 2 0 ĊĠ Ġ} Ċ } Ċ