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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final <ERROR CLASS> itemTypes
    • Method Summary

      Modifier and Type Method Description
      final <ERROR CLASS> getItemTypes()
      final <T extends KAdapterItem<?>> Unit itemType(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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