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
{{ message }}
This repository was archived by the owner on Jan 2, 2021. It is now read-only.
Now you are good to go. Just create the CarAdapter object and set it to your recyclerview. When addData() method is called it will show the items in recyclerview.
112
-
<br/>
113
-
If you want to show multiple viewtypes just create multiple ItemBinders and register inside the adapter.
114
-
115
-
### For different span count in GridLayoutManager
116
-
If the GridLayoutManager has different span count for different view types, then override the getSpanSize() method inside ItemBinder.
117
-
118
-
```
119
-
120
-
@Override public int getSpanSize(int maxSpanCount) {
121
-
return 1; // Return any number which is less than maxSpanCount
122
-
}
123
-
124
-
```
125
-
126
-
Also don't forget to set span size lookup in GridLayoutManager. Adapter has default span size lookup object. Use that object.
Just extend your adapter from SelectableAdapter instead of RecyclerAdapter. Now the adapter is selectable.
176
-
To make an ItemBinder as selectable, extend it from SelectableBinder and also extend ViewHolder from SelectableViewHolder.
177
-
By default, on long press ViewHolder will be selectable if it extends from SelectableViewHolder.
178
-
You can also call `itemSelectionToggled()` to make it selected by yourself. Kindly go through the sample repo implementation.
179
-
<br/>
180
-
Finally, you can call `DataListManager`'s `getSelectedItems()` and `setSelectedItems(List<E> selectedItems)` to get and set selected items respectively.
181
-
182
-
### Using DiffUtil and Payload
183
-
DataListManager and DataItemManager will take care of diffutil. There is no special code needed. But to enable the payloads, you have to pass PayloadProvider to DataListManager's constructor.
I am actively working on expanding the feature set of this library. While i don't have a exact timeline, but here are the future plans. All these will be taken up once 1.0 is released.
217
-
1. Add support for StaggeredGrid layout manager
218
-
2. Move diffutil calculation to background thread
219
-
3. Adding support for swipe listeners with composability as priority
220
-
4. Improve the sample app code and api documentation
221
-
5. Expandable item / group
64
+
Also we have comprehensive wiki pages as well. Take a look at [JCenter](https://github.com/DevAhamed/MultiViewAdapter/wiki).
222
65
223
66
224
67
## Changelog
@@ -236,7 +79,7 @@ Kindly make sure your code is formatted with this codestyle - [Square Java code
236
79
237
80
238
81
## Alternatives
239
-
This library may not suit your needs or imposes too many restrictions. In that case create an issue/feature request. In the mean time check these awesome alternatives as well.
82
+
This library may not suit your needs or imposes too many restrictions. In that case create an issue/feature request. Mean time check these awesome alternatives as well.
240
83
1.[MultipleViewTypesAdapter](https://github.com/yqritc/RecyclerView-MultipleViewTypesAdapter) - Original inspiration for this library.<br/>
0 commit comments