diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt index ea6bbe4d..3360e93b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt @@ -85,6 +85,9 @@ class LoginFormFragment : Fragment(), CoroutineScope { if (credential is LoginInfo.FormField) { val b = LoginFormFieldItemBinding.inflate(layoutInflater) b.textLayout.hint = app.getString(credential.name) + if (credential.isNumber) { + b.textEdit.inputType = InputType.TYPE_CLASS_NUMBER + } if (credential.hideText) { b.textEdit.inputType = InputType.TYPE_TEXT_VARIATION_PASSWORD b.textLayout.endIconMode = TextInputLayout.END_ICON_PASSWORD_TOGGLE diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt index 77036f19..8a5e60d1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt @@ -179,6 +179,7 @@ object LoginInfo { ERROR_LOGIN_VULCAN_INVALID_PIN_2_REMAINING to R.string.error_312_reason ), isRequired = true, + isNumber = true, validationRegex = "[0-9]+", caseMode = FormField.CaseMode.LOWER_CASE ) @@ -401,6 +402,7 @@ object LoginInfo { val validationRegex: String, val caseMode: CaseMode = CaseMode.UNCHANGED, val hideText: Boolean = false, + val isNumber: Boolean = false, val stripTextRegex: String? = null ) : BaseCredential(keyName, name, errorCodes) { enum class CaseMode { UNCHANGED, UPPER_CASE, LOWER_CASE }