Interface

FocusManager

Source set: Common
public interface FocusManager

Functions

clearFocus

Source set: Common
public fun clearFocus(force: Boolean = false)

Call this function to clear focus from the currently focused component, and set the focus to the root focus modifier.

Parameters

force: Whether we should forcefully clear focus regardless of whether we have any components that have Captured focus.

moveFocus

Source set: Common
public fun moveFocus(focusDirection: FocusDirection): Boolean

Moves focus in the specified direction.

If you are not satisfied with the default focus order, consider setting a custom order using Modifier.focusProperties().

Return

true if focus was moved successfully. false if the focused item is unchanged.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: