package Ġcom . kar umi . gallery . app Ċ Ċ import Ġcom . kar umi . gallery . data . get Engine Ċ import Ġcom . kar umi . gallery . data . local . Local Gallery Db Ċ import Ġcom . kar umi . gallery . data . local . Local Photos DataSource Ċ import Ġcom . kar umi . gallery . data . network . Photos ApiClient Ċ import Ġcom . kar umi . gallery . domain . Photos Flow Ċ import Ġcom . kar umi . gallery . domain . TTL Cache Ċ import Ġcom . kar umi . gallery . domain . Time Provider Ċ import Ġcom . kar umi . gallery . domain . Time Storage Ċ import Ġcom . kar umi . gallery . generated . Kotlin Config Ċ import Ġcom . kar umi . gallery . use case . Get Photos Ċ import Ġcom . squareup . sql de light . db . Sql Driver Ċ import Ġkotlin . native . concurrent . Thread Local Ċ import Ġkotlin . time . minutes Ċ Ċ @ Thread Local Ċ object ĠGallery Injector Ġ{ ĊĠ Ġprivate Ġvar Ġgallery Injector : ĠInjection Module ? Ġ= Ġnull ĊĠ Ġprivate Ġval Ġdefault Injector Ġ= ĠInjection Module () ĊĊĠ Ġoperator Ġfun Ġinvoke (): ĠInjection Module Ġ= ĊĠĠĠ Ġgallery Injector Ġ?: Ġdefault Injector ĊĊĠ Ġfun Ġconfig ( injector : ĠInjection Module ) Ġ{ ĊĠĠĠ Ġgallery Injector Ġ= Ġinjector ĊĠ Ġ} Ċ } Ċ Ċ open Ġclass ĠInjection Module Ġ{ ĊĊĠ Ġlateinit Ġvar Ġtime Provider : ĠTime Provider ĊĠ Ġlateinit Ġvar Ġtime Storage : ĠTime Storage ĊĊĠ Ġfun Ġinit ( ĊĠĠĠ Ġdriver : ĠSql Driver , ĊĠĠĠ Ġtime Provider : ĠTime Provider , ĊĠĠĠ Ġtime Storage : ĠTime Storage ĊĠ Ġ) Ġ{ ĊĠĠĠ ĠLocal Gallery Db . db Setup ( driver ) ĊĠĠĠ Ġthis . time Provider Ġ= Ġtime Provider ĊĠĠĠ Ġthis . time Storage Ġ= Ġtime Storage ĊĠ Ġ} ĊĊĠ Ġopen Ġfun Ġget Photos ApiClient (): ĠPh otos ApiClient Ġ= ĊĠĠĠ ĠPh otos ApiClient ( get Engine (), ĠKotlin Config . UN PL ASH _ KEY ) ĊĊĠ Ġopen Ġfun Ġget Photos (): ĠGet Photos Ġ= ĊĠĠĠ ĠGet Photos ( get Photos Flow ()) ĊĊĠ Ġopen Ġfun Ġttl Cache (): ĠTTL Cache Ġ= ĠTTL Cache ( time Storage , Ġtime Provider , Ġttl Ġ= Ġ 2 . minutes ) ĊĊĠ Ġopen Ġfun Ġget Local Photos DataSource (): ĠLocal Photos DataSource Ġ= ĊĠĠĠ ĠLocal Photos DataSource ( ttl Cache ()) ĊĊĠ Ġopen Ġfun Ġget Photos Flow (): ĠPh otos Flow Ġ= ĊĠĠĠ ĠPh otos Flow ( get Photos ApiClient (), Ġget Local Photos DataSource ()) Ċ }