package Ġcom . lx h . cook community . ui . fragment . mark Ċ Ċ import Ġandroidx . recyclerview . widget . Grid LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . lx h . cook community . R Ċ import Ġcom . lx h . cook community . databinding . Item Goods Binding Ċ import Ġcom . lx h . cook community . model . api . goods . Goods Ċ import Ġcom . lx h . cook community . ui . fragment . common list . Common List Fragment Ċ import Ġcom . lx h . cook community . ui . fragment . common list . Common List Recycler Adapter Ċ import Ġcom . lx h . cook community . ui . fragment . goods detail . jump To Goods Detail Ċ Ċ class ĠMark List Fragment ( val Ġtype : ĠString ) Ġ: ĊĠĠĠ ĠCommon List Fragment < Goods , ĠMark List ViewModel , ĠItem Goods Binding >( ĊĠĠĠĠĠĠĠ Ġclassify Ġ= Ġtype , ĊĠĠĠĠĠĠĠ Ġitem Layout Res Ġ= ĠR . layout . item _ goods , ĊĠĠĠĠĠĠĠ ĠviewModel Clazz Ġ= ĠMark List ViewModel :: class . java , ĊĠĠĠĠĠĠĠ Ġcan Refresh Ġ= Ġtrue , ĊĠĠĠĠĠĠĠ Ġcan Search Ġ= Ġfalse ĊĠĠĠ Ġ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġget LayoutManager (): ĠRecyclerView . LayoutManager Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGrid LayoutManager ( require Context (), Ġ 2 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Custom Recycler Adapter (): ĠCommon List Recycler Adapter < Goods , ĠItem Goods Binding >? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsuper . get Custom Recycler Adapter () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit View () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . init View () ĊĠĠĠĠĠĠĠ ĠviewModel . type Ġ= Ġtype ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . init Data () ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġon Cell Click : Ġ(( Goods ) Ġ-> ĠUnit )? Ġ= Ġ{ ĊĠĠĠĠĠĠĠ Ġcontext ?. jump To Goods Detail ( it ) ĊĠĠĠ Ġ} Ċ Ċ }