package Ġm ur ki . github explorer . ui Ċ Ċ import Ġandroid . support . v 7 . recyclerview . extensions . ListAdapter Ċ import Ġandroid . util . Log Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġm ur ki . github explorer . databinding . Repo Item Binding Ċ import Ġm ur ki . github explorer . view model . Repo Item VM Ċ Ċ class ĠMain Adapter Ġ: ĠList Adapter < Repo Item VM , ĠData Binding Holder < Repo Item Binding >>( Repo Item Diff ()) Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠData Binding Holder < Repo Item Binding > Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . d ( CLASS NAME , Ġ" onCreate ViewHolder () Ġcalled . ĠIn fl ating Ġview Ġfor Ġrow . Ġview Type =$ view Type ") ĊĠĠĠĠĠĠĠ Ġval Ġbinding : ĠRepo Item Binding Ġ= ĠRepo Item Binding . inflate ( LayoutInflater . from ( parent . context ), Ġparent , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn ĠData Binding Holder ( binding ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠData Binding Holder < Repo Item Binding >, Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . d ( CLASS NAME , Ġ" on Bind ViewHolder () Ġcalled . ĠBinding Ġdata Ġto Ġview . Ġhas Pending Bindings =${ holder . binding . has Pending Bindings () }") ĊĠĠĠĠĠĠĠ Ġholder . binding . viewModel Ġ= ĠgetItem ( position ) ĊĠĠĠĠĠĠĠ Ġif Ġ( holder . binding . has Pending Bindings ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġholder . binding . execute Pending Bindings () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠCLASS NAME Ġ= Ġ" Main Adapter " ĊĠĠĠ Ġ} Ċ Ċ } Ċ