package Ġcom . b _ lam . resp l ash . ui . don ation Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . lifecycle . observe Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . air bnb . lott ie . Lot tie Animation View Ċ import Ġcom . b _ lam . resp l ash . R Ċ import Ġcom . b _ lam . resp l ash . data . billing . model . Aug ment ed Sku Details Ċ import Ġcom . b _ lam . resp l ash . ui . base . Base Activity Ċ import Ġcom . b _ lam . resp l ash . ui . widget . recyclerview . Spacing Item Decoration Ċ import Ġcom . b _ lam . resp l ash . util . li ved ata . observe Event Ċ import Ġcom . b _ lam . resp l ash . util . load Bl urred Image Ċ import Ġcom . b _ lam . resp l ash . util . setup ActionBar Ċ import Ġcom . google . android . material . dialog . Material AlertDialog Builder Ċ import Ġkotlinx . android . synt hetic . main . activity _ don ate .* Ċ import Ġorg . k oin . android x . view model . ext . android . viewModel Ċ Ċ class ĠDon ation Activity Ġ: ĠBase Activity (), ĠDon ation Adapter . Item Event Callback Ġ{ ĊĊĠĠĠ Ġoverride Ġval ĠviewModel : ĠDon ation ViewModel Ġby ĠviewModel () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ don ate ) ĊĊĠĠĠĠĠĠĠ Ġsetup ActionBar ( R . id . toolbar ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtitle Ġ= ĠgetString ( R . string . support _ development ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Display Home As Up Enabled ( true ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġdon ation Adapter Ġ= ĠDon ation Adapter ( this ) ĊĊĠĠĠĠĠĠĠ Ġre cycler _ view . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġdon ation Adapter ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( this @ Don ation Activity ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġadd Item Decoration ( Spacing Item Decoration ( this @ Don ation Activity , ĠR . dim en . key line _ 7 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . banner Photo LiveData . observe ( this ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbanner _ image _ view . load Bl urred Image ( it . urls . small , Ġit . color ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . sku Details LiveData . observe ( this ) Ġ{ Ġsku Details List Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdon ation Adapter . submit List ( sku Details List . sorted By Ġ{ Ġit . price Amount Micro s Ġ}) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . purchase Complete LiveData . observe Event ( this ) Ġ{ Ġshow Thanks Dialog () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġshow Thanks Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġlayout Inflater . inflate ( R . layout . dialog _ thanks , Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġanimation View Ġ= Ġview . findViewById < Lot tie Animation View >( R . id . tro phy _ animation _ view ) ĊĠĠĠĠĠĠĠ Ġanimation View . setOnClickListener Ġ{ Ġanimation View . play Animation () Ġ} ĊĠĠĠĠĠĠĠ ĠMaterial AlertDialog Builder ( this ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. setView ( view ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Positive Button ( R . string . you _ are _ welcome ) Ġ{ Ġdialog Interface , Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdialog Interface . dismiss () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Sku Details Click ( augment ed Sku Details : ĠAug ment ed Sku Details ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . make Purchase ( this , Ġaugment ed Sku Details ) ĊĠĠĠ Ġ} Ċ } Ċ