InputSpinner

class InputSpinner(key: String? = null, func: InputSpinner.() -> Unit) : Input

Input of the type Spinner.

Constructors

Link copied to clipboard
fun InputSpinner(key: String? = null, func: InputSpinner.() -> Unit)

Functions

Link copied to clipboard
fun changeListener(listener: InputSpinnerListener)

Set a listener which returns the new value when it changed.

Link copied to clipboard
fun columns(columns: Int)

Set the amount of columns this input will span.

Link copied to clipboard
fun content(@StringRes contentRes: Int)
fun content(content: String)

Set the content text.

Link copied to clipboard
fun drawable(@DrawableRes drawableRes: Int)

Set a drawable.

Link copied to clipboard
open override fun invokeResultListener(): Unit?

Invoke the result listener which returns the input value.

Link copied to clipboard
fun label(@StringRes labelRes: Int)
fun label(label: String)

Set the label text.

Link copied to clipboard
fun noSelectionText(@StringRes textRes: Int)
fun noSelectionText(text: String)

Set the text when no item is selected.

Link copied to clipboard
fun options(options: List<SpinnerOption>)

Set the SpinnerOption's to to be displayed.

@JvmName(name = "optionsStringRes")
fun options(options: List<Int>)

Set the options with a list of StringRes.

@JvmName(name = "optionsStrings")
fun options(options: List<String>)

Set the options with a list of Strings.

Link copied to clipboard
open override fun putValue(bundle: Bundle, index: Int)

Save the input value into the bundle. Takes the index as an key, if there's no unique input key available.

Link copied to clipboard
fun required(required: Boolean = true)

Require a value before the user can click the positive button.

Link copied to clipboard
fun resultListener(listener: InputSpinnerListener)

Set a listener which returns the final value when the user clicks the positive button.

Link copied to clipboard
fun selected(selectedIndex: Int)

Set the by default selected index.

Link copied to clipboard
open override fun valid(): Boolean

Check if the input value is valid.

Link copied to clipboard
fun visible(visible: Boolean = true)

Set the initial visibility of the input.

Properties

Link copied to clipboard
var value: Int? = null