/* Ċ Ġ* ĠCopyright Ġ 2 0 2 0 ĠZ UP ĠIT ĠSER V IC OS ĠEM ĠT EC NO LOG IA ĠE ĠIN OV AC AO ĠSA Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġbr . com . z up . be agle . utils Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġbr . com . z up . be agle . core . Appearance Ċ import Ġbr . com . z up . be agle . core . Layout Component Ċ import Ġbr . com . z up . be agle . core . Server D riven Component Ċ import Ġbr . com . z up . be agle . engine . renderer . Activity Root View Ċ import Ġbr . com . z up . be agle . engine . renderer . Fragment Root View Ċ import Ġbr . com . z up . be agle . engine . renderer . Root View Ċ import Ġbr . com . z up . be agle . engine . renderer . View Renderer Factory Ċ import Ġbr . com . z up . be agle . widget . layout . Container Ċ import Ġbr . com . z up . be agle . widget . layout . Screen Ċ import Ġbr . com . z up . be agle . widget . layout . Screen Component Ċ Ċ internal Ġvar Ġview Renderer Ġ= ĠView Renderer Factory () Ċ Ċ fun ĠServer D riven Component . to View ( context : ĠContext ) Ġ= Ġthis . to View ( context Ġas ĠAppCompatActivity ) Ċ Ċ fun ĠServer D riven Component . to View ( activity : ĠAppCompatActivity ) Ġ= ĊĠĠĠ Ġthis . to View ( Activity Root View ( activity )) Ċ Ċ fun ĠServer D riven Component . to View ( fragment : ĠFragment ) Ġ= Ġthis . to View ( Fragment Root View ( fragment )) Ċ Ċ fun ĠScreen . to View ( activity : ĠAppCompatActivity ) Ġ= Ġthis . to Component (). to View ( activity ) Ċ Ċ fun ĠScreen . to View ( fragment : ĠFragment ) Ġ= Ġthis . to Component (). to View ( fragment ) Ċ Ċ internal Ġfun ĠScreen . to Component () Ġ= ĠScreen Component ( ĊĠĠĠ Ġidentifier Ġ= Ġthis . identifier , ĊĠĠĠ Ġnavigation Bar Ġ= Ġthis . navigation Bar , ĊĠĠĠ Ġchild Ġ= Ġthis . child , ĊĠĠĠ Ġscreen Analytics Event Ġ= Ġscreen Analytics Event Ċ ). apply Appearance ( appearance Ġ?: ĠAp pearance ()) Ċ Ċ internal Ġfun ĠServer D riven Component . to View ( root View : ĠRoot View ) Ġ= ĊĠĠĠ Ġif Ġ( this Ġis ĠLayout Component ) Ġ{ ĊĠĠĠĠĠĠĠ Ġview Renderer . make ( this ). build ( root View ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontainer Ġ= ĠContainer ( listOf ( this )) ĊĠĠĠĠĠĠĠ Ġview Renderer . make ( container ). build ( root View ) ĊĠĠĠ Ġ} Ċ