Commit 21385185 authored by Alex Baker's avatar Alex Baker Committed by Ricki Hirner

Clear password error on text changed

parent b7e60cd1
Pipeline #123897298 passed with stages
in 8 minutes and 37 seconds
......@@ -30,6 +30,10 @@ class DefaultLoginCredentialsModel: ViewModel() {
loginWithEmailAddress.value = true
}
fun clearPasswordError(s: CharSequence, start: Int, before: Int, count: Int) {
passwordError.value = null
}
@MainThread
fun initialize(intent: Intent) {
if (initialized)
......
......@@ -79,6 +79,7 @@
android:hint="@string/login_password"
app:endIconMode="password_toggle"
app:error="@{model.passwordError}">
<!--suppress AndroidUnknownAttribute -->
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -86,6 +87,7 @@
android:autofillHints="password"
android:fontFamily="monospace"
android:inputType="textPassword"
android:onTextChanged="@{model::clearPasswordError}"
tools:ignore="UnusedAttribute" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
......@@ -139,6 +141,7 @@
android:hint="@string/login_password"
app:endIconMode="password_toggle"
app:error="@{model.passwordError}">
<!--suppress AndroidUnknownAttribute -->
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -146,6 +149,7 @@
android:text="@={model.password}"
android:autofillHints="password"
android:inputType="textPassword"
android:onTextChanged="@{model::clearPasswordError}"
tools:ignore="UnusedAttribute" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment