summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/AccountInput.kt13
1 files changed, 8 insertions, 5 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/AccountInput.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/AccountInput.kt
index 4abbbfe835..527920b624 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/AccountInput.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/AccountInput.kt
@@ -130,6 +130,13 @@ class AccountInput(val parentView: View, val context: Context) {
}
}
+ private fun leaveErrorState() {
+ if (usingErrorColor) {
+ input.setTextColor(enabledTextColor)
+ usingErrorColor = false
+ }
+ }
+
inner class InputWatcher : TextWatcher {
override fun beforeTextChanged(text: CharSequence, start: Int, count: Int, after: Int) {}
@@ -138,11 +145,7 @@ class AccountInput(val parentView: View, val context: Context) {
override fun afterTextChanged(text: Editable) {
inputHasFocus = true
setButtonEnabled(text.length >= MIN_ACCOUNT_TOKEN_LENGTH)
-
- if (usingErrorColor) {
- input.setTextColor(enabledTextColor)
- usingErrorColor = false
- }
+ leaveErrorState()
}
}
}