Input Dialog |
---|
![]() |
This module is placed inside the dialogs-input
artifact and the main definition looks like following:
This dialog will emit events of the sealed class type DialogInput.Event
that looks like following:
This dialog allows to get any insert from the user. You can limit the input type by providing a custom android.text.InputType
flag. E.g. like following:
DialogInput(
...
input = DialogInput.Input.Single(
inputType = InputType.TYPE_CLASS_NUMBER // only allow numerical input
)
...
)
This dialog allows you to display multiple inputs as well like following:
DialogInput(
...
input = DialogInput.Input.Single(
input = DialogInput.Input.Multi(
listOf(
DialogInput.Input.Single(hint = "Value 1".asText()),
DialogInput.Input.Single(hint = "Value 2".asText()),
DialogInput.Input.Single(hint = "Value 3".asText()),
)
)
)
...
)
You can find the interface here. If desired you can implement this interface in your custom class and provide whatever logic you want.
A simple default implementation is already added and you can create instances of it like following:
DialogInput(
...
input = DialogInput.Input.Single(
validator = DialogInput.TextValidator(minLength = 1, maxLength = 10) // force the length to be in the range [1, 10], both lengths are nullable to disable an enforcement on each side if desired
)
...
)