package Ġcom . y ue ban . y op ic . util Ċ Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . databinding . ViewData Binding Ċ import Ġandroidx . recyclerview . widget . Async Differ Config Ċ import Ġandroidx . recyclerview . widget . Diff Util Ċ import Ġandroidx . recyclerview . widget . ListAdapter Ċ import Ġcom . y ue ban . y op ic . util . concurrent . App Executors Ċ Ċ /** Ċ Ġ* Ġ@ author Ġy ue ban Ċ Ġ* Ġ@ date Ġ 2 0 1 9 / 1 / 7 Ċ Ġ* Ġ@ email Ġfb zh h 0 0 7 @ gmail . com Ċ Ġ*/ Ċ abstract Ġclass ĠBase Binding ListAdapter < T , ĠV Ġ: ĠView Data Binding >( ĊĠĠĠ Ġdiff Callback : ĠDiff Util . Item Callback < T > Ċ ) Ġ: ĠList Adapter < T , ĠBase Binding ViewHolder < V >>( ĊĠĠĠ ĠAsync Differ Config . Builder < T >( diff Callback ) ĊĠĠĠĠĠĠĠ Ġ. setBackground Thread Executor ( App Executors . singleton ()) ĊĠĠĠĠĠĠĠ Ġ. build () Ċ ) Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠBase Binding ViewHolder < V > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= Ġcreate Binding ( parent ) ĊĠĠĠĠĠĠĠ Ġreturn ĠBase Binding ViewHolder ( binding ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġabstract Ġfun Ġcreate Binding ( parent : ĠViewGroup ): ĠV ĊĊĠĠĠ Ġfinal Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠBase Binding ViewHolder < V >, Ġposition : ĠInt ) Ġ{} ĊĊĠĠĠ Ġfinal Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠBase Binding ViewHolder < V >, Ġposition : ĠInt , Ġpayload s : ĠMutable List < Any >) Ġ{ ĊĠĠĠĠĠĠĠ Ġbind ( holder . binding , ĠgetItem ( position ), Ġpayload s ) ĊĠĠĠĠĠĠĠ Ġholder . binding . execute Pending Bindings () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected Ġabstract Ġfun Ġbind ( binding : ĠV , Ġitem : ĠT , Ġpayload s : ĠMutable List < Any >) Ċ }