package Ġcom . nb . core . test . explore Ċ Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġandroidx . recyclerview . widget . St agger ed Grid LayoutManager Ċ import Ġcom . hh h . mv vm . recycler . St agger ed Grid Item Decoration Ċ import Ġcom . hh h . one piece . R Ċ import Ġcom . nb . core . Header Adapter Ċ import Ġcom . nb . core . Header ViewHolder Ċ import Ġcom . nb . core . Recycler Fragment Ċ import Ġcom . nb . core . create View Ċ import Ġcom . nb . core . test . main . dip 2 px Ċ import Ġcom . nb . core . test . model . Works Model Ċ Ċ class ĠExplo re Fragment Ġ: ĠRe cycler Fragment < Works Model , ĠString >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate Recycler Adapter () Ġ= ĠExplo re Adapter () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewModel () Ġ= ĠViewModel Provider ( this ). get ( Explore ViewModel :: class . java ) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate LayoutManager () Ġ= ĊĠĠĠĠĠĠĠ ĠSt agger ed Grid LayoutManager ( 2 , ĠSt agger ed Grid LayoutManager . VERTICAL ) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate Item Decoration (): ĠRecyclerView . Item Decoration ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġspace Ġ= Ġdip 2 px ( require Context (), Ġ 6 f ) ĊĠĠĠĠĠĠĠ Ġreturn ĠSt agger ed Grid Item Decoration ( space , Ġspace , Ġdip 2 px ( require Context (), Ġ 8 . 5 f )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate Header Adapter () Ġ= Ġobject Ġ: ĠHeader Adapter () Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġobject Ġ: ĠHeader ViewHolder ( create View ( parent , ĠR . layout . home _ new _ explore _ head _ layout )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġbind () Ġ{} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }