EmailAddressValidator doesn't need to implement Validator

This commit is contained in:
cketti 2019-12-19 14:45:03 +01:00
parent 617624c84e
commit d80cb6f614

View file

@ -1,14 +1,8 @@
package com.fsck.k9
import android.text.util.Rfc822Tokenizer
import android.widget.AutoCompleteTextView.Validator
import java.util.regex.Pattern
class EmailAddressValidator : Validator {
override fun fixText(invalidText: CharSequence): CharSequence = ""
override fun isValid(text: CharSequence): Boolean = Rfc822Tokenizer.tokenize(text).isNotEmpty()
class EmailAddressValidator {
fun isValidAddressOnly(text: CharSequence): Boolean = EMAIL_ADDRESS_PATTERN.matcher(text).matches()