{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

KeyboardActions

public final class KeyboardActions


The KeyboardActions class allows developers to specify actions that will be triggered in response to users triggering IME action on the software keyboard.

Summary

Nested types

public static class KeyboardActions.Companion

Public constructors

KeyboardActions(
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onDone,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onGo,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onNext,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onPrevious,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onSearch,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onSend
)

Public methods

boolean
equals(Object other)
final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit>

This is run when the user triggers the Done action.

final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit>

This is run when the user triggers the Go action.

final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit>

This is run when the user triggers the Next action.

final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit>

This is run when the user triggers the Previous action.

final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit>

This is run when the user triggers the Search action.

final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit>

This is run when the user triggers the Send action.

int

Public constructors

KeyboardActions

public KeyboardActions(
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onDone,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onGo,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onNext,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onPrevious,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onSearch,
    @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnit> onSend
)

Public methods

equals

public boolean equals(Object other)

getOnDone

public final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnitgetOnDone()

This is run when the user triggers the Done action. A null value indicates that the default implementation if any, should be executed.

getOnGo

public final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnitgetOnGo()

This is run when the user triggers the Go action. A null value indicates that the default implementation if any, should be executed.

getOnNext

public final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnitgetOnNext()

This is run when the user triggers the Next action. A null value indicates that the default implementation should be executed. The default implementation moves focus to the next item in the focus traversal order.

See Modifier.focusProperties() for more details on how to specify a custom focus order if needed.

getOnPrevious

public final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnitgetOnPrevious()

This is run when the user triggers the Previous action. A null value indicates that the default implementation should be executed. The default implementation moves focus to the previous item in the focus traversal order.

See Modifier.focusProperties() for more details on how to specify a custom focus order if needed.

getOnSearch

public final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnitgetOnSearch()

This is run when the user triggers the Search action. A null value indicates that the default implementation if any, should be executed.

getOnSend

public final @ExtensionFunctionType Function1<@NonNull KeyboardActionScopeUnitgetOnSend()

This is run when the user triggers the Send action. A null value indicates that the default implementation if any, should be executed.

hashCode

public int hashCode()