package Ġcom . example . water filter comp anion . common . dependency injection . application Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . SharedPreferences Ċ import Ġandroidx . preference . Preference Manager Ċ import Ġcom . example . water filter comp anion . common . date . Date Helper Ċ import Ġcom . example . water filter comp anion . common . dependency injection . Di Constants Ċ import Ġcom . example . water filter comp anion . dat apers istence . Local Repository Ċ import Ġcom . example . water filter comp anion . water control . Consume Water UseCase Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . Re usable Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . components . Singleton Component Ċ import Ġjavax . inject . Named Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ class ĠApplication Module Ġ{ ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Named ( Di Constants . APPLICATION _ CONTEXT ) ĊĠĠĠ Ġfun Ġprovide ApplicationContext ( application : ĠApplication ): ĠContext Ġ= Ġapplication ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Re usable ĊĠĠĠ Ġfun Ġprovide Date Helper () Ġ= ĠDate Helper () ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide SharedPreferences ( ĊĠĠĠĠĠĠĠ Ġ@ Named ( Di Constants . APPLICATION _ CONTEXT ) Ġcontext : ĠContext ĊĠĠĠ Ġ): ĠSharedPreferences Ġ= ĠPreference Manager . getDefault SharedPreferences ( context ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Re usable ĊĠĠĠ Ġfun Ġprovide Local Repository ( ĊĠĠĠĠĠĠĠ Ġshared Preferences : ĠSharedPreferences ĊĠĠĠ Ġ): ĠLocal Repository Ġ= ĠLocal Repository ( shared Preferences ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Re usable ĊĠĠĠ Ġfun Ġprovide Consume Water UseCase ( ĊĠĠĠĠĠĠĠ Ġlocal Repository : ĠLocal Repository ĊĠĠĠ Ġ): ĠCons ume Water UseCase Ġ= ĠCons ume Water UseCase ( local Repository ) Ċ }