이제 Android 11 개발자 프리뷰를 사용할 수 있습니다. 테스트해 보고 의견을 공유하세요.

androidx.ui.focus

Classes

FocusOperator

The FocusOperator is returned in the receiver scope of the children of a Focusable.

Enums

FocusDetailedState

Different states of the focus system.

FocusState

Different states of the focus system.

Top-level functions summary

Unit
Focusable(focusOperator: FocusOperator = remember { FocusOperator() }, children: (FocusOperator) -> Unit)

This composable can be used to create components that are Focusable.

Extension functions summary

Top-level functions

Focusable

@Composable fun Focusable(
    focusOperator: FocusOperator = remember { FocusOperator() },
    children: (FocusOperator) -> Unit
): Unit

This composable can be used to create components that are Focusable. A component that is focused receives any invoked actions. Some examples of actions are 'paste' (receiving the contents of the clipboard), or receiving text from the keyboard.

Focusable components have access to the current focus state. The children of a Focusable have access to this focus state during composition.

focusOperator : This object is returned in the receiver scope of the components passed as children. You should not specify this parameter unless you want to hoist the focusOperator so that you can control the focusable from outside the scope of its children.

children: This is a composable block called with focusOperator in its receiver scope. Children can use FocusOperator.focusState for conditional composition.

Extension functions

focusState

fun FocusDetailedState.focusState(): FocusState

Converts a FocusDetailedState to a FocusState.