mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 10:54:36 -06:00
[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) {
|
||||
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
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user