Skip to content

Commit

Permalink
Update migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
manneohlund authored and Manne Öhlund committed Oct 6, 2020
1 parent b7706b7 commit c506786
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,42 @@ open class SimpleItemViewHolder(parentView: ViewGroup) : SmartViewHolder<Int>(
})
```

## Diff util

#### NEW v5.0.0

With smart-recycler-adapter-diffutil extension library

```groovy
dependencies {
implementation 'io.github.manneohlund:smart-recycler-adapter-diffutil:X.Y.Z'
}
```

No `DiffUtilExtensionBuilder` needed anymore.

```kotlin
SmartRecyclerAdapter
.items(items)
.map(Integer::class, SimpleItemViewHolder::class)
.add(SimpleDiffUtilExtension(predicate))
.into(recyclerView)
```

#### OLD 4.X.X

```kotlin
val adapter = SmartRecyclerAdapter
.items(items)
.map(Integer::class, SimpleItemViewHolder::class)
.into(recyclerView)

diffUtilExtension = DiffUtilExtensionBuilder().apply {
smartRecyclerAdapter = adapter
diffPredicate = predicate
}.build()
```

# 4.X.X & 3.X.X

### ViewEvent Migration
Expand Down

0 comments on commit c506786

Please sign in to comment.