package Ġcom . h ill park . h ill park . mvp . fragments Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . are l lo mobile . mvp . M vp AppCompat Fragment Ċ import Ġcom . are l lo mobile . mvp . presenter . Inject Presenter Ċ import Ġcom . google . android . material . sn ackbar . Snackbar Ċ import Ġcom . h ill park . h ill park App . R Ċ import Ġcom . h ill park . h ill park . adapters . Card History Adapter Ċ import Ġcom . h ill park . h ill park . constants . App Const Ċ import Ġcom . h ill park . h ill park . model . Card Operation Ċ import Ġcom . h ill park . h ill park . mvp . MainActivity Ċ import Ġcom . h ill park . h ill park . mvp . present ers . Card History Presenter Ċ import Ġcom . h ill park . h ill park . mvp . view . Card History View Ċ import Ġkotlinx . android . synt hetic . main . fragment _ card _ history .* Ċ Ċ class ĠCard History Fragment Ġ: ĠM vp AppCompat Fragment (), ĠCard History View Ġ{ ĊĊĠĠĠ Ġ@ Inject Presenter ĊĠĠĠ Ġlateinit Ġvar Ġpresenter : ĠCard History Presenter ĊĠĠĠ Ġlateinit Ġvar Ġmain Activity : ĠMainActivity ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcard Code : ĠString ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġcard Code Ġ= Ġarguments !!. getString ( App Const . CARD _ CODE _ KEY , Ġ"") ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ card _ history , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonStart () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onStart () ĊĠĠĠĠĠĠĠ Ġmain Activity Ġ= Ġactivity Ġas ĠMainActivity ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ Ġmain Activity . show Act Bar ( card Code ) ĊĠĠĠĠĠĠĠ Ġpresenter . get Operations ( card Code ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow History ( list : ĠList < Card Operation >) Ġ{ ĊĠĠĠĠĠĠĠ Ġcard History Recycler . layout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠ Ġcard History Recycler . adapter Ġ= ĠCard History Adapter ( list ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġhide Loading () Ġ{ ĊĠĠĠĠĠĠĠ Ġconstraint . visibility Ġ= ĠView . VISIBLE ĊĠĠĠĠĠĠĠ ĠprogressBar . visibility Ġ= ĠView . IN VISIBLE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Loading () Ġ{ ĊĠĠĠĠĠĠĠ Ġconstraint . visibility Ġ= ĠView . IN VISIBLE ĊĠĠĠĠĠĠĠ ĠprogressBar . visibility Ġ= ĠView . VISIBLE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Snackbar ( message : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠSn ackbar . make ( root , Ġmessage , ĠSn ackbar . LENGTH _ SHORT ). show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject { ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance ( code : ĠString ) Ġ: ĠCard History Fragment { ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġargs Ġ= ĠBundle () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfragment Ġ= ĠCard History Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġargs . putString ( App Const . CARD _ CODE _ KEY , Ġcode ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . arguments Ġ= Ġargs ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġfragment ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }