Skip to content

Commit c5a0f74

Browse files
committed
update documentation
1 parent 97f2f8d commit c5a0f74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ recyclerView.adapter = SimpleRecyclerViewAdapter<User>().apply {
6262
SimpleRecyclerViewAdapter<DataType> adapter = new SimpleRecyclerViewAdapter<>();
6363
adapter.setItemLayout(R.layout.your_item_layot);
6464
adapter.setList(yourList);
65-
adapter.setOnBindViewHolder(new Function2<SimpleRecyclerViewAdapter.ViewHolder, String, Unit>() {
65+
adapter.setOnBindViewHolder(new Function2<SimpleRecyclerViewAdapter.ViewHolder, DataType, Unit>() {
6666
@Override
6767
public Unit invoke(SimpleRecyclerViewAdapter.ViewHolder viewHolder, DataType data) {
6868
// bind data here
@@ -74,8 +74,8 @@ SimpleRecyclerViewAdapter<DataType> adapter = new SimpleRecyclerViewAdapter<>();
7474
As you can see, casting is mandatory. Remember that this is a general porpose Adapter, althougth it is returning your own object, the class itself dont know it.
7575

7676
### Troubleshooting
77-
Naturally the adapter needs an item_layout, an list and an onBindViewHolder() implementation to display the list on screen.
78-
None of this is optional, so not setting them may lead to runtime app crash.
77+
Naturally, the adapter needs an **item_layout**, an **list** and an **onBindViewHolder()** implementation to display the list on screen.
78+
NONE OF THIS ARE OPTIONAL, so not setting them may lead to runtime app crash.
7979
```kotlin
8080
// this is what you need to a void
8181
recyclerView.adapter = SimpleRecyclerViewAdapter<DataType>()

0 commit comments

Comments
 (0)