-
- 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
-
-
Field Summary
Fields Modifier and Type Field Description private final Matcher<View>matcherprivate final Map<KClass<out KAdapterItem<?>>, KAdapterItemType<KAdapterItem<?>>>itemTypesprivate final ViewInteractionDelegateviewprivate ViewInteractionDelegatepopupViewprivate Matcher<Root>root
-
Constructor Summary
Constructors Constructor Description KSpinner(Function1<ViewBuilder, Unit> builder, Function1<KAdapterItemTypeBuilder, Unit> itemTypeBuilder)Constructs view class with view interaction from given ViewBuilder KSpinner(Matcher<View> parent, Function1<ViewBuilder, Unit> builder, Function1<KAdapterItemTypeBuilder, Unit> itemTypeBuilder)Constructs view class with parent and view interaction from given ViewBuilder KSpinner(DataInteraction parent, Function1<ViewBuilder, Unit> builder, Function1<KAdapterItemTypeBuilder, 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 KAdapterItem<?>>, KAdapterItemType<KAdapterItem<?>>>getItemTypes()ViewInteractionDelegategetView()ViewInteractionDelegategetPopupView()UnitsetPopupView(ViewInteractionDelegate popupView)Matcher<Root>getRoot()UnitsetRoot(Matcher<Root> root)final <T extends KAdapterItem<?>> UnitchildAt(Integer position, Function1<T, Unit> function)Performs given actions/assertion on child at given position final <T extends KAdapterItem<?>> UnitfirstChild(Function1<T, Unit> function)Performs given actions/assertion on first child in adapter final <T extends KAdapterItem<?>> UnitlastChild(Function1<T, Unit> function)Performs given actions/assertion on last child in adapter final <T extends KAdapterItem<?>> Unitchildren(Function1<T, Unit> function)Performs given actions/assertion on all children in adapter final <T extends KAdapterItem<?>> TchildWith(Function1<DataBuilder, Unit> childMatcher)Performs given actions/assertion on child that matches given matcher final Unitinvoke(Function1<KSpinner, Unit> function)Operator that allows usage of DSL style final KSpinnerperform(Function1<KSpinner, Unit> function)Infix function for invoking lambda on your viewSometimes instance of view is a result of a function or constructor. final UnitemptyChildAt(Integer position, Function1<KSpinnerItem, Unit> tail)Calls childAt() on your view with base childCalls childAt() on your Spinner and casts received item to KSpinnerItem final UnitemptyFirstChild(Function1<KSpinnerItem, Unit> tail)Calls firstChild() on your view with base childCalls firstChild() on your Spinner and casts received item to KSpinnerItem final UnitemptyLastChild(Function1<KSpinnerItem, Unit> tail)Calls lastChild() on your view with base childCalls lastChild() on your Spinner and casts received item to KSpinnerItem final KSpinnerItememptyChildWith(Function1<DataBuilder, Unit> builder)Calls childWith() on your view with base childCalls childWith() on your Spinner and casts received item to KSpinnerItem Unitopen()Opens the spinner to display it's items Unitclose()Closes the spinner -
Methods inherited from class io.github.kakaocup.kakao.spinner.KSpinner
assert, doesNotExist, getSize, hasAnyTag, hasBackgroundColor, hasBackgroundColor, hasDescendant, hasNotDescendant, hasNotSibling, hasSibling, hasSize, hasTag, hasText, 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 -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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 interactionitemTypeBuilder- 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() matcherbuilder- ViewBuilder which will result in view's interactionitemTypeBuilder- 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 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 KAdapterItem<?>>, KAdapterItemType<KAdapterItem<?>>> getItemTypes()
-
getView
ViewInteractionDelegate getView()
-
getPopupView
ViewInteractionDelegate getPopupView()
-
setPopupView
Unit setPopupView(ViewInteractionDelegate popupView)
-
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 adapterfunction- 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 adaptertail- 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
-
-
-
-