package Ġinfo . c cook . ground hog Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . arch . lifecycle . ViewModel Provider Ċ import Ġandroid . content . Context Ċ import Ġcom . google . android . gms . location . Location Request Ċ import Ġcom . google . firebase . remote config . Firebase Remote Config Ċ import Ġcom . pat lo ew . rx location . Rx Location Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġinfo . c cook . ground hog . config . AppConfig Ċ import Ġinfo . c cook . ground hog . location . Current Location Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module ( sub components Ġ= ĠarrayOf ( ViewModel Sub Component :: class )) Ċ class ĠApp Module Ġconstructor ( private Ġval Ġapplication : ĠApplication ) Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide ApplicationContext (): ĠContext Ġ= Ġapplication . application Context ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide ViewModel Factory ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel Sub Component : ĠViewModel Sub Component . Builder ): ĠViewModel Provider . Factory Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠViewModel Factory ( viewModel Sub Component . build ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Location Provider ( context : ĠContext ): ĠRx Location Ġ= ĠRx Location ( context ) ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Location Request (): ĠLocation Request Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocation Request . create (). set Priority ( Location Request . PRIORITY _ BAL ANCED _ POWER _ AC CUR ACY ) ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Current Location ( location Provider : ĠRx Location , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlocation Request : ĠLocation Request ): ĠCurrent Location Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCurrent Location ( location Provider , Ġlocation Request ) ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide AppConfig ( firebase Remote Config : ĠFirebase Remote Config ): ĠApp Config Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠApp Config ( firebase Remote Config ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Firebase Remote Config (): ĠFirebase Remote Config Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfirebase Remote Config Ġ= ĠFirebase Remote Config . getInstance () ĊĠĠĠĠĠĠĠ Ġfirebase Remote Config . set Defaults ( R . xml . firebase _ defaults ) ĊĠĠĠĠĠĠĠ Ġreturn Ġfirebase Remote Config ĊĠĠĠ Ġ} Ċ }