Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
evant authored Sep 16, 2019
1 parent 2ebbf35 commit 9c7ff68
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,31 @@ DiffUtil.DiffResult diffResult = list.calculateDiff(newItems);
list.update(newItems, diffResult);
```

## Paging

Paging is supported through the `bindingcollectionadapter-paging` artifact. First add it to your project

```groovy
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-paging:3.1.1'
```

Then bind a `PagedList` and `DiffUtil.ItemCallback`.

```java
LiveData<PagedList<Item>> pagedList = new LivePagedListBuilder<>(..., 20);
DiffUtil.ItemCallback<Item> diff = ...;
```

```xml
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:items="@{pagedList}"
app:itemBinding="@{itemBinding}"
app:diffConfig="@{diff}" />
```

## Known Issues

### Cannot Resolve the libraries `@BindingAdapter`'s
Expand Down

0 comments on commit 9c7ff68

Please sign in to comment.