Design improvements for registration flow.

This commit is contained in:
Nicholas
2023-01-31 09:21:13 -05:00
committed by Nicholas Tinsley
parent cb01692a50
commit c3bcba6380
16 changed files with 115 additions and 65 deletions

View File

@@ -11,6 +11,7 @@ class VerificationCodeView @JvmOverloads constructor(context: Context, attrs: At
private val containers: MutableList<TextInputLayout> = ArrayList(6)
private var listener: OnCodeEnteredListener? = null
private var index = 0
init {
inflate(context, R.layout.verification_code_view, this)
containers.add(findViewById(R.id.container_zero))
@@ -19,6 +20,8 @@ class VerificationCodeView @JvmOverloads constructor(context: Context, attrs: At
containers.add(findViewById(R.id.container_three))
containers.add(findViewById(R.id.container_four))
containers.add(findViewById(R.id.container_five))
containers.forEach { it.editText?.showSoftInputOnFocus = false }
}
fun setOnCompleteListener(listener: OnCodeEnteredListener?) {
@@ -31,7 +34,10 @@ class VerificationCodeView @JvmOverloads constructor(context: Context, attrs: At
if (index == containers.size) {
listener?.onCodeComplete(containers.joinToString("") { it.editText?.text.toString() })
return
}
containers[index].editText?.requestFocus()
}
fun delete() {