OtpState

Immutable state of one OTP field.

code contains only characters of charset (ASCII digits 0-9 by default) and is never longer than length. Counts such as enteredDigitCount and OtpLength.digitCount count characters, letters included. The host app is responsible for verifying the code with its server and for clearing the state when the screen is left or the code expires. After a failed verification, call cleared or let the user edit the code, so that the next full code reports completion again.

Constructors

Link copied to clipboard
constructor(length: OtpLength)

Creates an empty numeric state without an error.

constructor(length: OtpLength, charset: OtpCharset)

Creates an empty state for charset without an error.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Which characters code may contain.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns an empty state with the same length and charset and no error.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Marks the current code as rejected, for example after failed server verification.

Link copied to clipboard

Applies the full current text of the input field.

Link copied to clipboard

Removes the error mark and keeps the current code.