package Ġjp . co . yu ji . my debug application . presentation . view . fragment . other Ċ Ċ import Ġandroid . content . Intent Filter Ċ import Ġandroid . net . Connectivity Manager Ċ import Ġandroid . net . Network Info Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġjp . co . yu ji . my debug application . R Ċ import Ġjp . co . yu ji . my debug application . domain . model . Common Dto Ċ import Ġjp . co . yu ji . my debug application . presentation . view . adapter . common . Common RecyclerView Adapter Ċ import Ġjp . co . yu ji . my debug application . presentation . view . fragment . Base Fragment Ċ import Ġjp . co . yu ji . my debug application . presentation . view . receiver . Connectivity Receiver Ċ import Ġkotlinx . android . synt hetic . main . fragment _ common . view .* Ċ Ċ /** Ċ Ġ* ĠNetwork ĠInfo ĠFragment Ċ Ġ*/ Ċ class ĠNetwork Info Fragment Ġ: ĠBase Fragment () Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance (): ĠFragment Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠNetwork Info Fragment () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġadapter Ġ: ĠCommon RecyclerView Adapter ĊĊĠĠĠ Ġprivate Ġval Ġreceiver Ġ= ĠConnect ivity Receiver ( object Ġ: ĠConnect ivity Receiver . On Connectivity Listener Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Connectivity Receive ( network Info : ĠNetwork Info ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġupdate View ( network Info ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate View ( in flater , Ġcontainer , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġinflater . inflate ( R . layout . fragment _ common , Ġcontainer , Ġfalse ) ĊĊĠĠĠĠĠĠĠ Ġview . re cyclerView . layout Manager Ġ= ĠLinearLayoutManager ( activity ) ĊĊĠĠĠĠĠĠĠ Ġadapter Ġ= ĠCommon RecyclerView Adapter ( require Activity (), ĠArrayList ()) ĊĠĠĠĠĠĠĠ Ġview . re cyclerView . adapter Ġ= Ġadapter ĊĊĠĠĠĠĠĠĠ Ġreturn Ġview ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ Ġactivity ?. register Receiver ( receiver , ĠIntent Filter ( Connectivity Manager . CONNECT IVITY _ ACTION )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Pause () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Pause () ĊĠĠĠĠĠĠĠ Ġactivity ?. unregister Receiver ( receiver ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Title (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠR . string . screen _ name _ network _ info ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġupdate View ( network Info : ĠNetwork Info ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= Ġadapter . items ĊĠĠĠĠĠĠĠ Ġlist . clear () ĊĊĠĠĠĠĠĠĠ Ġif Ġ( network Info Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" state ", Ġnetwork Info . state ?. toString (). or Empty ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" detailed State ", Ġnetwork Info . detailed State . toString (). or Empty ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" reason ", Ġnetwork Info . reason ?. toString (). or Empty ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" extra Info ", Ġnetwork Info . extra Info ?. toString (). or Empty ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" type ", Ġnetwork Info . type . toString ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" typeName ", Ġnetwork Info . typeName ?. toString (). or Empty ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" subtype ", Ġnetwork Info . subtype . toString ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" sub typeName ", Ġnetwork Info . sub typeName ?. toString (). or Empty ())) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlist . add ( Common Dto (" network Info ", Ġ" none ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġadapter . notify DataSet Changed () ĊĠĠĠ Ġ} Ċ }