1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-12 04:25:08 -05:00
k-9/src/com/fsck/k9/EmailAddressValidator.java
Jesse Vincent 12d1097a24 Big, scary massive "ant astyle" to get us back to something
approximating AOSP coding standards.
2011-02-06 17:09:48 -05:00

20 lines
531 B
Java

package com.fsck.k9;
import android.text.util.Rfc822Tokenizer;
import android.widget.AutoCompleteTextView.Validator;
public class EmailAddressValidator implements Validator {
public CharSequence fixText(CharSequence invalidText) {
return "";
}
public boolean isValid(CharSequence text) {
return Rfc822Tokenizer.tokenize(text).length > 0;
}
public boolean isValidAddressOnly(CharSequence text) {
return com.fsck.k9.helper.Regex.EMAIL_ADDRESS_PATTERN.matcher(text).matches();
}
}