package Ġcom . t ari . android . wallet . data . network Ċ Ċ import Ġandroid . content . SharedPreferences Ċ import Ġcom . t ari . android . wallet . R Ċ import Ġcom . t ari . android . wallet . application . Network Ċ import Ġcom . t ari . android . wallet . data . shared Prefs . deleg ates . Shared Pref Boolean Delegate Ċ import Ġcom . t ari . android . wallet . data . shared Prefs . deleg ates . Shared Pref Gson Delegate Ċ import Ġcom . t ari . android . wallet . ui . common . domain . ResourceManager Ċ Ċ class ĠNetwork Repository Impl ( private Ġval Ġresource Manager : ĠResourceManager , Ġprivate Ġval Ġshared Prefs : ĠSharedPreferences ) Ġ: ĠNetwork Repository Ġ{ ĊĊĠĠĠ Ġoverride Ġvar Ġsupported Networks : ĠList < Network > Ġ= ĠlistOf ( Network . WE ATHER W AX , ĠNetwork . IG OR ) ĊĊĠĠĠ Ġoverride Ġvar Ġcurrent Network Ġby ĠShared Pref Gson Delegate ( shared Prefs , ĠKeys . current Network , ĠT ari Network :: class . java ) ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( current Network Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcurrent Network Ġ= Ġget Weather w ax ( resource Manager ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġvar Ġffi Network : ĠNetwork ? Ġby ĠShared Pref Gson Delegate ( shared Prefs , Ġformat Key ( Keys . ffi Network ), ĠNetwork :: class . java ) ĊĊĠĠĠ Ġoverride Ġvar Ġincompatible Network Shown Ġby ĠShared Pref Boolean Delegate ( shared Prefs , Ġformat Key ( Keys . network In compatible ), Ġfalse ) ĊĊĠĠĠ Ġoverride Ġfun ĠgetAll Networks (): ĠList < T ari Network > Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġget Weather w ax ( resource Manager ), ĊĠĠĠĠĠĠĠ Ġget I gor () ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġfun Ġformat Key ( key : ĠString ): ĠString Ġ= Ġkey Ġ+ Ġ"_" Ġ+ Ġcurrent Network !!. network . displayName ĊĊĠĠĠ Ġobject ĠKeys Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġcurrent Network Ġ= Ġ" t ari _ current _ network " ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġffi Network Ġ= Ġ" ffi _ t ari _ current _ network " ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġnetwork In compatible Ġ= Ġ" t ari _ network _ in compatible _ current _ network " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval Ġmain Net Th icker Ġ= Ġ" X TR " ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval Ġtest Net Th icker Ġ= Ġ" t X TR " ĊĊĠĠĠĠĠĠĠ Ġfun Ġget Weather w ax ( resource Manager : ĠResourceManager ): ĠT ari Network Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠT ari Network ( Network . WE ATHER W AX , Ġresource Manager . getString ( R . string . network _ fa uc et _ url ), Ġtest Net Th icker ) ĊĊĠĠĠĠĠĠĠ Ġfun Ġget I gor (): ĠT ari Network Ġ= ĠT ari Network ( Network . IG OR , Ġnull , Ġtest Net Th icker ) ĊĠĠĠ Ġ} Ċ }