package Ġtk . z iel ony . car b ons ample s . guidelines Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġandroid . support . v 7 . widget . Linear LayoutManager Ċ import Ġcarbon . component . Default Image Text Sub text Item Ċ import Ġcarbon . component . Image Text Sub text Row Ċ import Ġcarbon . recycler . Row Factory Ċ import Ġcarbon . recycler . Row ListAdapter Ċ import Ġkotlinx . android . synt hetic . main . activity _ cr ane .* Ċ import Ġtk . z iel ony . car b ons ample s . R Ċ import Ġtk . z iel ony . random data . Random Data Ċ import Ġtk . z iel ony . random data . common . Drawable Image Generator Ċ import Ġtk . z iel ony . random data . common . Text Generator Ċ import Ġtk . z iel ony . random data . place . String City Generator Ċ Ċ class ĠCr ane Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ cr ane ) ĊĊĠĠĠĠĠĠĠ Ġcr ane _ search . setOnClickListener Ġ{ Ġcr ane _ backdrop Layout . toggle Layout () Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġrandom Data Ġ= ĠRandom Data () ĊĠĠĠĠĠĠĠ Ġrandom Data . add Generators ( array Of ( Drawable Image Generator ( this ), ĠString City Generator (). with Matcher Ġ{ Ġf Ġ-> Ġf . name Ġ== Ġ" text " Ġ}, ĠText Generator (). with Matcher Ġ{ Ġf Ġ-> Ġf . name Ġ== Ġ" sub text " Ġ})) ĊĠĠĠĠĠĠĠ Ġval Ġitems Ġ= Ġrandom Data . generate List ( Default Image Text Sub text Item :: class . java , Ġ 4 ) ĊĊĠĠĠĠĠĠĠ Ġcr ane _ recycler . layout Manager Ġ= ĠLinearLayoutManager ( this ) ĊĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠRow ListAdapter ( Default Image Text Sub text Item :: class . java , ĠRow Factory < Default Image Text Sub text Item > Ġ{ ĠImage Text Sub text Row ( it ) Ġ}) ĊĠĠĠĠĠĠĠ Ġcr ane _ recycler . adapter Ġ= Ġadapter ĊĠĠĠĠĠĠĠ Ġadapter . items Ġ= Ġitems ĊĠĠĠ Ġ} Ċ }