package Ġorg . wit . guild manager app . dialog Fragments Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . widget . Array Adapter Ċ import Ġandroidx . fragment . app . Dialog Fragment Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġkotlinx . android . synt hetic . main . fragment _ create _ raid _ popup .* Ċ import Ġorg . jetbrains . ank o . An ko Logger Ċ import Ġorg . wit . guild manager app . R Ċ import Ġorg . wit . guild manager app . view Models . Character ViewModel Ċ import Ġorg . wit . guild manager app . view Models . Item ViewModel Ċ import Ġorg . wit . guild manager app . adapters . Character Model Adapter Ċ Ċ class ĠCreate R aid Popup Fragment Ġ: ĠDialog Fragment (), ĠAn ko Logger Ġ{ ĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠviewModel : ĠCharacter ViewModel ĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠviewModel Item : ĠItem ViewModel ĊĠĠĠ Ġprivate Ġval Ġadapter Ġ= ĠCharacter Model Adapter () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Ġ= ĠViewModel Provider ( this ). get ( Character ViewModel :: class . java ) ĊĠĠĠĠĠĠĠ ĠviewModel Item Ġ= ĠViewModel Provider ( this ). get ( Item ViewModel :: class . java ) ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ create _ raid _ popup , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĊĠĠĠĠĠĠĠ ĠviewModel . get Characters () ĊĠĠĠĠĠĠĠ ĠviewModel Item . getItems () ĊĊĠĠĠĠĠĠĠ ĠviewModel . character Model . observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġspinner Adapter Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠArray Adapter ( require Context (), Ġandroid . R . layout . simple _ spinner _ item , Ġit ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġselect _ character . adapter Ġ= Ġspinner Adapter ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ ĠviewModel Item . item Model . observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġitem Spinner Adapter Ġ= ĠArray Adapter ( require Context (), Ġandroid . R . layout . simple _ spinner _ item , Ġit ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġselect _ item . adapter Ġ= Ġitem Spinner Adapter ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĊ ĊĊĠĠĠ Ġ} ĊĊ Ċ }