Package 

Class KRecyclerView

  • 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.recycler.RecyclerActions , io.github.kakaocup.kakao.recycler.RecyclerAdapterAssertions

    
    public final class KRecyclerView
     implements RecyclerActions, BaseAssertions, RecyclerAdapterAssertions
                        

    View with RecyclerActions, BaseAssertions and RecyclerAdapterAssertions. Gives access to it's children

    • Method Summary

      Modifier and Type Method Description
      final Matcher<View> getMatcher()
      final Map<KClass<out KRecyclerItem<?>>, KRecyclerItemType<KRecyclerItem<?>>> getItemTypes()
      ViewInteractionDelegate getView()
      Matcher<Root> getRoot()
      Unit setRoot(Matcher<Root> root)
      final <T extends KRecyclerItem<?>> Unit childAt(Integer position, Function1<T, Unit> function) Performs given actions/assertion on child at given position
      final <T extends KRecyclerItem<?>> Unit firstChild(Function1<T, Unit> function) Performs given actions/assertion on first child in adapter
      final <T extends KRecyclerItem<?>> Unit lastChild(Function1<T, Unit> function) Performs given actions/assertion on last child in adapter
      final <T extends KRecyclerItem<?>> Unit children(Function1<T, Unit> function) Performs given actions/assertion on all children in adapter
      final <T extends KRecyclerItem<?>> T childWith(Function1<ViewBuilder, Unit> childMatcher) Performs given actions/assertion on child that matches given matcher
      final Integer getPosition(Function1<ViewBuilder, Unit> childMatcher) Returns the adapter position of item matched by given matcher
      final Unit invoke(Function1<KRecyclerView, Unit> function) Operator that allows usage of DSL style
      final KRecyclerView perform(Function1<KRecyclerView, 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<KEmptyRecyclerItem, Unit> tail) Calls childAt() on your view with base childCalls childAt() on your KRecyclerView and casts received item to KEmptyRecyclerItem
      final Unit emptyFirstChild(Function1<KEmptyRecyclerItem, Unit> tail) Calls firstChild() on your view with base childCalls firstChild() on your KRecyclerView and casts received item to KEmptyRecyclerItem
      final Unit emptyLastChild(Function1<KEmptyRecyclerItem, Unit> tail) Calls lastChild() on your view with base childCalls lastChild() on your KRecyclerView and casts received item to KEmptyRecyclerItem
      final KEmptyRecyclerItem emptyChildWith(Function1<ViewBuilder, Unit> builder) Calls childWith() on your view with base childCalls childWith() on your KRecyclerView and casts received item to KEmptyRecyclerItem
      • Methods inherited from class io.github.kakaocup.kakao.recycler.KRecyclerView

        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, scrollTo, 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.recycler.RecyclerActions

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

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

      • KRecyclerView

        KRecyclerView(Function1<ViewBuilder, Unit> builder, Function1<KRecyclerItemTypeBuilder, 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
      • KRecyclerView

        KRecyclerView(Matcher<View> parent, Function1<ViewBuilder, Unit> builder, Function1<KRecyclerItemTypeBuilder, 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
      • KRecyclerView

        KRecyclerView(DataInteraction parent, Function1<ViewBuilder, Unit> builder, Function1<KRecyclerItemTypeBuilder, 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 KRecyclerItem<?>> 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 KRecyclerItem<?>> 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 KRecyclerItem<?>> 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 KRecyclerItem<?>> 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 KRecyclerItem<?>> T childWith(Function1<ViewBuilder, Unit> childMatcher)

        Performs given actions/assertion on child that matches given matcher

        Parameters:
        childMatcher - Matcher for item in adapter
      • getPosition

         final Integer getPosition(Function1<ViewBuilder, Unit> childMatcher)

        Returns the adapter position of item matched by given matcher

        Parameters:
        childMatcher - Matcher that will be used to find item
      • invoke

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

        Operator that allows usage of DSL style

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

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

        Calls childAt() on your view with base child

        Calls childAt() on your KRecyclerView and casts received item to KEmptyRecyclerItem

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

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

        Calls firstChild() on your view with base child

        Calls firstChild() on your KRecyclerView and casts received item to KEmptyRecyclerItem

        Parameters:
        tail - Lambda with KEmptyRecyclerItem receiver
      • emptyLastChild

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

        Calls lastChild() on your view with base child

        Calls lastChild() on your KRecyclerView and casts received item to KEmptyRecyclerItem

        Parameters:
        tail - Lambda with KEmptyRecyclerItem receiver
      • emptyChildWith

         final KEmptyRecyclerItem emptyChildWith(Function1<ViewBuilder, Unit> builder)

        Calls childWith() on your view with base child

        Calls childWith() on your KRecyclerView and casts received item to KEmptyRecyclerItem

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