/* Ċ Copyright Ġ 2 0 2 1 ĠMat he us ĠM ene zes Ċ Ċ Licensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ you Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ You Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat ĊĊĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ċ Unless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ distributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ WITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ See Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ limitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġbr . com . math sem ilio . simple ap od browser . ui . common . manager Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . fragment . app . FragmentManager Ċ import Ġbr . com . math sem ilio . simple ap od browser . R Ċ import Ġbr . com . math sem ilio . simple ap od browser . ui . dialog . datepicker . DatePicker Dialog Ċ import Ġbr . com . math sem ilio . simple ap od browser . ui . dialog . inf od ialog . Info Dialog Builder Ċ import Ġbr . com . math sem ilio . simple ap od browser . ui . dialog . pro mp td ialog . Prompt Dialog Builder Ċ Ċ class ĠDialog Manager ( ĊĠĠĠ Ġprivate Ġval Ġfragment Manager : ĠFragment Manager , ĊĠĠĠ Ġprivate Ġval Ġcontext : ĠContext Ċ ) Ġ{ ĊĠĠĠ Ġfun Ġshow DatePicker Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdate Picker Dialog Ġ= ĠDate Picker Dialog () ĊĠĠĠĠĠĠĠ Ġdate Picker Dialog . show ( fragment Manager , Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġshow Grant External Storage Permission Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinfo Dialog Ġ= ĠInfo Dialog Builder ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Title ( context . getString ( R . string . dialog _ title _ grant _ permission )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Message ( context . getString ( R . string . dialog _ message _ grant _ external _ storage _ permission )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Positive ButtonText ( context . getString ( android . R . string . ok )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠ Ġinfo Dialog . show ( fragment Manager , Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġshow Man ually Grant Permission Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinfo Dialog Ġ= ĠInfo Dialog Builder ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Title ( context . getString ( R . string . dialog _ title _ grant _ permission )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Message ( context . getString ( R . string . dialog _ message _ enable _ permission _ man ually )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Positive ButtonText ( context . getString ( android . R . string . ok )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠ Ġinfo Dialog . show ( fragment Manager , Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġshow Clear Image Cache Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġprompt Dialog Ġ= ĠPrompt Dialog Builder ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Title ( context . getString ( R . string . dialog _ title _ clear _ image _ cache )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Message ( context . getString ( R . string . dialog _ message _ clear _ image _ cache )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Positive ButtonText ( context . getString ( android . R . string . ok )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Negative ButtonText ( context . getString ( R . string . dialog _ button _ text _ cancel )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. setIs Cancel able ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠ Ġprompt Dialog . show ( fragment Manager , Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġshow Confirm Favorite Ap od Deletion Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġprompt Dialog Ġ= ĠPrompt Dialog Builder ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Title ( context . getString ( R . string . dialog _ title _ are _ you _ sure )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Message ( context . getString ( R . string . dialog _ message _ confirm _ ap od _ deletion )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Positive ButtonText ( context . getString ( R . string . dialog _ button _ text _ delete )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Negative ButtonText ( context . getString ( R . string . dialog _ button _ text _ cancel )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. setIs Cancel able ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠ Ġprompt Dialog . show ( fragment Manager , Ġnull ) ĊĠĠĠ Ġ} Ċ } Ċ