package Ġcom . simple mobile tools . calculator . page object . pages Ċ Ċ import Ġandroid . support . test . espress o . Esp ress o . on View Ċ import Ġandroid . support . test . espress o . action . View Actions . click Ċ import Ġandroid . support . test . espress o . assertion . View Assertions . matches Ċ import Ġandroid . support . test . espress o . matcher . View Matchers .* Ċ import Ġandroid . widget . TextView Ċ import Ġcom . simple mobile tools . calculator . R Ċ import Ġcom . simple mobile tools . calculator . page object . Base Object Ċ import Ġorg . hamcrest . Core Matchers . all Of Ċ import Ġorg . hamcrest . Core Matchers . instance Of ĊĊ Ċ class ĠSettings Page Ġ: ĠBase Object () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġverify () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( all Of ( instance Of ( TextView :: class . java ), Ġwith Parent ( with Id ( R . id . action _ bar )))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( with Text ( Settings Page Title ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠSettings Page Title Ġ= Ġ" Settings " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġcustomize Color TextView Ġ= Ġon View ( with Id ( R . id . settings _ customize _ colors _ label )) ĊĠĠĠ Ġprivate Ġval Ġcustomize Widget Colors TextView Ġ= Ġon View ( with Id ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠR . id . settings _ customize _ widget _ colors _ label )) ĊĠĠĠ Ġprivate Ġval Ġavoid Wh ats New Switch Ġ= Ġon View ( with Id ( R . id . settings _ avoid _ whats _ new )) ĊĠĠĠ Ġprivate Ġval Ġset V ibrate Switch Ġ= Ġon View ( with Id ( R . id . settings _ vi br ate )) ĊĠĠĠ Ġprivate Ġval Ġsleep Mode Switch Ġ= Ġon View ( with Id ( R . id . settings _ prevent _ phone _ from _ sleep ing )) ĊĊĠĠĠ Ġfun Ġtoggle On Avoid Wh ats New Switch (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġavoid Wh ats New Switch . perform ( click ()). check ( matches ( isChecked ())) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtoggle Off Avoid Wh ats New Switch (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġavoid Wh ats New Switch . perform ( click ()). check ( matches ( isNot Checked ())) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtoggle On V ibration On Press (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġset V ibrate Switch . perform ( click ()). check ( matches ( isChecked ())) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtoggle Off V ibration On Press (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġset V ibrate Switch . perform ( click ()). check ( matches ( isNot Checked ())) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġfun Ġtoggle On Sleep Mode (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġsleep Mode Switch . perform ( click ()). check ( matches (( isChecked ()))) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtoggle Off Sleep Mode (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġsleep Mode Switch . perform ( click ()). check ( matches ( isNot Checked ())) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġnavigate To Custom ize Color Page (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġcustomize Color TextView . perform ( click ()) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġnavigate To Custom ize Widget Colors Page (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġcustomize Widget Colors TextView . perform ( click ()) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġvalidate Dark Theme (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġcustomize Color TextView . check ( matches ( has TextColor ( R . color . theme _ dark _ text _ color ))) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġvalidate Light Theme (): ĠSettings Page Ġ{ ĊĠĠĠĠĠĠĠ Ġcustomize Color TextView . check ( matches ( has TextColor ( R . color . theme _ light _ text _ color ))) ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} Ċ }