Skip to content

Commit

Permalink
Merge pull request #25 from manneohlund/rc-5.0.0
Browse files Browse the repository at this point in the history
Update migration guide for diff util
  • Loading branch information
manneohlund authored Oct 6, 2020
2 parents 054949b + c506786 commit 8d6ed11
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 8d6ed11

Please sign in to comment.