package Ġnet . k ib ot u . parallax scroll ing view . demo Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . ex oz et . android . core . misc . create Random ImageUrl Ċ import Ġkotlinx . android . synt hetic . main . activity _ main .* Ċ import Ġnet . k ib ot u . android . recyclerview presenter . Presenter Adapter Ċ import Ġnet . k ib ot u . android . recyclerview presenter . Presenter Model Ċ import Ġnet . k ib ot u . parallax scroll ing view . Offset On Page Scroll Listener Ċ import Ġnet . k ib ot u . parallax scroll ing view . Par allax Scrolling View On Page Scroll Listener Ċ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠPres enter Adapter () ĊĠĠĠĠĠĠĠ Ġadapter . register Presenter ( Image Presenter ()) ĊĠĠĠĠĠĠĠ Ġview Pager . adapter Ġ= Ġadapter ĊĊĠĠĠĠĠĠĠ Ġval Ġitems Ġ= Ġ( 0 Ġuntil Ġ 1 0 ). map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPres enter Model ( create Random ImageUrl (), ĠR . layout . item _ image , Ġuuid Ġ= Ġit . toString ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġadapter . submit List ( items ) ĊĊĠĠĠĠĠĠĠ Ġview Pager . register On Page Change Callback ( Par allax Scrolling View On Page Scroll Listener ( listOf ( wave 1 , Ġwave 2 , Ġwave 3 , Ġwave 4 , Ġwave 5 , Ġwave 6 ), Ġ 2 f )) ĊĊĠĠĠĠĠĠĠ Ġview Pager . register On Page Change Callback ( Offset On Page Scroll Listener ( this , Ġroot , Ġitems . indices . map Ġ{ Ġbackground s [ it ] Ġ}, Ġtrue )) ĊĠĠĠ Ġ} Ċ }