package Ġcom . example . bottom sheet android Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . Grid LayoutManager Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Dialog Fragment Ċ import Ġkotlinx . android . synt hetic . main . layout _ modal _ bottom sheet .* ĊĊ Ċ class ĠMy Bottom Sheet Dialog Fragment Ġ: ĠBottom Sheet Dialog Fragment () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . layout _ modal _ bottom sheet , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Created ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Created ( savedInstanceState ) ĊĊĊĠĠĠĠĠĠĠ Ġval Ġitems Ġ= Ġmutable ListOf < Item >() ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Folder ", R . drawable . ic _ baseline _ create _ new _ folder _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" File ", R . drawable . ic _ baseline _ insert _ drive _ file _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Photo ", R . drawable . ic _ baseline _ add _ a _ photo _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Post ", R . drawable . ic _ baseline _ post _ add _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Poll ", R . drawable . ic _ baseline _ poll _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Group ", R . drawable . ic _ baseline _ group _ add _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Alarm ", R . drawable . ic _ baseline _ alarm _ add _ 2 4 )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Item (" Library ", R . drawable . ic _ baseline _ library _ add _ 2 4 )) ĊĊĊĠĠĠĠĠĠĠ Ġre cycler view . layout Manager Ġ= ĠGrid LayoutManager ( context , Ġ 3 ) ĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠRe cycler view Adapter ( items ) ĊĠĠĠĠĠĠĠ Ġre cycler view . adapter Ġ= Ġadapter ĊĊĠĠĠ Ġ} Ċ }