You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION.md
+113
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,119 @@ open class SimpleItemViewHolder(parentView: ViewGroup) : SmartViewHolder<Int>(
120
120
}
121
121
```
122
122
123
+
### Nested adapter
124
+
125
+
#### NEW v5.0.0 with smart-recycler-adapter-nestedadapter library
126
+
127
+
As of `smart-recycler-adapter:v5.0.0` static nested adapter mapping have been removed from `SmartRecyclerAdapter` and is added in this extension library `smart-recycler-adapter-nestedadapter`.
128
+
Default binder in nestedadapter is `SmartNestedAdapterBinder` implements `SmartViewHolderBinder` for basic view holder mapping functionality.
129
+
`SmartRecyclerAdapter` will hold the `SmartNestedAdapterBinder` references and call the default implemented interfaces `OnCreateViewHolderListener`, `OnBindViewHolderListener`, `OnViewRecycledListener` on ViewHolder lifecycle stages.
130
+
`SmartViewHolder` subclasses must implement `SmartNestedRecyclerViewHolder` in order for `SmartNestedAdapterBinder` to get the target recyclerView.
New in `SmartRecyclerAdapter` v2.0.0 is support for statically resolved nested recycler adapter.
187
+
Now you can easily build complex nested adapters without hustle and have full control of the adapter in your view controlling `Fragment` or `Activity`.
188
+
Use the new `create()` method instead of the `into(recyclerView)` to create just the `SmartRecyclerAdapter` then set the adapter to the recycler view in your `ViewHolder`.
189
+
Just implement the `SmartAdapterHolder` interface in your `ViewHolder` and `SmartRecyclerAdapter` will handle the mapping.
190
+
191
+
##### 1. Create your nested SmartRecyclerAdapter
192
+
193
+
```kotlin
194
+
val myWatchListSmartMovieAdapter:SmartRecyclerAdapter=SmartRecyclerAdapter
195
+
.items(myWatchListItems)
196
+
.map(MovieModel::class, ThumbViewHolder::class)
197
+
.addViewEventListener(onItemClickListener { view, viewEventId, position -> playMovie() })
198
+
.create()
199
+
````
200
+
201
+
##### 2. Map myWatchListSmartMovieAdapter with MyWatchListViewHolder
0 commit comments