Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# UsernameFilterGMail

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/text/LoginFilter.UsernameFilterGMail "View this page in Java")

```
open class UsernameFilterGMail : LoginFilter
```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [android.text.LoginFilter](https://developer.android.com/reference/kotlin/android/text/LoginFilter) ||
|   | ↳ | [android.text.LoginFilter.UsernameFilterGMail](https://developer.android.com/reference/kotlin/android/text/LoginFilter.UsernameFilterGMail#) |

*** ** * ** ***

| **This class was deprecated in API level 30.**
|
| Do not encode assumptions about Google account names into client applications.

This filter rejects characters in the user name that are not compatible with GMail account creation. It prevents the user from entering user names with characters other than \[a-zA-Z0-9.\].

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/text/LoginFilter.UsernameFilterGMail#UsernameFilterGMail()()` <br /> |
| `https://developer.android.com/reference/kotlin/android/text/LoginFilter.UsernameFilterGMail#UsernameFilterGMail(kotlin.Boolean)(appendInvalid: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` <br /> |

| Public methods ||
|---|---|
| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/text/LoginFilter.UsernameFilterGMail#isAllowed(kotlin.Char)(c: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html)` Returns whether or not we allow character c. |

| Inherited functions ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/text/LoginFilter` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/android/text/LoginFilter#filter(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int,%20android.text.Spanned,%20kotlin.Int,%20kotlin.Int)(source: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html!, start: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, end: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, dest: https://developer.android.com/reference/kotlin/android/text/Spanned!, dstart: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, dend: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` This method is called when the buffer is going to replace the range `dstart ... dend` of `dest` with the new text from the range `start ... end` of `source`. Returns the CharSequence that we want placed there instead, including an empty string if appropriate, or `null` to accept the original replacement. Be careful to not to reject 0-length replacements, as this is what happens when you delete text. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/text/LoginFilter#onInvalidCharacter(kotlin.Char)(c: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html)` Called whenever we encounter an invalid character. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/text/LoginFilter#onStart()()` Called when we start processing filter. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/text/LoginFilter#onStop()()` Called when we're done processing filter <br /> | ||

## Public constructors

### UsernameFilterGMail

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
UsernameFilterGMail()
```

### UsernameFilterGMail

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
UsernameFilterGMail(appendInvalid: Boolean)
```

## Public methods

### isAllowed

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun isAllowed(c: Char): Boolean
```

**Deprecated:** *Deprecated in Java.*

Returns whether or not we allow character c. Subclasses must override this method.