package Ġcz . nest res uj u . screens . di ary Ċ Ċ import Ġandroid . app . Dialog Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AlertDialog Ċ import Ġandroidx . core . os . bundle Of Ċ import Ġandroidx . fragment . app . Dialog Fragment Ċ import Ġcz . nest res uj u . R Ċ Ċ /** Ċ Ġ* ĠConfirm ation Ġdialog Ġshown Ġbefore Ġdeleting Ġentry Ġin Ġdi ary . Ċ Ġ*/ Ċ class ĠDi ary Delete Entry Dialog Fragment Ġ: ĠDialog Fragment () Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠKEY _ DI ARY _ ENTRY _ ID Ġ= Ġ" entry _ id " ĊĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance ( entry Id : ĠLong ) Ġ= ĠDi ary Delete Entry Dialog Fragment (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġarguments Ġ= Ġbundle Of ( KEY _ DI ARY _ ENTRY _ ID Ġto Ġentry Id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġentry Id : ĠLong Ġby Ġlazy ( Lazy Thread Safety Mode . NONE ) Ġ{ Ġarguments !!. getLong ( KEY _ DI ARY _ ENTRY _ ID ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate Dialog ( savedInstanceState : ĠBundle ?): ĠDialog Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠAlertDialog . Builder ( require Context ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. setTitle ( R . string . di ary _ delete _ note _ title ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. setMessage ( R . string . di ary _ delete _ note _ text ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Positive Button ( android . R . string . yes ) Ġ{ Ġ_, Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( parent Fragment Ġas ? ĠOn Entry Delete Confirmed Listener )?. on Di ary Entry Delete Confirmed ( entry Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}. set Negative Button ( android . R . string . cancel ) Ġ{ Ġ_, Ġ_ Ġ-> Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinterface ĠOn Entry Delete Confirmed Listener Ġ{ ĊĊĠĠĠĠĠĠĠ Ġfun Ġon Di ary Entry Delete Confirmed ( entry Id : ĠLong ) ĊĠĠĠ Ġ} Ċ }