package Ġedu . uga . cs . fetch rewards android Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . widget . Expand able ListView Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġedu . uga . cs . fetch rewards android . view _ models . H iring Info ViewModel ĊĊ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġexpand able ListView : ĠExpand able ListView ĊĠĠĠ Ġlateinit Ġvar Ġcustom Expand able ListAdapter : ĠCustom Expand able ListAdapter ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġexpand able ListView Ġ= ĠfindViewById ( R . id . expand able ListView ) ĊĠĠĠĠĠĠĠ Ġval ĠviewModel Ġ= ĠViewModel Provider ( this ). get ( H iring Info ViewModel :: class . java ) ĊĠĠĠĠĠĠĠ ĠviewModel . fetch Data () ĊĠĠĠĠĠĠĠ ĠviewModel . get H iring Info Data (). observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġupdate ĠUI ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcustom Expand able ListAdapter Ġ= ĠCustom Expand able ListAdapter ( this , Ġit . keys . toList (), Ġit ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġexpand able ListView . setAdapter ( custom Expand able ListAdapter ) ĊĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ