package Ġcom . example . watch list . ui . dashboard . common . bottom sheet . category Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . example . watch list . R Ċ import Ġcom . example . watch list . datamodel . Category Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Dialog Fragment Ċ Ċ class ĠCategory Bottom Sheet ( ĊĠĠĠ Ġprivate Ġval Ġlist : ĠList < Category >, ĊĠĠĠ Ġprivate Ġval Ġlistener : ĠBottom Sheet ClickListener Ċ ) Ġ: ĠBottom Sheet Dialog Fragment (), ĠCategory Recycler Adapter . On ItemClickListener Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . bottom _ sheet _ category , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval Ġre cyclerView : ĠRecyclerView Ġ= Ġview . findViewById ( R . id . category _ recycler _ view ) ĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠCategory Recycler Adapter ( list , Ġthis ) ĊĊĠĠĠĠĠĠĠ Ġre cyclerView . adapter Ġ= Ġadapter ĊĠĠĠĠĠĠĠ Ġre cyclerView . layout Manager Ġ= ĠLinearLayoutManager ( require Context ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonClick Listener ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlistener . on ClickListener ( list [ position ]. name ) ĊĠĠĠĠĠĠĠ Ġdismiss () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinterface ĠBottom Sheet ClickListener Ġ{ ĊĠĠĠĠĠĠĠ Ġfun ĠonClick Listener ( category : ĠString ) ĊĠĠĠ Ġ} Ċ }