package Ġcom . sun il son . fire note . presentation . shared . dialogs . visibility Dialog Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . sun il son . fire note . R Ċ import Ġcom . sun il son . fire note . presentation . shared . base . Base Fragment Ċ import Ġcom . sun il son . fire note . presentation . shared . interfaces . Has Element List Ċ import Ġcom . sun il son . fire note . presentation . shared . sing letons . Local Settings Manager Ċ import Ġcom . sun il son . fire note . presentation . shared . dialogs . visibility Dialog . adapters . Category Visibility Adapter Ċ import Ġcom . sun il son . fire note . presentation . shared . dialogs . visibility Dialog . adapters . Category Visibility View Ċ import Ġkotlinx . android . synt hetic . main . fragment _ category . view .* Ċ import Ġjavax . inject . Inject ĊĊ Ċ class ĠCategory Fragment Ġ: ĠBase Fragment () Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġlocal Settings Manager : ĠLocal Settings Manager ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġinflater . inflate ( R . layout . fragment _ category , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġval Ġcategory Visibility Adapter Ġ= ĠCategory Visibility Adapter ( context !! , Ġlocal Settings Manager ) ĊĠĠĠĠĠĠĠ Ġview . fragment _ category _ list view . adapter Ġ= Ġcategory Visibility Adapter ĊĊĠĠĠĠĠĠĠ Ġview . fragment _ category _ list view . setOn ItemClickListener Ġ{ Ġ_, Ġv , Ġposition , Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcategory Visibility View Ġ= Ġv Ġas ĠCategory Visibility View ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcategory Visibility View . isChecked Ġ= Ġ! category Visibility View . isChecked ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( category Visibility View . isChecked ) Ġlocal Settings Manager . set Category Vis ib l ity ( category Visibility Adapter . getItem ( position ). id , Ġ- 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġlocal Settings Manager . set Category Vis ib l ity ( category Visibility Adapter . getItem ( position ). id , Ġ 1 ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ( activity Ġas ĠHas Element List ). adapter . check Order And Visibility () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġview . check All . setOnClickListener Ġ{ Ġcategory Visibility Adapter . toggle All ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġview . uncheck All . setOnClickListener Ġ{ Ġcategory Visibility Adapter . toggle All ( false ) Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġview ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance (): ĠCategory Fragment Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠCategory Fragment () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }