Package 

Class KAdapterItemTypeBuilder


  • 
    public final class KAdapterItemTypeBuilder
    
                        

    Class 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.

    • Constructor Detail

      • KAdapterItemTypeBuilder

        KAdapterItemTypeBuilder()
    • Method Detail

      • 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