Package 

Class KSpinner

  • All Implemented Interfaces:
    io.github.kakaocup.kakao.common.assertions.AdapterAssertions , io.github.kakaocup.kakao.common.assertions.BaseAssertions , io.github.kakaocup.kakao.spinner.SpinnerAdapterActions , io.github.kakaocup.kakao.spinner.SpinnerAdapterAssertions

    
    public final class KSpinner
     implements SpinnerAdapterActions, SpinnerAdapterAssertions, BaseAssertions
                        
    • Constructor Detail

      • KSpinner

        KSpinner(Function1<ViewBuilder, Unit> builder, Function1<KAdapterItemTypeBuilder, Unit> itemTypeBuilder)
        Constructs view class with view interaction from given ViewBuilder
        Parameters:
        builder - ViewBuilder which will result in view's interaction
        itemTypeBuilder - Lambda with receiver where you pass your item providers
      • KSpinner

        KSpinner(Matcher<View> parent, Function1<ViewBuilder, Unit> builder, Function1<KAdapterItemTypeBuilder, Unit> itemTypeBuilder)
        Constructs view class with parent and view interaction from given ViewBuilder
        Parameters:
        parent - Matcher that will be used as parent in isDescendantOfA() matcher
        builder - ViewBuilder which will result in view's interaction
        itemTypeBuilder - Lambda with receiver where you pass your item providers
      • KSpinner

        KSpinner(DataInteraction parent, Function1<ViewBuilder, Unit> builder, Function1<KAdapterItemTypeBuilder, Unit> itemTypeBuilder)
        Constructs view class with parent and view interaction from given ViewBuilder
        Parameters:
        parent - DataInteraction that will be used as parent to ViewBuilder
        builder - ViewBuilder which will result in view's interaction
        itemTypeBuilder - Lambda with receiver where you pass your item providers
    • Method Detail

      • childAt

         final <T extends KAdapterItem<?>> Unit childAt(Integer position, Function1<T, Unit> function)

        Performs given actions/assertion on child at given position

        Parameters:
        position - Position of item in adapter
        function - Tail lambda which receiver will be matched item with given type T
      • firstChild

         final <T extends KAdapterItem<?>> Unit firstChild(Function1<T, Unit> function)

        Performs given actions/assertion on first child in adapter

        Parameters:
        function - Tail lambda which receiver will be matched item with given type T
      • lastChild

         final <T extends KAdapterItem<?>> Unit lastChild(Function1<T, Unit> function)

        Performs given actions/assertion on last child in adapter

        Parameters:
        function - Tail lambda which receiver will be matched item with given type T
      • children

         final <T extends KAdapterItem<?>> Unit children(Function1<T, Unit> function)

        Performs given actions/assertion on all children in adapter

        Parameters:
        function - Tail lambda which receiver will be matched item with given type T
      • childWith

         final <T extends KAdapterItem<?>> T childWith(Function1<DataBuilder, Unit> childMatcher)

        Performs given actions/assertion on child that matches given matcher

        Parameters:
        childMatcher - Matcher for item in adapter
      • invoke

         final Unit invoke(Function1<KSpinner, Unit> function)

        Operator that allows usage of DSL style

        Parameters:
        function - Tail lambda with receiver which is your view
      • perform

         final KSpinner perform(Function1<KSpinner, Unit> function)

        Infix function for invoking lambda on your view

        Sometimes instance of view is a result of a function or constructor. In this specific case you can't call invoke() since it will be considered as tail lambda of your fun/constructor. In such cases please use this function.

        Parameters:
        function - Tail lambda with receiver which is your view
      • emptyChildAt

         final Unit emptyChildAt(Integer position, Function1<KSpinnerItem, Unit> tail)

        Calls childAt() on your view with base child

        Calls childAt() on your Spinner and casts received item to KSpinnerItem

        Parameters:
        position - Position of child in adapter
        tail - Lambda with KSpinnerItem receiver
      • emptyFirstChild

         final Unit emptyFirstChild(Function1<KSpinnerItem, Unit> tail)

        Calls firstChild() on your view with base child

        Calls firstChild() on your Spinner and casts received item to KSpinnerItem

        Parameters:
        tail - Lambda with KSpinnerItem receiver
      • emptyLastChild

         final Unit emptyLastChild(Function1<KSpinnerItem, Unit> tail)

        Calls lastChild() on your view with base child

        Calls lastChild() on your Spinner and casts received item to KSpinnerItem

        Parameters:
        tail - Lambda with KSpinnerItem receiver
      • emptyChildWith

         final KSpinnerItem emptyChildWith(Function1<DataBuilder, Unit> builder)

        Calls childWith() on your view with base child

        Calls childWith() on your Spinner and casts received item to KSpinnerItem

        Parameters:
        builder - Data builder that will match the child view
      • open

         Unit open()

        Opens the spinner to display it's items