package Ġcom . k ier on qu inn . app . t apt ap . ui . screens . settings . gesture . model Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġcom . af ol le st ad . material dialogs . Material Dialog Ċ import Ġcom . af ol le st ad . material dialogs . list . list Items Single Choice Ċ import Ġcom . k ier on qu inn . app . t apt ap . R Ċ import Ġcom . k ier on qu inn . app . t apt ap . models . Tf Model Ċ import Ġcom . k ier on qu inn . app . t apt ap . models . getCurrent Tap Model Ċ import Ġcom . k ier on qu inn . app . t apt ap . components . base . Base Bottom Sheet Dialog Fragment Ċ import Ġorg . k oin . android . view model . ext . android . viewModel Ċ Ċ class ĠSettings Gesture Model Bottom Sheet Dialog Fragment : ĠBase Bottom Sheet Dialog Fragment () Ġ{ ĊĊĠĠĠ Ġprivate Ġval ĠviewModel Ġby ĠviewModel < Settings Gesture Model Bottom Sheet ViewModel >() ĊĊĠĠĠ Ġoverride Ġfun Ġon Material Dialog Created ( material Dialog : ĠMaterial Dialog , ĠsavedInstanceState : ĠBundle ?) Ġ= Ġmaterial Dialog . apply Ġ{ ĊĠĠĠĠĠĠĠ Ġtitle ( R . string . setting _ gesture _ model ) ĊĠĠĠĠĠĠĠ Ġpositive Button ( android . R . string . ok ) ĊĠĠĠĠĠĠĠ Ġnegative Button ( android . R . string . cancel ) ĊĠĠĠĠĠĠĠ Ġval Ġcurrently Selected Ġ= Ġcontext . getCurrent Tap Model () ĊĠĠĠĠĠĠĠ Ġval Ġvalues Ġ= ĠT f Model . values (). map Ġ{ Ġit Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġcurrently SelectedIndex Ġ= Ġvalues . indexOf ( currently Selected ) ĊĠĠĠĠĠĠĠ Ġlist Items Single Choice ( R . array . device _ model _ keys , Ġinitial Selection Ġ= Ġcurrently SelectedIndex ){ Ġdialog , Ġindex , Ġtext Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġvalue Ġ= Ġvalues [ index ] ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . on Model Selected ( value ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ }