forked from github/szkolny
[Mobidziennik] Add prefix and suffix for server name login field.
This commit is contained in:
parent
1a543814f4
commit
63b74a9fda
@ -95,6 +95,10 @@ class LoginFormFragment : Fragment(), CoroutineScope {
|
||||
b.textEdit.addTextChangedListener {
|
||||
b.textLayout.error = null
|
||||
}
|
||||
if (credential.prefix != null)
|
||||
b.textLayout.prefixText = app.getString(credential.prefix)
|
||||
if (credential.suffix != null)
|
||||
b.textLayout.suffixText = app.getString(credential.suffix)
|
||||
|
||||
b.textEdit.id = credential.name
|
||||
|
||||
|
@ -259,6 +259,8 @@ object LoginInfo {
|
||||
errorCodes = mapOf(
|
||||
ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_ADDRESS to R.string.login_error_incorrect_address
|
||||
),
|
||||
prefix = R.string.login_mobidziennik_server_prefix,
|
||||
suffix = R.string.login_mobidziennik_server_suffix,
|
||||
isRequired = true,
|
||||
validationRegex = "^[a-z0-9_\\-]+\$",
|
||||
caseMode = FormField.CaseMode.LOWER_CASE
|
||||
@ -397,6 +399,10 @@ object LoginInfo {
|
||||
override val errorCodes: Map<Int, Int>,
|
||||
@StringRes
|
||||
val hintText: Int? = null,
|
||||
@StringRes
|
||||
val prefix: Int? = null,
|
||||
@StringRes
|
||||
val suffix: Int? = null,
|
||||
|
||||
val isRequired: Boolean = true,
|
||||
val validationRegex: String,
|
||||
|
@ -1489,4 +1489,6 @@
|
||||
<string name="messages_compose_draft_discarded">Usunięto wersję roboczą</string>
|
||||
<string name="messages_compose_discard_draft_title">Usuń wersję roboczą</string>
|
||||
<string name="messages_compose_discard_draft_text">Czy chcesz odrzucić zapisaną wersję wiadomości? Spowoduje to również anulowanie wprowadzonych zmian i usunięcie wiadomości.</string>
|
||||
<string name="login_mobidziennik_server_prefix">https://</string>
|
||||
<string name="login_mobidziennik_server_suffix">.mobidziennik.pl/</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user