Google is committed to advancing racial equity for Black communities. See how.

FocusManager

interface FocusManager
androidx.ui.core.input.FocusManager

Interface of manager of focused composable.

Focus manager keeps tracking the input focused node and provides focus transitions.

Summary

Public methods
abstract Unit
blur(client: FocusNode)

Release the focus if given focus node is focused

abstract Unit

Observe focus transition for the passed FocusNode.

abstract Unit

Request the input focus

Public methods

blur

abstract fun blur(client: FocusNode): Unit

Release the focus if given focus node is focused

Parameters
client: FocusNode A focusable client.

registerObserver

abstract fun registerObserver(
    node: FocusNode,
    observer: FocusTransitionObserver
): Unit

Observe focus transition for the passed FocusNode.

The observer is called AFTER the focus transition happens. So there is no way of preventing focus gain or focus lose.

requestFocus

abstract fun requestFocus(client: FocusNode): Unit

Request the input focus

Parameters
client: FocusNode A focusable client.