-
public final class KAdapterItemTypeBuilderClass that maps types to providing functions
To be able to support different item types in KListView, this class adds support for mapping item type classes to functions that provide them. KEmptyAdapterItem is added by default.
-
-
Field Summary
Fields Modifier and Type Field Description private final <ERROR CLASS>itemTypes
-
Constructor Summary
Constructors Constructor Description KAdapterItemTypeBuilder()
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>getItemTypes()final <T extends KAdapterItem<?>> UnititemType(Function1<DataInteraction, T> provideItem)Adds entry that helps KListView 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 KAdapterItem<?>> Unit itemType(Function1<DataInteraction, T> provideItem)
Adds entry that helps KListView 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 your KListView and additional matchers that were used (in firstChild(), childAt(), etc.)
- Parameters:
provideItem- Function that takes data interaction of list view and returns instance of item view
-
-
-
-