package Ġcom . cri ms on . ad de ct . utils Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . SharedPreferences Ċ import Ġandroid . preference . Preference Manager Ċ import Ġcom . cri ms on . ad de ct . d agger . qual ifier . ApplicationContext Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ġclass ĠShared Prefs Ġ@ Inject Ġconstructor (@ ApplicationContext Ġcontext : ĠContext ) Ġ{ ĊĠ Ġprivate Ġval ĠP REF S _ RAT ING _ COUNT Ġ= Ġ" Show Ġrating Ġcount " ĊĠ Ġprivate Ġval ĠP REF S _ SHOW _ RAT ING Ġ= Ġ" Show ĠRating " ĊĊĠ Ġprivate Ġvar Ġprefs : ĠSharedPreferences Ġ= ĠPreference Manager . getDefault SharedPreferences ( context ) ĊĊĠ Ġfun Ġshow Rating Dialog (): ĠBoolean Ġ= Ġprefs . getBoolean ( PRE FS _ SHOW _ RAT ING , Ġtrue ) ĊĊĠ Ġfun ĠsetShow Rating Dialog ( show : ĠBoolean ) Ġ{ ĊĠĠĠ Ġprefs . edit (). put Boolean ( PRE FS _ SHOW _ RAT ING , Ġshow ). apply () ĊĠ Ġ} ĊĊĠ Ġfun Ġget Rating Count (): ĠInt Ġ= Ġprefs . getInt ( PRE FS _ RAT ING _ COUNT , Ġ 0 ) ĊĊĠ Ġfun Ġset Rating Count ( count : ĠInt ) Ġ{ ĊĠĠĠ Ġprefs . edit (). put Int ( PRE FS _ RAT ING _ COUNT , Ġcount ). apply () ĊĠ Ġ} Ċ } Ċ