-
public final class KRecyclerItemTypeBuilderClass that maps types to providing functions
To be able to support different item types in KRecyclerView, this class adds support for mapping item type classes to functions that provide them. KEmptyRecyclerItem is added by default.
-
-
Field Summary
Fields Modifier and Type Field Description private final <ERROR CLASS>itemTypes
-
Constructor Summary
Constructors Constructor Description KRecyclerItemTypeBuilder()
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>getItemTypes()final <T extends KRecyclerItem<?>> UnititemType(Function1<Matcher<View>, T> provideItem)Adds entry that helps KRecyclerView to automatically build child viewsTo make it work, you need to pass here function (lambda, constructor), that takes matcher and returns instance of your item type. -
-
Method Detail
-
getItemTypes
final <ERROR CLASS> getItemTypes()
-
itemType
final <T extends KRecyclerItem<?>> Unit itemType(Function1<Matcher<View>, T> provideItem)
Adds entry that helps KRecyclerView to automatically build child views
To make it work, you need to pass here function (lambda, constructor), that takes matcher and returns instance of your item type. In this case, matcher actually matches root view of your adapter item.
- Parameters:
provideItem- Function that takes matcher of item's root view and returns instance of item view
-
-
-
-