package Ġme . w ols zon . c row die . android Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . SharedPreferences Ċ import Ġme . w ols zon . c row die . base . Preferences Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠAndroid Preferences Ġ@ Inject Ġconstructor ( context : ĠContext ) Ġ: ĠPreferences Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġpreferences : ĠSharedPreferences Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . get SharedPreferences ( java Class . simple Name , ĠContext . MODE _ PRIVATE ) ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠP REF _ USERNAME Ġ= Ġ" username " ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠP REF _ LAST _ JOIN ED _ GROUP Ġ= Ġ" last _ joined _ group " ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠP REF _ LAST _ JOIN ED _ GROUP _ TOKEN Ġ= Ġ" last _ joined _ group _ token " ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠP REF _ LAST _ JOIN ED _ GROUP _ MEMBER _ ID Ġ= Ġ" last _ joined _ group _ member _ id " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġvar Ġusername : ĠString ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġpreferences . getString ( PRE F _ USERNAME , Ġ"") ĊĠĠĠĠĠĠĠ Ġset ( value ) Ġ= Ġpreferences . edit (). putString ( PRE F _ USERNAME , Ġvalue ). apply () ĊĊĠĠĠ Ġoverride Ġvar Ġlast Joined Group : ĠString ? ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġpreferences . getString ( PRE F _ LAST _ JOIN ED _ GROUP , Ġnull ) ĊĠĠĠĠĠĠĠ Ġset ( value ) Ġ= Ġpreferences . edit (). putString ( PRE F _ LAST _ JOIN ED _ GROUP , Ġvalue ). apply () ĊĊĠĠĠ Ġoverride Ġvar Ġlast Joined Group Token : ĠString ? ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġpreferences . getString ( PRE F _ LAST _ JOIN ED _ GROUP _ TOKEN , Ġnull ) ĊĠĠĠĠĠĠĠ Ġset ( value ) Ġ= Ġpreferences . edit (). putString ( PRE F _ LAST _ JOIN ED _ GROUP _ TOKEN , Ġvalue ). apply () ĊĊĠĠĠ Ġoverride Ġvar Ġlast Joined Group Member Id : ĠString ? ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġpreferences . getString ( PRE F _ LAST _ JOIN ED _ GROUP _ MEMBER _ ID , Ġnull ) ĊĠĠĠĠĠĠĠ Ġset ( value ) Ġ= Ġpreferences . edit (). putString ( PRE F _ LAST _ JOIN ED _ GROUP _ MEMBER _ ID , Ġvalue ). apply () Ċ }