@@ -23,7 +23,7 @@ _In addition, since 4.0.0 we have migrated to fully build with Kotlin. If you do
2323
2424``` groovy
2525dependencies {
26- implementation 'com.drakeet.multitype:multitype:4.2 .0'
26+ implementation 'com.drakeet.multitype:multitype:4.3 .0'
2727}
2828```
2929
@@ -50,7 +50,8 @@ class FooViewDelegate: ItemViewDelegate<Foo, FooViewDelegate.ViewHolder>() {
5050
5151 override fun onBindViewHolder (holder : ViewHolder , item : Foo ) {
5252 holder.fooView.text = item.value
53- Log .d(" ItemViewDelegate API" , " position: ${getPosition(holder)} " )
53+
54+ Log .d(" ItemViewDelegate API" , " position: ${holder.bindingAdapterPosition} " )
5455 Log .d(" ItemViewDelegate API" , " items: $adapterItems " )
5556 Log .d(" ItemViewDelegate API" , " adapter: $adapter " )
5657 Log .d(" More" , " Context: ${holder.itemView.context} " )
@@ -76,7 +77,14 @@ class FooViewDelegate : ViewDelegate<Foo, FooView>() {
7677 override fun onBindView (view : FooView , item : Foo ) {
7778 view.imageView.setImageResource(item.imageResId)
7879 view.textView.text = item.text
79- // Or bind the data in the FooView by calling view.setFoo(item)
80+
81+ view.textView.text = """
82+ |${item.text}
83+ |viewHolder: ${view.holder}
84+ |layoutPosition: ${view.layoutPosition}
85+ |absoluteAdapterPosition: ${view.absoluteAdapterPosition}
86+ |bindingAdapterPosition: ${view.bindingAdapterPosition}
87+ """ .trimMargin()
8088 }
8189}
8290```
0 commit comments