Google 致力于为黑人社区推动种族平等。查看具体举措

androidx.compose.ui.focus

Interfaces

FocusEventModifier

A modifier that can be used to observe focus state events.

FocusManager

FocusOrderModifier

A modifier that can be used to set a custom focus traversal order.

FocusRequesterModifier

A modifier that can be used to pass in a FocusRequester that can be used to request focus state changes.

Classes

FocusOrder

Specifies custom focus destinations that are used instead of the default focus traversal order.

FocusRequester

The FocusRequester is used in conjunction with Modifier.focusRequester to send requests for focus state change.

Enums

FocusDirection

This enum specifies the direction of the requested focus change.

FocusState

Different states of the focus system.

Extension functions summary

For Modifier
Modifier

Add this modifier to a component to make it focusable.

Modifier
Modifier.focusOrder(focusOrderReceiver: FocusOrder.() -> Unit)

Use this modifier to specify a custom focus traversal order.

Modifier

A modifier that lets you specify a FocusRequester for the current composable so that this focusRequester can be used by another composable to specify a custom focus order.

Modifier
Modifier.focusOrder(focusRequester: FocusRequester, focusOrderReceiver: FocusOrder.() -> Unit)

A modifier that lets you specify a FocusRequester for the current composable along with focusOrder.

Modifier

Add this modifier to a component to observe changes to focus state.

Modifier
Modifier.onFocusChanged(onFocusChanged: (FocusState) -> Unit)

Add this modifier to a component to observe focus state events.

Modifier
Modifier.onFocusEvent(onFocusEvent: (FocusState) -> Unit)

Add this modifier to a component to observe focus state events.

Extension properties summary

For FocusState
Boolean

Converts a focus state into a boolean value indicating if the component is focused or not.

Extension functions

focusModifier

fun Modifier.focusModifier(): Modifier

Add this modifier to a component to make it focusable.

focusOrder

fun Modifier.focusOrder(focusOrderReceiver: FocusOrder.() -> Unit): Modifier

Use this modifier to specify a custom focus traversal order.

Parameters
focusOrderReceiver: FocusOrder.() -> Unit Specifies FocusRequesters that are used when the user wants to move the current focus to the next item, or wants to move focus left, right, up or down.

focusOrder

fun Modifier.focusOrder(focusRequester: FocusRequester): Modifier

A modifier that lets you specify a FocusRequester for the current composable so that this focusRequester can be used by another composable to specify a custom focus order.

focusOrder

fun Modifier.focusOrder(
    focusRequester: FocusRequester,
    focusOrderReceiver: FocusOrder.() -> Unit
): Modifier

A modifier that lets you specify a FocusRequester for the current composable along with focusOrder.