ui / com.schibsted.account.ui.ui.component / CodeInputView

CodeInputView

class CodeInputView : FieldView, OnClickListener, CustomEditText.KeyEventListener, OnLongClickListener

Widget made to allow the user to enter a 6 digits code

Constructors

<init>

CodeInputView(context: Context, attrs: AttributeSet? = null)

Widget made to allow the user to enter a 6 digits code

Inherited Properties

validationRule

lateinit var validationRule: ValidationRule

Functions

getInput

fun getInput(): String?

Return the current input

hideErrorView

fun hideErrorView(): Unit

Hides error message and call .resetFields

isInputValid

fun isInputValid(): Boolean

Checks if the code returned by .getFullInput matches requirement

onClick

fun onClick(view: View): Unit

Calls .hideErrorView if .isErrorVisible return true

onDeleteKeyPressed

fun onDeleteKeyPressed(): Unit

onLongClick

fun onLongClick(v: View?): Boolean

setImeAction

fun setImeAction(imeOption: Int, editorActionListener: OnEditorActionListener): Unit

setTextWatcher

fun setTextWatcher(textWatcher: TextWatcher): Unit

Sets a TextWatcher to .inputViews's EditText

showErrorView

fun showErrorView(): Unit

Shows the error message and apply a red color filter to .inputViews's EditText

Companion Object Properties

EXPECTED_LENGTH

const val EXPECTED_LENGTH: Int