# TextViewKt

Added in 1.1.0

*** ** * ** ***


```
public final class TextViewKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | `https://developer.android.com/reference/androidx/core/widget/TextViewKt#(android.widget.TextView).addTextChangedListener(kotlin.Function4,kotlin.Function4,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/TextView.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function4<https://developer.android.com/reference/java/lang/CharSequence.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> beforeTextChanged, @https://developer.android.com/reference/androidx/annotation/NonNull Function4<https://developer.android.com/reference/java/lang/CharSequence.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onTextChanged, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<https://developer.android.com/reference/android/text/Editable.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> afterTextChanged )` Add a text changed listener to this TextView using the provided actions |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | `https://developer.android.com/reference/androidx/core/widget/TextViewKt#(android.widget.TextView).doAfterTextChanged(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/TextView.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<https://developer.android.com/reference/android/text/Editable.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> action )` Add an action which will be invoked after the text changed. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | `https://developer.android.com/reference/androidx/core/widget/TextViewKt#(android.widget.TextView).doBeforeTextChanged(kotlin.Function4)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/TextView.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function4<https://developer.android.com/reference/java/lang/CharSequence.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> action )` Add an action which will be invoked before the text changed. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | `https://developer.android.com/reference/androidx/core/widget/TextViewKt#(android.widget.TextView).doOnTextChanged(kotlin.Function4)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/TextView.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function4<https://developer.android.com/reference/java/lang/CharSequence.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> action )` Add an action which will be invoked when the text is changing. |

## Public methods

### addTextChangedListener

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/TextView.kt+function:addTextChangedListener) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull TextWatcher addTextChangedListener(
    @NonNull TextView receiver,
    @NonNull Function4<CharSequence, @NonNull Integer, @NonNull Integer, @NonNull Integer, Unit> beforeTextChanged,
    @NonNull Function4<CharSequence, @NonNull Integer, @NonNull Integer, @NonNull Integer, Unit> onTextChanged,
    @NonNull Function1<Editable, Unit> afterTextChanged
)
```

Add a text changed listener to this TextView using the provided actions

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | the `https://developer.android.com/reference/android/text/TextWatcher.html` added to the TextView |

### doAfterTextChanged

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/TextView.kt+function:doAfterTextChanged) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull TextWatcher doAfterTextChanged(
    @NonNull TextView receiver,
    @NonNull Function1<Editable, Unit> action
)
```

Add an action which will be invoked after the text changed.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | the `https://developer.android.com/reference/android/text/TextWatcher.html` added to the TextView |

### doBeforeTextChanged

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/TextView.kt+function:doBeforeTextChanged) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull TextWatcher doBeforeTextChanged(
    @NonNull TextView receiver,
    @NonNull Function4<CharSequence, @NonNull Integer, @NonNull Integer, @NonNull Integer, Unit> action
)
```

Add an action which will be invoked before the text changed.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | the `https://developer.android.com/reference/android/text/TextWatcher.html` added to the TextView |

### doOnTextChanged

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/TextView.kt+function:doOnTextChanged) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull TextWatcher doOnTextChanged(
    @NonNull TextView receiver,
    @NonNull Function4<CharSequence, @NonNull Integer, @NonNull Integer, @NonNull Integer, Unit> action
)
```

Add an action which will be invoked when the text is changing.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/TextWatcher.html` | the `https://developer.android.com/reference/android/text/TextWatcher.html` added to the TextView |