package Ġorg . opp ia . android . app . utility . datetime Ċ Ċ import Ġorg . opp ia . android . R Ċ import Ġorg . opp ia . android . app . translation . App Language Resource Handler Ċ import Ġorg . opp ia . android . util . locale . Opp ia Locale Ċ import Ġjavax . inject . Inject Ċ Ċ /** ĠPer - activity Ġutility Ġto Ġmanage Ġdate Ġand Ġtime Ġfor Ġuser - facing Ġstrings . Ġ*/ Ċ class ĠDateTime Util Ġ@ Inject Ġconstructor ( ĊĠ Ġprivate Ġval Ġmachine Locale : ĠO pp ia Locale . Machine Locale , ĊĠ Ġprivate Ġval Ġresource Handler : ĠApp Language Resource Handler Ċ ) Ġ{ ĊĠ Ġ/** ĊĠĠ Ġ* ĠReturns Ġa Ġuser - readable Ġstring Ġbased Ġon Ġthe Ġtime Ġof Ġday Ġ( to Ġbe Ġconcaten ated Ġas Ġpart Ġof Ġa ĊĠĠ Ġ* Ġg reeting Ġfor Ġthe Ġuser ). ĊĠĠ Ġ*/ ĊĠ Ġfun Ġget G reeting Message (): ĠString Ġ{ ĊĠĠĠ Ġreturn Ġwhen Ġ( machine Locale . getCurrent Time OfDay ()) Ġ{ ĊĠĠĠĠĠ ĠO pp ia Locale . Machine Locale . Time OfDay . MOR NING Ġ-> ĊĠĠĠĠĠĠĠ Ġresource Handler . getString In Locale ( R . string . home _ screen _ good _ mor ning _ greeting _ fragment ) ĊĠĠĠĠĠ ĠO pp ia Locale . Machine Locale . Time OfDay . AFTER NO ON Ġ-> ĊĠĠĠĠĠĠĠ Ġresource Handler . getString In Locale ( R . string . home _ screen _ good _ af tern oon _ greeting _ fragment ) ĊĠĠĠĠĠ ĠO pp ia Locale . Machine Locale . Time OfDay . E VEN ING , ĠO pp ia Locale . Machine Locale . Time OfDay . UNKNOWN Ġ-> ĊĠĠĠĠĠĠĠ Ġresource Handler . getString In Locale ( R . string . home _ screen _ good _ even ing _ greeting _ fragment ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ/** ĠInject or Ġto Ġretrieve Ġinstances Ġof Ġ[ DateTime Util ] Ġfrom ĠD agger . Ġ*/ ĊĠ Ġinterface ĠInject or Ġ{ ĊĠĠĠ Ġ/** ĠReturns Ġ[ DateTime Util ] Ġfor Ġthe Ġcurrent ĠD agger Ġgraph . Ġ*/ ĊĠĠĠ Ġfun Ġget DateTime Util (): ĠDateTime Util ĊĠ Ġ} Ċ } Ċ