package Ġcom . k sh it ij pat il . element ary editor . ui . edit Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Dialog Fragment Ċ import Ġcom . k sh it ij pat il . element ary editor . databinding . Bottom Sheet SaveChanges Alert Binding Ċ Ċ class ĠSave Changes Alert Bottom Sheet ( ĊĠĠĠ Ġvar Ġon Action Selected Listener : ĠOn Action Selected Listener ? Ġ= Ġnull Ċ ) Ġ: ĠBottom Sheet Dialog Fragment () Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġ_ binding : ĠBottom Sheet SaveChanges Alert Binding ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġval Ġbinding : ĠBottom Sheet SaveChanges Alert Binding Ġget () Ġ= Ġ_ binding !! ĊĊĠĠĠ Ġfun Ġinterface ĠOn Action Selected Listener Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġon Action Selected ( change Action : ĠChange Action ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= ĠBottom Sheet SaveChanges Alert Binding . inflate ( in flater , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġbinding . btn Cancel . setOnClickListener Ġ{ Ġset Action And Dismiss ( Change Action . CANCEL ) Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . btn Discard . setOnClickListener Ġ{ Ġset Action And Dismiss ( Change Action . DISCARD ) Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . btn Save . setOnClickListener Ġ{ Ġset Action And Dismiss ( Change Action . SAVE ) Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġset Action And Dismiss ( change Action : ĠChange Action ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Action Selected Listener ?. on Action Selected ( change Action ) ĊĠĠĠĠĠĠĠ Ġdismiss () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠ Ġ} Ċ }