Package 

Class KAbsListView

  • All Implemented Interfaces:
    io.github.kakaocup.kakao.common.actions.BaseActions , io.github.kakaocup.kakao.common.actions.ScrollableActions , io.github.kakaocup.kakao.common.actions.SwipeableActions , io.github.kakaocup.kakao.common.assertions.AdapterAssertions , io.github.kakaocup.kakao.common.assertions.BaseAssertions , io.github.kakaocup.kakao.list.AbsListViewAdapterActions , io.github.kakaocup.kakao.list.AbsListViewAdapterAssertions , io.github.kakaocup.kakao.scroll.ScrollViewActions

    
    public final class KAbsListView
     implements ScrollViewActions, AbsListViewAdapterActions, BaseAssertions, AbsListViewAdapterAssertions
                        

    View with ScrollViewActions and BaseAssertions. Gives access to it's children

    • Method Summary

      Modifier and Type Method Description
      final Matcher<View> getMatcher()
      final Map<KClass<out KAdapterItem<?>>, KAdapterItemType<KAdapterItem<?>>> getItemTypes()
      ViewInteractionDelegate getView()
      Matcher<Root> getRoot()
      Unit setRoot(Matcher<Root> root)
      final <T extends KAdapterItem<?>> Unit childAt(Integer position, Function1<T, Unit> function) Performs given actions/assertion on child at given position
      final <T extends KAdapterItem<?>> Unit firstChild(Function1<T, Unit> function) Performs given actions/assertion on first child in adapter
      final <T extends KAdapterItem<?>> Unit lastChild(Function1<T, Unit> function) Performs given actions/assertion on last child in adapter
      final <T extends KAdapterItem<?>> Unit children(Function1<T, Unit> function) Performs given actions/assertion on all children in adapter
      final <T extends KAdapterItem<?>> T childWith(Function1<DataBuilder, Unit> childMatcher) Performs given actions/assertion on child that matches given matcher
      final Unit invoke(Function1<KAbsListView, Unit> function) Operator that allows usage of DSL style
      final KAbsListView perform(Function1<KAbsListView, Unit> function) Infix function for invoking lambda on your viewSometimes instance of view is a result of a function or constructor.
      final Unit emptyChildAt(Integer position, Function1<KEmptyAdapterItem, Unit> tail) Calls childAt() on your view with base childCalls childAt() on your AbsListView and casts received item to KEmptyAdapterItem
      final Unit emptyFirstChild(Function1<KEmptyAdapterItem, Unit> tail) Calls firstChild() on your view with base childCalls firstChild() on your AbsListView and casts received item to KEmptyAdapterItem
      final Unit emptyLastChild(Function1<KEmptyAdapterItem, Unit> tail) Calls lastChild() on your view with base childCalls lastChild() on your AbsListView and casts received item to KEmptyAdapterItem
      final KEmptyAdapterItem emptyChildWith(Function1<DataBuilder, Unit> builder) Calls childWith() on your view with base childCalls childWith() on your AbsListView and casts received item to KEmptyAdapterItem
      • Methods inherited from class io.github.kakaocup.kakao.list.KAbsListView

        assert, doesNotExist, getSize, hasAnyTag, hasBackgroundColor, hasBackgroundColor, hasDescendant, hasNotDescendant, hasNotSibling, hasSibling, hasSize, hasTag, inRoot, isActivated, isAutoHandwritingEnabled, isClickable, isCompletelyAbove, isCompletelyBelow, isCompletelyDisplayed, isCompletelyLeftOf, isCompletelyRightOf, isDirty, isDisabled, isDisplayed, isEnabled, isFocusable, isFocused, isForceDarkAllowed, isGone, isHapticFeedbackEnabled, isHovered, isInvisible, isNotClickable, isNotCompletelyDisplayed, isNotDisplayed, isNotFocusable, isNotFocused, isNotSelected, isSelected, isVisible, matches, notMatches, scrollTo, scrollToEnd, scrollToStart
      • Methods inherited from class io.github.kakaocup.kakao.common.actions.ScrollableActions

        act, click, doubleClick, longClick, onFailure, pressImeAction, repeatUntil, scrollTo
      • Methods inherited from class io.github.kakaocup.kakao.scroll.ScrollViewActions

        swipeDown, swipeLeft, swipeRight, swipeUp
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KAbsListView

        KAbsListView(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
      • KAbsListView

        KAbsListView(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
      • KAbsListView

        KAbsListView(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<KAbsListView, Unit> function)

        Operator that allows usage of DSL style

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

         final KAbsListView perform(Function1<KAbsListView, 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<KEmptyAdapterItem, Unit> tail)

        Calls childAt() on your view with base child

        Calls childAt() on your AbsListView and casts received item to KEmptyAdapterItem

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

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

        Calls firstChild() on your view with base child

        Calls firstChild() on your AbsListView and casts received item to KEmptyAdapterItem

        Parameters:
        tail - Lambda with KEmptyAdapterItem receiver
      • emptyLastChild

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

        Calls lastChild() on your view with base child

        Calls lastChild() on your AbsListView and casts received item to KEmptyAdapterItem

        Parameters:
        tail - Lambda with KEmptyAdapterItem receiver
      • emptyChildWith

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

        Calls childWith() on your view with base child

        Calls childWith() on your AbsListView and casts received item to KEmptyAdapterItem

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