TextViewKt

Added in 1.1.0

public final class TextViewKt


Summary

Public methods

static final @NonNull TextWatcher
addTextChangedListener(
    @NonNull TextView receiver,
    @NonNull Function4<CharSequence, @NonNull Integer, @NonNull Integer, @NonNull IntegerUnit> beforeTextChanged,
    @NonNull Function4<CharSequence, @NonNull Integer, @NonNull Integer, @NonNull IntegerUnit> onTextChanged,
    @NonNull Function1<EditableUnit> afterTextChanged
)

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

static final @NonNull TextWatcher
doAfterTextChanged(
    @NonNull TextView receiver,
    @NonNull Function1<EditableUnit> action
)

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

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

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

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

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

Public methods

addTextChangedListener

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

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

Returns
@NonNull TextWatcher

the TextWatcher added to the TextView

doAfterTextChanged

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

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

Returns
@NonNull TextWatcher

the TextWatcher added to the TextView

doBeforeTextChanged

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

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

Returns
@NonNull TextWatcher

the TextWatcher added to the TextView

doOnTextChanged

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

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

Returns
@NonNull TextWatcher

the TextWatcher added to the TextView