FocusManager
Kotlin
|Java
interface FocusManager
androidx.compose.ui.focus.FocusManager |
Summary
Public methods | |
---|---|
abstract Unit |
clearFocus(forcedClear: Boolean = false) Call this function to clear focus from the currently focused component, and set the focus to the root focus modifier. |
abstract Boolean |
moveFocus(focusDirection: FocusDirection) Moves focus in the specified direction. |
Public methods
clearFocus
abstract fun clearFocus(forcedClear: Boolean = false): Unit
Call this function to clear focus from the currently focused component, and set the focus to the root focus modifier.
Parameters | |
---|---|
forcedClear: Boolean = false | : Whether we should forcefully clear focus regardless of whether we have any components that have Captured focus. |
moveFocus
abstract fun moveFocus(focusDirection: FocusDirection): Boolean
Moves focus in the specified direction.
Focus moving is still being implemented. Right now, focus will move only if the user specified a custom focus traversal order for the item that is currently focused. (Using the Modifier.focusOrder() API).
Return | |
---|---|
true if focus was moved successfully. | false if the focused item is unchanged. |