package Ġcom . mar cel j ur tz . life counter . views . D icing Ċ Ċ import Ġandroid . content . SharedPreferences Ċ Ċ import Ġcom . mar cel j ur tz . life counter . views . About . About Activity Ċ import Ġcom . mar cel j ur tz . life counter . views . Base . Presenter Ċ import Ġcom . mar cel j ur tz . life counter . views . Counter . Counter Activity Ċ import Ġcom . mar cel j ur tz . life counter . views . Game . Game Activity Ċ import Ġcom . mar cel j ur tz . life counter . models . Color Ċ import Ġcom . mar cel j ur tz . life counter . models . Dice Ċ import Ġcom . mar cel j ur tz . life counter . enums . Magic Color Enum Ċ import Ġcom . mar cel j ur tz . life counter . models . Preference Manager Ċ import Ġcom . mar cel j ur tz . life counter . views . Settings . Settings Activity Ċ Ċ import Ġjava . util . Random Ċ Ċ class ĠD icing Presenter (_ view : ĠID icing View , Ġpreferences : ĠSharedPreferences ) Ġ: ĠPres enter (_ view , Ġpreferences ), ĠID icing Presenter Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġ_ dice : ĠD ice ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġval Ġ_ random : ĠRandom ĊĊĠĠĠ Ġprivate Ġval Ġ_ dic ing View : ĠID icing View Ġ= Ġ_ view ; ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġthis ._ random Ġ= ĠRandom () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// region ĠActivity ĠLifecycle ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ dice Ġ= ĠD ice () ĊĠĠĠĠĠĠĠ Ġval Ġnum Ġ= Ġ_ random . nextInt ( 4 ) ĊĠĠĠĠĠĠĠ Ġvar Ġcolor Ġ= ĠColor ( Magic Color Enum . WHITE , Ġ_ preferences ) ĊĠĠĠĠĠĠĠ Ġwhen Ġ( num ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 Ġ-> Ġcolor Ġ= ĠColor ( Magic Color Enum . BLUE , Ġ_ preferences ) ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 Ġ-> Ġcolor Ġ= ĠColor ( Magic Color Enum . GREEN , Ġ_ preferences ) ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 Ġ-> Ġcolor Ġ= ĠColor ( Magic Color Enum . RED , Ġ_ preferences ) ĊĠĠĠĠĠĠĠĠĠĠĠĠ 3 Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ_ dic ing View . set BackgroundColor ( color ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// endregion ĊĊĠĠĠ Ġoverride Ġfun Ġon Screen Tap () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ dic ing View . set D icing Text (_ dice !!. throw Dice (). toString () Ġ+ Ġ"") ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ// region ĠNav Drawer ĠHandling ĊĊĠĠĠ Ġoverride Ġfun Ġon Menu Entry Settings Tap () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ view . load Activity ( Settings Activity :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Menu Entry About Tap () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ view . load Activity ( About Activity :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Menu Entry Two Player Tap () Ġ{ ĊĠĠĠĠĠĠĠ ĠPreference Manager . save Default Player Amount (_ preferences , Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġ_ view . load Activity ( Game Activity :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Menu Entry Four Player Tap () Ġ{ ĊĠĠĠĠĠĠĠ ĠPreference Manager . save Default Player Amount (_ preferences , Ġ 4 ) ĊĠĠĠĠĠĠĠ Ġ_ view . load Activity ( Game Activity :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Menu Entry Counter Manager Tap () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ view . load Activity ( Counter Activity :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// endregion Ċ } Ċ