EmailAddressValidator doesn't need to implement Validator
This commit is contained in:
parent
617624c84e
commit
d80cb6f614
1 changed files with 1 additions and 7 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue