package Ġcom . ark iv an ov . sample . counter . shared . ui . android Ċ Ċ import Ġandroid . view . View Ċ import Ġcom . ark iv an ov . de compose . Experimental De compose Api Ċ import Ġcom . ark iv an ov . de compose . extensions . android . Router View Ċ import Ġcom . ark iv an ov . de compose . extensions . android . View Context Ċ import Ġcom . ark iv an ov . de compose . extensions . android . child Ċ import Ġcom . ark iv an ov . de compose . extensions . android . layout Inflater Ċ import Ġcom . ark iv an ov . sample . counter . shared . R Ċ import Ġcom . ark iv an ov . sample . counter . shared . root . Counter Root Ċ Ċ @ Experimental De compose Api Ċ @ Suppress (" FunctionName ") Ġ// ĠFactory Ġfunction Ċ fun ĠView Context . Counter Root View ( counter Root : ĠCounter Root ): ĠView Ġ{ ĊĠĠĠ Ġval Ġlayout Ġ= Ġlayout Inflater . inflate ( R . layout . counter _ root , Ġparent , Ġfalse ) ĊĠĠĠ Ġval Ġnext Button : ĠView Ġ= Ġlayout . findViewById ( R . id . button _ next ) ĊĠĠĠ Ġval Ġrouter : ĠRouter View Ġ= Ġlayout . findViewById ( R . id . router ) ĊĊĠĠĠ Ġnext Button . setOnClickListener Ġ{ Ġcounter Root . onNext Child () Ġ} ĊĊĠĠĠ Ġchild ( layout . findViewById ( R . id . container _ counter )) Ġ{ ĊĠĠĠĠĠĠĠ ĠCounter View ( counter Root . counter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġrouter . children ( counter Root . router State , Ġlifecycle ) Ġ{ Ġparent , Ġchild , Ġ_ Ġ-> ĊĠĠĠĠĠĠĠ Ġparent . removeAll Views () ĊĠĠĠĠĠĠĠ Ġparent . addView ( Counter Inner View ( child . inner )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġlayout Ċ } Ċ