package Ġcom . co clear app . p dm _ project . Activities Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . recyclerview . widget . Grid LayoutManager Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . co clear app . p dm _ project . Adapters . Sy ll able Adapter Ċ import Ġcom . co clear app . p dm _ project . Models . Sy ll able Ċ import Ġcom . co clear app . p dm _ project . R Ċ Ċ class ĠS yll able Listen Ġ: ĠAppCompatActivity () Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġre xy cl er View : ĠRecyclerView ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġgrid LayoutManager : ĠGrid LayoutManager ?= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġarray List : ArrayList < Sy ll able > Ġ?= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġsy ll able Adapter : ĠS yll able Adapter ?= Ġnull ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ listen ) ĊĊĠĠĠĠĠĠĠ Ġre xy cl er View Ġ= ĠfindViewById ( R . id . recycler _ view _ listen ) ĊĠĠĠĠĠĠĠ Ġgrid LayoutManager Ġ= ĠGrid LayoutManager ( application Context , 2 , ĠLinearLayoutManager . VERTICAL , false ) ĊĠĠĠĠĠĠĠ Ġre xy cl er View ?. layout Manager Ġ= Ġgrid LayoutManager ĊĠĠĠĠĠĠĠ Ġre xy cl er View ?. set Has Fixed Size ( false ) ĊĠĠĠĠĠĠĠ Ġarray List Ġ= ĠArrayList () ĊĠĠĠĠĠĠĠ Ġarray List Ġ= ĠsetData In List () ĊĠĠĠĠĠĠĠ Ġsy ll able Adapter Ġ= ĠS yll able Adapter ( application Context , array List !! ) ĊĠĠĠĠĠĠĠ Ġre xy cl er View ?. adapter Ġ= Ġsy ll able Adapter ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠsetData In List (): ArrayList < Sy ll able >{ ĊĠĠĠĠĠĠĠ Ġvar Ġitems : ArrayList < Sy ll able > Ġ= ĠArrayList () ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . ma )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . me )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . mi )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . mo )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . mu )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . ama )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . ema )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . eme )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . amo )) ĊĠĠĠĠĠĠĠ Ġitems . add ( Sy ll able ( R . drawable . m imo )) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġitems ĊĠĠĠ Ġ} Ċ Ċ }