package Ġme . yk rank . s 1 next . view . adapter . delegate Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . databinding . Data Binding Util Ċ import Ġandroid . support . v 7 . widget . RecyclerView Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . github . yk rank . android tools . widget . Rx Bus Ċ import Ġme . yk rank . s 1 next . App Ċ import Ġme . yk rank . s 1 next . R Ċ import Ġme . yk rank . s 1 next . data . User Ċ import Ġme . yk rank . s 1 next . data . api . model . Pm Group Ċ import Ġme . yk rank . s 1 next . databinding . Item Pm Group Binding Ċ import Ġme . yk rank . s 1 next . view model . Pm Group ViewModel Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠP m Groups Adapter Delegate ( context : ĠContext ) Ġ: ĠBase Adapter Delegate < Pm Group , ĠP m Groups Adapter Delegate . Binding ViewHolder >( context , ĠP m Group :: class . java ) Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġm Rx Bus : ĠRx Bus ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġm User : ĠUser ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠApp . app Component . inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġpublic Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup ): ĠRecyclerView . ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= ĠData Binding Util . inflate < Item Pm Group Binding >( m LayoutInflater , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . layout . item _ pm _ group , Ġparent , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġbinding . model Ġ= ĠP m Group ViewModel () ĊĠĠĠĠĠĠĠ Ġbinding . rx Bus Ġ= Ġm Rx Bus ĊĠĠĠĠĠĠĠ Ġbinding . user Ġ= Ġm User ĊĠĠĠĠĠĠĠ Ġreturn ĠBinding ViewHolder ( binding ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder Data ( t : ĠP m Group , Ġposition : ĠInt , Ġholder : ĠBinding ViewHolder , Ġpayload s : ĠList < Any >) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= Ġholder . binding ĊĠĠĠĠĠĠĠ Ġbinding . model ?. pm Group ?. set ( t ) ĊĠĠĠĠĠĠĠ Ġbinding . execute Pending Bindings () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠBinding ViewHolder ( val Ġbinding : ĠItem Pm Group Binding ) Ġ: ĠRecyclerView . ViewHolder ( binding . root ) Ċ } Ċ