package Ġearth . dark white . al b ion online player stats . di Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi . kotlin . reflect . Kotlin Json Adapter Factory Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . android . qual ifiers . ApplicationContext Ċ import Ġdagger . h ilt . components . Singleton Component Ċ import Ġearth . dark white . al b ion online player stats . Preferences Manager Ċ import Ġearth . dark white . al b ion online player stats . add player . Add Player Repo Ċ import Ġearth . dark white . al b ion online player stats . data . api . ApiService Ċ import Ġearth . dark white . al b ion online player stats . data . api . BASE _ URL Ċ import Ġearth . dark white . al b ion online player stats . database . My Dao Ċ import Ġearth . dark white . al b ion online player stats . database . My Database Ċ import Ġearth . dark white . al b ion online player stats . main screen . Main Screen Repo Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . mos hi . M oshi Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ object ĠApp Module Ġ{ ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides M oshi (): ĠM oshi Ġ= ĠM oshi . Builder () ĊĠĠĠĠĠĠĠ Ġ. add ( Kotlin Json Adapter Factory ()) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides Ret ro fits (): ĠRet rofit Ġ= ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ( provides M oshi ())) ĊĠĠĠĠĠĠĠ Ġ. baseUrl ( BASE _ URL ) ĊĠĠĠĠĠĠĠ Ġ. client ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠOk HttpClient . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. connect Timeout ( 7 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. call Timeout ( 7 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. read Timeout ( 7 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides Al b ion Api ( ret rofit : ĠRet rofit ): ĠApi Service Ġ= ĊĠĠĠĠĠĠĠ Ġretrofit . create ( ApiService :: class . java ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides My Database (@ ApplicationContext Ġcontext : ĠContext ): ĠMy Database Ġ= ĊĠĠĠĠĠĠĠ ĠMy Database . getInstance ( context ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides My Dao ( database : ĠMy Database ): ĠMy Dao Ġ= ĊĠĠĠĠĠĠĠ Ġdatabase . database My Dao ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides Main Screen Repository ( dataSource : ĠMy Dao , Ġapi : ĠApi Service ): ĠMain Screen Repo Ġ= ĊĠĠĠĠĠĠĠ ĠMain Screen Repo ( dataSource , Ġapi ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides Add P Layer Repository ( dataSource : ĠMy Dao , Ġapi : ĠApi Service ): ĠAdd Player Repo Ġ= ĊĠĠĠĠĠĠĠ ĠAdd Player Repo ( dataSource , Ġapi ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovides Preferences Manager (@ ApplicationContext Ġcontext : ĠContext ): ĠPreferences Manager Ġ= ĊĠĠĠĠĠĠĠ ĠPreferences Manager ( context ) Ċ }