UnitSelectionEditText

Edit text with blocked selection to prevent user interacting with a unit label.

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyle: Int)

Types

Link copied to clipboard
Listener for unit values selection.

Properties

Link copied to clipboard
@IntRange(from = 1)
open var defaultValue: Int
Default value of the unit.
Link copied to clipboard
@IntRange(from = 1)
open var maximumValue: Int
Maximum value allowed.
Link copied to clipboard
@IntRange(from = 1)
open var minimumValue: Int
Minimum value allowed.
Link copied to clipboard
Link copied to clipboard
Unit length the user cannot select.

Functions

Link copied to clipboard
open fun focusCheck()
Checks if the view has the focus and select the editable value.
Link copied to clipboard
open fun getValue(): Int
Gets current value.
Link copied to clipboard
open fun parseValue(@NonNull s: String): Int
Returns the parsed value of the unit.
Link copied to clipboard
open fun setTextToDefault()
Sets text to default value and notifies the listener if not null.
Link copied to clipboard
open fun setTextToFormat(value: Int)
Sets text properly formatted according to unitLabel.
Link copied to clipboard
open fun setUnitLabel(@NonNull unitLabel: String, @IntRange(from = 1) defaultValue: Int, @IntRange(from = 1) minimumValue: Int, @IntRange(from = 1) maximumValue: Int, @Nullable listener: UnitSelectionEditText.UnitSelectionListener)
Sets unit label.