-
- 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.pager2.ViewPager2Actions,io.github.kakaocup.kakao.pager2.ViewPager2AdapterAssertions
public final class KViewPager2 implements ViewPager2Actions, ViewPager2AdapterAssertions, SwipeableActions, BaseAssertions
View with SwipeableActions and ViewPager2Assertions
-
-
Field Summary
Fields Modifier and Type Field Description private final Matcher<View>matcherprivate final Map<KClass<out KViewPagerItem<?>>, KViewPagerItemType<KViewPagerItem<?>>>itemTypesprivate final ViewInteractionDelegateviewprivate Matcher<Root>root
-
Constructor Summary
Constructors Constructor Description KViewPager2(Function1<ViewBuilder, Unit> builder, Function1<KViewPagerItemTypeBuilder, Unit> itemTypeBuilder)Constructs view class with view interaction from given ViewBuilder KViewPager2(Matcher<View> parent, Function1<ViewBuilder, Unit> builder, Function1<KViewPagerItemTypeBuilder, Unit> itemTypeBuilder)Constructs view class with parent and view interaction from given ViewBuilder KViewPager2(DataInteraction parent, Function1<ViewBuilder, Unit> builder, Function1<KViewPagerItemTypeBuilder, Unit> itemTypeBuilder)Constructs view class with parent and view interaction from given ViewBuilder
-
Method Summary
Modifier and Type Method Description final Matcher<View>getMatcher()final Map<KClass<out KViewPagerItem<?>>, KViewPagerItemType<KViewPagerItem<?>>>getItemTypes()ViewInteractionDelegategetView()Matcher<Root>getRoot()UnitsetRoot(Matcher<Root> root)final <T extends KViewPagerItem<?>> UnitchildAt(Integer position, Function1<T, Unit> function)Performs given actions/assertion on child at given position final Unitinvoke(Function1<KViewPager2, Unit> function)Operator that allows usage of DSL style final KViewPager2perform(Function1<KViewPager2, Unit> function)Infix function for invoking lambda on your viewSometimes instance of view is a result of a function or constructor. -
Methods inherited from class io.github.kakaocup.kakao.pager2.KViewPager2
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, scrollBackward, scrollForward, 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.pager2.ViewPager2Actions
swipeDown, swipeLeft, swipeRight, swipeUp -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
KViewPager2
KViewPager2(Function1<ViewBuilder, Unit> builder, Function1<KViewPagerItemTypeBuilder, Unit> itemTypeBuilder)
Constructs view class with view interaction from given ViewBuilder- Parameters:
builder- ViewBuilder which will result in view's interactionitemTypeBuilder- Lambda with receiver where you pass your item providers
-
KViewPager2
KViewPager2(Matcher<View> parent, Function1<ViewBuilder, Unit> builder, Function1<KViewPagerItemTypeBuilder, Unit> itemTypeBuilder)
Constructs view class with parent and view interaction from given ViewBuilder- Parameters:
parent- Matcher that will be used as parent in isDescendantOfA() matcherbuilder- ViewBuilder which will result in view's interactionitemTypeBuilder- Lambda with receiver where you pass your item providers
-
KViewPager2
KViewPager2(DataInteraction parent, Function1<ViewBuilder, Unit> builder, Function1<KViewPagerItemTypeBuilder, Unit> itemTypeBuilder)
Constructs view class with parent and view interaction from given ViewBuilder- Parameters:
parent- DataInteraction that will be used as parent to ViewBuilderbuilder- ViewBuilder which will result in view's interactionitemTypeBuilder- Lambda with receiver where you pass your item providers
-
-
Method Detail
-
getMatcher
final Matcher<View> getMatcher()
-
getItemTypes
final Map<KClass<out KViewPagerItem<?>>, KViewPagerItemType<KViewPagerItem<?>>> getItemTypes()
-
getView
ViewInteractionDelegate getView()
-
childAt
final <T extends KViewPagerItem<?>> Unit childAt(Integer position, Function1<T, Unit> function)
Performs given actions/assertion on child at given position
- Parameters:
position- Position of item in adapterfunction- Tail lambda which receiver will be matched item with given type T
-
invoke
final Unit invoke(Function1<KViewPager2, Unit> function)
Operator that allows usage of DSL style
- Parameters:
function- Tail lambda with receiver which is your view
-
perform
final KViewPager2 perform(Function1<KViewPager2, 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
-
-
-
-