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

Autofill

interface Autofill
androidx.compose.ui.autofill.Autofill

Autofill API.

This interface is available to all composables via a CompositionLocal. The composable can then request or cancel autofill as required. For instance, the TextField can call requestAutofillForNode when it gains focus, and cancelAutofillForNode when it loses focus.

Summary

Public methods
abstract Unit

Cancel a previously supplied autofill request.

abstract Unit

Request autofill for the specified node.

Public methods

cancelAutofillForNode

abstract fun cancelAutofillForNode(autofillNode: AutofillNode): Unit

Cancel a previously supplied autofill request.

Parameters
autofillNode: AutofillNode

The node that needs to be autofilled.

This function is usually called when an autofillable component loses focus.

requestAutofillForNode

abstract fun requestAutofillForNode(autofillNode: AutofillNode): Unit

Request autofill for the specified node.

Parameters
autofillNode: AutofillNode

The node that needs to be autofilled.

This function is usually called when an autofillable component gains focus.