package Ġcom . sil icon labs . ble demo . g att _ configur ator . dialogs Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . sil icon labs . ble demo . R Ċ import Ġcom . sil icon labs . ble demo . Base . Base Dialog Fragment Ċ import Ġcom . sil icon labs . ble demo . g att _ configur ator . utils . Gatt Configurator Storage Ċ import Ġkotlinx . android . synt hetic . main . dialog _ info _ ok _ cancel .* Ċ Ċ class ĠLeave Gatt Server Config Dialog ( val Ġcallback : ĠCallback ) Ġ: ĠBase Dialog Fragment () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . dialog _ info _ ok _ cancel , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġtv _ dialog _ content . text Ġ= Ġcontext ?. getString ( R . string . title _ un saved _ changes ) ĊĠĠĠĠĠĠĠ Ġtv _ dialog _ content . text Ġ= Ġcontext ?. getString ( R . string . g att _ configur ator _ leave _ config _ dialog _ content ) ĊĊĠĠĠĠĠĠĠ Ġbtn _ ok . text Ġ= Ġcontext ?. getString ( R . string . button _ yes ) ĊĠĠĠĠĠĠĠ Ġbtn _ cancel . text Ġ= Ġcontext ?. getString ( R . string . button _ no ) ĊĊĠĠĠĠĠĠĠ Ġbtn _ ok . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( cb _ dont _ show _ again . isChecked ) ĠG att Configurator Storage ( require Context ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Should Display Leave Gatt Server Config Dialog ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcallback . on Yes Clicked () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdismiss () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbtn _ cancel . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdismiss () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcallback . on No Clicked () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinterface ĠCallback Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġon Yes Clicked () ĊĠĠĠĠĠĠĠ Ġfun Ġon No Clicked () ĊĠĠĠ Ġ} Ċ Ċ }