package Ġcom . sg c . speed ometer . data Ċ Ċ import Ġcom . sg c . speed ometer . data . bd . App Database Ċ import Ġcom . sg c . speed ometer . Speed ometer Record Ċ import Ġcom . sg c . speed ometer . data . prefs . Preferences Helper Ċ import Ġcom . sg c . speed ometer . data . util . Speed ometer Resolution Ċ import Ġcom . sg c . speed ometer . data . util . distance Unit . Distance Unit Ċ import Ġcom . sg c . speed ometer . data . util . speed Unit . Speed Unit Ċ import Ġio . reactivex . Flow able Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠApp DataManager Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġpreferences Helper : ĠPreferences Helper , ĊĠĠĠ Ġprivate Ġval Ġdefault Settings : ĠDefault Settings , ĊĠĠĠ Ġprivate Ġval Ġapp Database : ĠApp Database Ċ ) Ġ: ĠData Manager Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġset Max Speed ( max Speed : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpreferences Helper . setMax Speed ( max Speed ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetMax Speed ( default Max Speed : ĠInt ): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . getMax Speed ( default Max Speed ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetMax Speed (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . getMax Speed ( default Settings . max Speed ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Speed Unit ( speed Unit : ĠSpeed Unit ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpreferences Helper . set Speed Unit ( speed Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Speed Unit ( default Speed Unit : ĠSpeed Unit ): ĠSpeed Unit Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . get Speed Unit ( default Speed Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Speed Unit (): ĠSpeed Unit Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . get Speed Unit ( default Settings . speed Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Distance Unit ( distance Unit : ĠDistance Unit ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpreferences Helper . set Distance Unit ( distance Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Distance Unit ( default Distance Unit : ĠDistance Unit ): ĠDistance Unit Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . get Distance Unit ( default Distance Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Distance Unit (): ĠDistance Unit Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . get Distance Unit ( default Settings . distance Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠsetIs Dark Theme ( is Dark Theme : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpreferences Helper . setIs Dark Theme ( is Dark Theme ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Is Dark Theme ( default Is Dark Theme : ĠBoolean ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . getIs Dark Theme ( default Is Dark Theme ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Is Dark Theme (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġget Is Dark Theme ( default Settings . is Dark Theme ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠsetIs V ibration ( is V ibration : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpreferences Helper . setIs V ibration ( is V ibration ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Is V ibration ( default Is V ibration : ĠBoolean ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . getIs V ibration ( default Is V ibration ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Is V ibration (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġget Is Dark Theme ( default Settings . is V ibration ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Speed ometer Resolution ( speed ometer Resolution : ĠSpeed ometer Resolution ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpreferences Helper . set Speed ometer Resolution ( speed ometer Resolution ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinsert Speed ometer Record ( speed ometer Record : ĠSpeed ometer Record ): Long Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġapp Database . speed ometer Record Dao (). insert Speed ometer Record ( speed ometer Record ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġupdate Speed ometer Record ( speed ometer Record : ĠSpeed ometer Record ) Ġ{ ĊĠĠĠĠĠĠĠ Ġapp Database . speed ometer Record Dao (). update Speed ometer Record ( speed ometer Record ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdelete Speed ometer Record ( speed ometer Record : ĠSpeed ometer Record ) Ġ{ ĊĠĠĠĠĠĠĠ Ġapp Database . speed ometer Record Dao (). delete Speed ometer Record ( speed ometer Record ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Speed ometer Records (): ĠFlow able < List < Speed ometer Record >> Ġ{ ĊĠĠĠĠĠĠ Ġreturn Ġapp Database . speed ometer Record Dao (). get Speed ometer Records () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Speed ometer Resolution ( default Speed ometer Resolution : ĠSpeed ometer Resolution ): ĠSpeed ometer Resolution Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpreferences Helper . get Speed ometer Resolution ( default Speed ometer Resolution ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Speed ometer Resolution (): ĠSpeed ometer Resolution Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġget Speed ometer Resolution ( default Settings . speed ometer Resolution ) ĊĠĠĠ Ġ} Ċ Ċ }