package Ġcom . in motion software . example . flows Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġcom . in motion software . example . Home Activity Ċ import Ġcom . in motion software . example . Home Result Ċ import Ġcom . in motion software . promise kt . Promise Ċ import Ġcom . in motion software . example . flows . AppState . From Begin Ċ import Ġcom . in motion software . example . flows . AppState . From Home Ċ import Ġcom . in motion software . example . flows . AppState . From Login Ċ import Ġcom . in motion software . example . flows . AppState . From Profile Ċ import Ġcom . in motion software . example . views . Profile Fragment Ċ import Ġcom . in motion software . flow kit . android . StateMachine Activity Ċ import Ġcom . in motion software . flow kit . back Ċ import Ġcom . in motion software . flow kit . cancel Ċ import Ġcom . in motion software . promise kt . map ĊĊ Ċ class ĠApp Flow Controller : ĠState Machine Activity < AppState , ĠUnit , ĠUnit >(), ĠApp StateMachine Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġon Begin ( state : ĠApp State , Ġcontext : ĠUnit ): ĠPromise < From Begin > Ġ= ĊĠĠĠĠĠĠĠ ĠPromise . value ( From Begin . Home ( context = context )) ĊĊĠĠĠ Ġoverride Ġfun Ġon Home ( state : ĠApp State , Ġcontext : ĠUnit ): ĠPromise < From Home > Ġ= ĊĠĠĠĠĠĠĠ Ġthis . sub flow ( activity = Home Activity :: class . java , Ġcontext = context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwhen Ġ( it ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠHome Result . Login Ġ-> ĠFrom Home . Login ( context = Unit ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠHome Result . Profile Ġ-> ĠFrom Home . Profile ( context = Unit ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. back Ġ{ ĠFrom Home . Home ( Unit ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. cancel Ġ{ ĠFrom Home . Home ( Unit ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Login ( state : ĠApp State , Ġcontext : ĠUnit ): ĠPromise < From Login > Ġ= ĊĠĠĠĠĠĠĠ Ġthis . sub flow ( state Machine = Login Flow Controller :: class . java , Ġstate = Login Flow State . Begin ( context )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ ĠFrom Login . Home ( Unit ) Ġas ĠFrom Login Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. cancel Ġ{ ĠFrom Login . Home ( Unit ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. back Ġ{ ĠFrom Login . Home ( Unit ) Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun Ġon Profile ( state : ĠApp State , Ġcontext : ĠUnit ): ĠPromise < From Profile > Ġ= ĊĠĠĠĠĠĠĠ Ġthis . sub flow 2 ( fragment = Profile Fragment :: class . java , Ġcontext = context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ ĠFrom Profile . Home ( Unit ) Ġas ĠFrom Profile Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. back Ġ{ ĠFrom Profile . Home ( Unit ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. cancel Ġ{ ĠFrom Profile . Home ( Unit ) Ġ} Ċ }