forked from github/szkolny
[UI] Use number keyboard in the PIN field in Vulcan. (#68)
This commit is contained in:
parent
dd6a2c0979
commit
5913707519
@ -85,6 +85,9 @@ class LoginFormFragment : Fragment(), CoroutineScope {
|
|||||||
if (credential is LoginInfo.FormField) {
|
if (credential is LoginInfo.FormField) {
|
||||||
val b = LoginFormFieldItemBinding.inflate(layoutInflater)
|
val b = LoginFormFieldItemBinding.inflate(layoutInflater)
|
||||||
b.textLayout.hint = app.getString(credential.name)
|
b.textLayout.hint = app.getString(credential.name)
|
||||||
|
if (credential.isNumber) {
|
||||||
|
b.textEdit.inputType = InputType.TYPE_CLASS_NUMBER
|
||||||
|
}
|
||||||
if (credential.hideText) {
|
if (credential.hideText) {
|
||||||
b.textEdit.inputType = InputType.TYPE_TEXT_VARIATION_PASSWORD
|
b.textEdit.inputType = InputType.TYPE_TEXT_VARIATION_PASSWORD
|
||||||
b.textLayout.endIconMode = TextInputLayout.END_ICON_PASSWORD_TOGGLE
|
b.textLayout.endIconMode = TextInputLayout.END_ICON_PASSWORD_TOGGLE
|
||||||
|
@ -179,6 +179,7 @@ object LoginInfo {
|
|||||||
ERROR_LOGIN_VULCAN_INVALID_PIN_2_REMAINING to R.string.error_312_reason
|
ERROR_LOGIN_VULCAN_INVALID_PIN_2_REMAINING to R.string.error_312_reason
|
||||||
),
|
),
|
||||||
isRequired = true,
|
isRequired = true,
|
||||||
|
isNumber = true,
|
||||||
validationRegex = "[0-9]+",
|
validationRegex = "[0-9]+",
|
||||||
caseMode = FormField.CaseMode.LOWER_CASE
|
caseMode = FormField.CaseMode.LOWER_CASE
|
||||||
)
|
)
|
||||||
@ -401,6 +402,7 @@ object LoginInfo {
|
|||||||
val validationRegex: String,
|
val validationRegex: String,
|
||||||
val caseMode: CaseMode = CaseMode.UNCHANGED,
|
val caseMode: CaseMode = CaseMode.UNCHANGED,
|
||||||
val hideText: Boolean = false,
|
val hideText: Boolean = false,
|
||||||
|
val isNumber: Boolean = false,
|
||||||
val stripTextRegex: String? = null
|
val stripTextRegex: String? = null
|
||||||
) : BaseCredential(keyName, name, errorCodes) {
|
) : BaseCredential(keyName, name, errorCodes) {
|
||||||
enum class CaseMode { UNCHANGED, UPPER_CASE, LOWER_CASE }
|
enum class CaseMode { UNCHANGED, UPPER_CASE, LOWER_CASE }
|
||||||
|
Loading…
Reference in New Issue
Block a user