package Ġcom . ark iv an ov . sample . counter . shared . root Ċ Ċ import Ġcom . ark iv an ov . de compose . Component Context Ċ import Ġcom . ark iv an ov . de compose . Router Ċ import Ġcom . ark iv an ov . de compose . Router State Ċ import Ġcom . ark iv an ov . de compose . child Context Ċ import Ġcom . ark iv an ov . de compose . pop Ċ import Ġcom . ark iv an ov . de compose . push Ċ import Ġcom . ark iv an ov . de compose . router Ċ import Ġcom . ark iv an ov . de compose . state keeper . Parcelable Ċ import Ġcom . ark iv an ov . de compose . state keeper . Parcel ize Ċ import Ġcom . ark iv an ov . de compose . value . Value Ċ import Ġcom . ark iv an ov . sample . counter . shared . counter . Counter Ċ import Ġcom . ark iv an ov . sample . counter . shared . counter . Counter Component Ċ import Ġcom . ark iv an ov . sample . counter . shared . inner . Counter Inner Component Ċ import Ġcom . ark iv an ov . sample . counter . shared . root . Counter Root . Child Ċ Ċ class ĠCounter Root Component ( ĊĠĠĠ Ġcomponent Context : ĠComponent Context Ċ ) Ġ: ĠCounter Root , ĠComponent Context Ġby Ġcomponent Context Ġ{ ĊĊĠĠĠ Ġoverride Ġval Ġcounter : ĠCounter Ġ= ĠCounter Component ( child Context ( key Ġ= Ġ" counter "), Ġindex Ġ= Ġ 0 ) ĊĊĠĠĠ Ġprivate Ġval Ġrouter : ĠRouter < Child Configuration , ĠChild > Ġ= ĊĠĠĠĠĠĠĠ Ġrouter ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinitial Configuration Ġ= ĠChild Configuration ( index Ġ= Ġ 0 , Ġis Back Enabled Ġ= Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhandle Back Button Ġ= Ġtrue , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġchild Factory Ġ= Ġ:: resolve Child ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġoverride Ġval Ġrouter State : ĠValue < Router State < *, ĠChild >> Ġ= Ġrouter . state ĊĊĠĠĠ Ġprivate Ġfun Ġresolve Child ( configuration : ĠChild Configuration , Ġcomponent Context : ĠComponent Context ): ĠChild Ġ= ĊĠĠĠĠĠĠĠ ĠChild ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinner Ġ= ĠCounter Inner Component ( component Context , Ġindex Ġ= Ġconfiguration . index ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Back Enabled Ġ= Ġconfiguration . is Back Enabled ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Next Child () Ġ{ ĊĠĠĠĠĠĠĠ Ġrouter . push ( Child Configuration ( index Ġ= Ġrouter . state . value . back Stack . size Ġ+ Ġ 1 , Ġis Back Enabled Ġ= Ġtrue )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Prev Child () Ġ{ ĊĠĠĠĠĠĠĠ Ġrouter . pop () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parcel ize ĊĠĠĠ Ġprivate Ġdata Ġclass ĠChild Configuration ( val Ġindex : ĠInt , Ġval Ġis Back Enabled : ĠBoolean ) Ġ: ĠParcel able Ċ } Ċ