package Ġcom . t ory . dm zj . ui . com ic Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . support . v 7 . widget . Grid LayoutManager Ċ import Ġandroid . support . v 7 . widget . RecyclerView Ċ import Ġcom . bump tech . glide . G lide Ċ import Ġcom . t ory . dm zj . R Ċ import Ġcom . t ory . dm zj . bean . Car to on Category Model Ċ import Ġcom . t ory . dm zj . networks . Ret rofit Helper Ċ import Ġcom . t ory . dm zj . recycler . Base Recycler Adapter Ċ import Ġcom . t ory . dm zj . recycler . Base ViewHolder Ċ import Ġcom . t ory . dm zj . ui . base . Base Recycler Page Fragment Ċ import Ġcom . t ory . dm zj . utils . L Ċ import Ġio . reactivex . android . schedul ers . Android Schedulers Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ Ċ class ĠCar to on Category Fragment Ġ: ĠBase Recycler Page Fragment < Car to on Category Fragment . Category Adapter >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Adapter (): ĠCategory Adapter Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠCategory Adapter () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġbind Layout (): ĠInt Ġ= R . layout . fragment _ car to on _ category ĊĊĠĠĠ Ġoverride Ġfun Ġcreate LayoutManager ( context : ĠContext ): ĠRecyclerView . LayoutManager Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGrid LayoutManager ( context , Ġ 3 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Item Decoration ( context : ĠContext ): ĠRecyclerView . Item Decoration ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġrefresh Data ( car to on Category Models : ĠList < Car to on Category Model >) Ġ{ ĊĠĠĠĠĠĠĠ Ġm Recycler Adapter . clear () ĊĠĠĠĠĠĠĠ Ġm Recycler Adapter . addAll ( car to on Category Models ) ĊĠĠĠĠĠĠĠ Ġm Recycler Adapter . notify DataSet Changed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġfetch Data () Ġ{ ĊĠĠĠĠĠĠĠ ĠRet rofit Helper . com ic Service . get Car to on Category () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. compose ( bind To Lifecycle ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe ({ car to on Category Models Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠL . d (" onNext Ġinfos =" Ġ+ Ġcar to on Category Models ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrefresh Data ( car to on Category Models ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ},{ e Ġ-> L . e ( TAG , Ġ" fetch Data Ġerror ", Ġe ) Ġ},{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Swipe Refresh . is Refresh ing Ġ= Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinner Ġclass ĠCategory Adapter Ġ: ĠBase Recycler Adapter < Car to on Category Model >( R . layout . item _ car to on _ category ) Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġconvert ( holder : ĠBase ViewHolder , Ġitem : ĠCar to on Category Model ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġholder . setText ( R . id . title , Ġitem . title ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠG lide . with ( this @ Car to on Category Fragment ). load ( item . cover ). into ( holder . getView ( R . id . iv _ cover )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval ĠTAG Ġ= Ġ" Car to on Category Fragment " ĊĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance (): ĠCar to on Category Fragment { ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠCar to on Category Fragment () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }// ĠRequired Ġempty Ġpublic Ġconstructor Ċ