package Ġorg . dh is 2 . use sc ases . te id ashboard . robot Ċ Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions . click Ċ import Ġandroidx . test . espress o . assertion . View Assertions . matches Ċ import Ġandroidx . test . espress o . contrib . RecyclerView Actions . action On Item Ċ import Ġandroidx . test . espress o . contrib . RecyclerView Actions . action On Item At Position Ċ import Ġandroidx . test . espress o . matcher . View Matchers . has Desc endant Ċ import Ġandroidx . test . espress o . matcher . View Matchers . has Sibling Ċ import Ġandroidx . test . espress o . matcher . View Matchers . is Displayed Ċ import Ġandroidx . test . espress o . matcher . View Matchers . isEnabled Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Id Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Tag Value Ċ import Ġandroidx . test . espress o . matcher . View Matchers . with Text Ċ import Ġorg . dh is 2 . R Ċ import Ġorg . dh is 2 . common . Base Robot Ċ import Ġorg . dh is 2 . common . matchers . Recycler view Matchers . Companion . at Position Ċ import Ġorg . dh is 2 . common . matchers . Recycler view Matchers . Companion . has Item Ċ import Ġorg . dh is 2 . common . matchers . Recycler view Matchers . Companion . isNotEmpty Ċ import Ġorg . dh is 2 . common . matchers . click On Tab Ċ import Ġorg . dh is 2 . common . matchers . is Toast Ċ import Ġorg . dh is 2 . use sc ases . event . entity . Event Status UI Model Ċ import Ġorg . dh is 2 . use sc ases . event . entity . TE I Program Stages UI Model Ċ import Ġorg . dh is 2 . use sc ases . program Stage Selection . Program Stage Selection ViewHolder Ċ import Ġorg . dh is 2 . use sc ases . te i Dashboard . dashboard fragments . te idata . Dashboard Program ViewHolder Ċ import Ġorg . dh is 2 . use sc ases . te i Dashboard . dashboard fragments . te idata . te ie vents . Event ViewHolder Ċ import Ġorg . dh is 2 . use sc ases . te i Dashboard . dashboard fragments . te idata . te ie vents . Stage ViewHolder Ċ import Ġorg . dh is 2 . use sc ases . te id ashboard . entity . Enrollment UI Model Ċ import Ġorg . dh is 2 . use sc ases . te id ashboard . entity . Upper Enrollment UI Model Ċ import Ġorg . hamcrest . Matchers . all Of Ċ import Ġorg . hamcrest . Matchers . equalTo Ċ import Ġorg . hamcrest . Matchers . is OneOf Ċ import Ġorg . hamcrest . Matchers . not Ċ Ċ fun Ġte i Dashboard Robot ( te i Dashboard Robot : ĠTe i Dashboard Robot . () Ġ-> ĠUnit ) Ġ{ ĊĠĠĠ ĠTe i Dashboard Robot (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġte i Dashboard Robot () ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠTe i Dashboard Robot Ġ: ĠBase Robot () Ġ{ ĊĊĠĠĠ Ġfun Ġgo To Notes () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . navigation _ notes )). perform ( click ()) ĊĠĠĠĠĠĠĠ ĠThread . sleep ( 5 0 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġgo To Relationships () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . navigation _ relationships )). perform ( click ()) ĊĠĠĠĠĠĠĠ ĠThread . sleep ( 5 0 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġgo To Analytics () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . navigation _ analytics )). perform ( click ()) ĊĠĠĠĠĠĠĠ ĠThread . sleep ( 5 0 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu More Options () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . more Options )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu Re Open () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . re _ open )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Lock Icon Is Display () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . program _ lock _ text )). check ( matches ( with Text ( R . string . cancelled ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Unlock Icon Is Display () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . program _ lock _ text )). check ( matches ( with Text ( R . string . event _ open ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Can Add Event () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . fab )). check ( matches ( all Of ( is Displayed (), Ġis Enabled ())) ). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . add new )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Event With Position ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item At Position < Dashboard Program ViewHolder >( position , Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Event With ( event Date : ĠString , Ġorg Unit : String ){ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item < Dashboard Program ViewHolder >( all Of ( has Desc endant ( with Text ( event Date )), Ġhas Desc endant ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Text ( org Unit ))), Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Event With ( eventName : ĠString , Ġevent Status : ĠInt , Ġdate : ĠString ){ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item < Dashboard Program ViewHolder >( all Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( eventName )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( event Status )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( date ))), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Group Event ByName ( name : ĠString ){ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item < Dashboard Program ViewHolder >( has Desc endant ( with Text ( name )), Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Fab () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . fab )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Ref erral () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . ref erral )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Cannot Add More Event Toast Is Shown () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . program _ not _ allow _ events )). in Root ( is Toast ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On First Ref erral Event () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . recycler _ view )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( at Position ( 0 , Ġhas Desc endant ( with Text (" Lab Ġmonitoring ")) )))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item At Position < Program Stage Selection ViewHolder >( 0 , Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Ref erral Option () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . one _ time )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Ref erral Next Button () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . action _ button )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event Created Toast Is Shown () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . event _ created )). in Root ( is Toast ()). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event Was Created ( eventName : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 0 , Ġhas Desc endant ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Sibling ( all Of ( with Id ( R . id . program Stage Name ), Ġwith Text ( eventName )))) )))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu De activate () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . deactivate )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu Complete () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . complete )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Lock Complete Icon Is Display () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . program _ lock _ text )). check ( matches ( with Text ( R . string . completed ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Can Not Add Event () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . fab )). check ( matches ( not ( is Displayed ()))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Share Button () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . share Container )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Next QR () Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġqr L enght Ġ= Ġ 1 ĊĊĠĠĠĠĠĠĠ Ġwhile Ġ( qr L enght Ġ< Ġ 8 ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . next )). perform ( click ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġqr L enght ++ ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu Delete TE I () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . dashboard _ menu _ delete _ te i )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Upper Info ( upper Information : ĠUpper Enrollment UI Model ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . incident _ date )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( with Text ( upper Information . incident Date ))) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . enrollment _ date )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( with Text ( upper Information . enrollment Date ))) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . org _ unit )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( with Text ( upper Information . org Unit ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On See Details () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . view More )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Full Details ( enrollment UI Model : ĠEn rollment UI Model ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 1 , Ġhas Desc endant ( with Text ( enrollment UI Model . enrollment Date )))))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmatches ( all Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 2 , Ġhas Desc endant ( with Text ( enrollment UI Model . birthday )))))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmatches ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġall Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 3 , Ġhas Desc endant ( with Text ( enrollment UI Model . org Unit )))))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 4 , Ġhas Desc endant ( all Of ( with Id ( R . id . latitude ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Text ( enrollment UI Model . latitude )))) ))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 4 , Ġhas Desc endant ( all Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith Id ( R . id . longitude ), Ġwith Text ( enrollment UI Model . longitude )))) ))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item At Position < Dashboard Program ViewHolder >( 6 , Ġclick ())) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmatches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 2 , Ġhas Desc endant ( with Text ( enrollment UI Model . name )))))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmatches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 3 , Ġhas Desc endant ( with Text ( enrollment UI Model . lastName )))))) ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . re cyclerView )). check ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmatches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( 4 , Ġhas Desc endant ( with Text ( enrollment UI Model . sex )))))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Schedule New () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . schedul en ew )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu Program En roll ments () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . program _ selector )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Create New Event () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . add new )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event Was Created And Open ( eventName : ĠString , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( position , Ġall Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( eventName )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Tag Value ( equalTo ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ open ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ )))) )))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event Was Created And Closed ( eventName : ĠString , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( position , Ġall Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( eventName )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Tag Value ( is OneOf ( R . drawable . ic _ event _ status _ complete , ĠR . drawable . ic _ event _ status _ complete _ read )))) )))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Menu Delete Enrollment () Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . dashboard _ menu _ delete _ enrollment )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On GroupBy Stage (){ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . group _ events _ by _ stage )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Timeline Events (){ ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . show _ events _ timeline )). perform ( click ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event Was Scheduled ( eventName : ĠString , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( position , Ġall Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( eventName )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Tag Value ( is OneOf ( R . drawable . ic _ event _ status _ schedule , ĠR . drawable . ic _ event _ status _ schedule _ read )))) )))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcheck Event Is Closed ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( position , Ġhas Desc endant ( with Tag Value ( is OneOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ open _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ over due _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ complete _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ skipped _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ schedule _ read ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ )))) ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcheck Event Is Open ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( position , Ġhas Desc endant ( with Tag Value ( is OneOf ( R . drawable . ic _ event _ status _ open , ĠR . drawable . ic _ event _ status _ open _ read )))) ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcheck Event Is Completed ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġat Position ( position , Ġhas Desc endant ( with Tag Value ( is OneOf ( R . drawable . ic _ event _ status _ complete , ĠR . drawable . ic _ event _ status _ complete _ read )))) ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcheck Event IsIn activate ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( is Displayed (), Ġis NotEmpty (), Ġat Position ( position , Ġhas Desc endant ( with Tag Value ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis OneOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ open _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ over due _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ complete _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ skipped _ read , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ event _ status _ schedule _ read )))) ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck All Events Are Inactive ( total Events : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġevent Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġwhile Ġ( event Ġ< Ġtotal Events ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcheck Event IsIn activate ( event ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent ++ ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck All Events Are Opened ( total Events : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġevent Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġwhile Ġ( event Ġ< Ġtotal Events ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcheck Event Is Open ( event ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent ++ ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck All Events Completed ( total Events : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġevent Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġwhile Ġ( event Ġ< Ġtotal Events ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcheck Event Is Completed ( event ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent ++ ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck All Events Are Closed ( total Events : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġevent Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġwhile Ġ( event Ġ< Ġtotal Events ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcheck Event Is Closed ( event ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent ++ ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Stage Group ( program Stage Name : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item < Stage ViewHolder >( has Desc endant ( with Text ( program Stage Name )), Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Event GroupBy Stage ( event Date : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item < Event ViewHolder >( has Desc endant ( all Of ( with Text ( event Date ), Ġwith Id ( R . id . event _ date ))), Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event Was Deleted Stage Group ( te i Program Stages : ĠTE I Program Stages UI Model ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfirst Program Stage Ġ= Ġte i Program Stages . program Stage _ first ĊĠĠĠĠĠĠĠ Ġval Ġsecond Program Stage Ġ= Ġte i Program Stages . program Stage _ second ĊĠĠĠĠĠĠĠ Ġval Ġthird Program Stage Ġ= Ġte i Program Stages . program Stage _ third ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( all Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Item ( all Of ( has Desc endant ( with Text ( first Program Stage . name )), Ġhas Desc endant ( with Text ( first Program Stage . events )))), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Item ( all Of ( has Desc endant ( with Text ( second Program Stage . name )), Ġhas Desc endant ( with Text ( second Program Stage . events )))), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Item ( all Of ( has Desc endant ( with Text ( third Program Stage . name )), Ġhas Desc endant ( with Text ( third Program Stage . events )))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Event State Stage Group ( event Details : ĠEvent Status UI Model ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġstatus Ġ= ĠR . drawable . ic _ event _ status _ open ĊĠĠĠĠĠĠĠ Ġwhen Ġ( event Details . status ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Open " Ġ-> Ġstatus Ġ= Ġ ĠR . drawable . ic _ event _ status _ open ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Over due " Ġ-> Ġstatus Ġ= ĠR . drawable . ic _ event _ status _ over due ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Event ĠCompleted " Ġ-> Ġstatus Ġ= ĠR . drawable . ic _ event _ status _ complete ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Skip " Ġ-> Ġstatus Ġ= ĠR . drawable . ic _ event _ status _ skipped ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Schedule " Ġ-> Ġstatus Ġ= ĠR . drawable . ic _ event _ status _ schedule ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Item ( all Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( event Details . date )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Text ( event Details . org Unit )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Desc endant ( with Tag Value ( is OneOf ( status ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ )))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclick On Event GroupBy Stage Using OU ( org Unit : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( action On Item < Event ViewHolder >( has Desc endant ( all Of ( with Text ( org Unit ), Ġwith Id ( R . id . organisation Unit ))), Ġclick ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Program Stage Is Hidden ( stage Name : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . te i _ recycler )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( not ( has Item ( has Desc endant ( with Text ( stage Name )))))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠOPEN _ EVENT _ STATUS Ġ= ĠR . string . event _ open ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠOVER D UE _ EVENT _ STATUS Ġ= ĠR . string . event _ over due ĊĠĠĠ Ġ} Ċ } Ċ