package Ġcom . example . running route . modules Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Context . MODE _ PRIVATE Ċ import Ġandroid . content . SharedPreferences Ċ import Ġandroidx . room . Room Ċ import Ġcom . example . running route . db . Run Database Ċ import Ġcom . example . running route . util . Constants . KEY _ FIRST _ TIME _ TO GGLE Ċ import Ġcom . example . running route . util . Constants . KEY _ NAME Ċ import Ġcom . example . running route . util . Constants . KEY _ WEIGHT Ċ import Ġcom . example . running route . util . Constants . RUN _ DATABASE _ NAME Ċ import Ġcom . example . running route . util . Constants . SHARED _ PREFER ENCES _ NAME Ċ 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 Ġjavax . inject . Singleton Ċ Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ object ĠApp Module Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Run Database ( ĊĠĠĠĠĠĠĠ Ġ@ ApplicationContext Ġapp : ĠContext ĊĠĠĠ Ġ) ĊĠĠĠ Ġ= ĠRoom . database Builder ( app , Run Database :: class . java , RUN _ DATABASE _ NAME ). build () ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Run Dao ( db : ĠRun Database ) Ġ= Ġdb . get Dao () ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide SharedPreferences ( ĊĠĠĠĠĠĠĠ Ġ@ ApplicationContext Ġapp : Context ĊĠĠĠ Ġ) Ġ= Ġapp . get SharedPreferences ( SHARED _ PREFER ENCES _ NAME , MODE _ PRIVATE ) ĊĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Name ( ĊĠĠĠĠĠĠĠ Ġshared Pref : ĠSharedPreferences ĊĠĠĠ Ġ) Ġ= Ġshared Pref . getString ( KEY _ NAME ," ") Ġ?: Ġ"" ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Weight ( ĊĠĠĠĠĠĠĠ Ġshared Pref : ĠSharedPreferences ĊĠĠĠ Ġ) Ġ= Ġshared Pref . get Float ( KEY _ WEIGHT , 7 5 f ) ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide First Time Toggle ( ĊĠĠĠĠĠĠĠ Ġshared Pref : ĠSharedPreferences ĊĠĠĠ Ġ) Ġ= Ġshared Pref . getBoolean ( KEY _ FIRST _ TIME _ TO GGLE , true ) Ċ Ċ }