package Ġcom . epic dim a . sf ct . di Ċ Ċ import Ġandroid . app . Application Ċ import Ġcom . epic dim a . sf ct . core . network . ApiService Ċ import Ġcom . epic dim a . sf ct . network . Ret rofit ApiService Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . components . Singleton Component Ċ import Ġokhttp 3 . Cache Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . scal ars . Scalars Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġjavax . inject . Singleton Ċ Ċ /** Ċ Ġ* Ġ@ author ĠE pic Dim a Ċ Ġ*/ Ċ @ Install In ( Singleton Component :: class ) Ċ @ Module Ċ object ĠNetwork Module Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Ret rofit Service ( ret rofit : ĠRet rofit ): ĠApi Service Ġ= ĊĠĠĠĠĠĠĠ Ġretrofit . create ( Ret rofit ApiService :: class . java ) ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Ok HttpClient ( application : ĠApplication ): ĠOk HttpClient Ġ= ĠOk HttpClient . Builder () ĊĠĠĠĠĠĠĠ Ġ. cache ( Cache ( application . cacheDir , Ġ 1 0 L Ġ* Ġ 1 0 2 4 Ġ* Ġ 1 0 2 4 )) ĊĠĠĠĠĠĠĠ Ġ. connect Timeout ( 5 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ Ġ. read Timeout ( 8 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Ret rofit ( ok HttpClient : ĠOk HttpClient ): ĠRet rofit Ġ= ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠ Ġ. baseUrl ( Ret rofit ApiService . BASE _ URL ) ĊĠĠĠĠĠĠĠ Ġ. validate E ager ly ( true ) ĊĠĠĠĠĠĠĠ Ġ. client ( ok HttpClient ) ĊĠĠĠĠĠĠĠ Ġ. add Converter Factory ( Scalars Converter Factory . create ()) ĊĠĠĠĠĠĠĠ Ġ. build () Ċ }