AutofillNode

Added in 1.0.0
Deprecated in 1.8.0-rc01

Every autofill-able composable will have an AutofillNode. (An autofill node will be created for every semantics node that adds autofill properties). This node is used to request/cancel autofill, and it holds the onFill lambda which is called by the autofill framework.

Summary

Public constructors

AutofillNode(
    autofillTypes: List<AutofillType>,
    boundingBox: Rect?,
    onFill: ((String) -> Unit)?
)

This function is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn

Public functions

open operator Boolean
equals(other: Any?)

This function is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn
open Int

This function is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn

Public properties

List<AutofillType>

This property is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn
Rect?

This property is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn
Int

This property is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn
((String) -> Unit)?

This property is deprecated. Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Cmn

Public constructors

AutofillNode

AutofillNode(
    autofillTypes: List<AutofillType> = listOf(),
    boundingBox: Rect? = null,
    onFill: ((String) -> Unit)?
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

autofillTypes

val autofillTypesList<AutofillType>

A list of autofill types for this node. These types are conveyed to the autofill framework and it is used to call onFill with the appropriate value. If you don't set this property, the autofill framework will use heuristics to guess the type. This property is a list because some fields can have multiple types. For instance, userid in a login form can either be a username or an email address. TODO(b/138731416): Check with the autofill service team if the order matters, and how duplicate types are handled.

boundingBox

var boundingBoxRect?

The screen coordinates of the composable being auto-filled. This data is used by the autofill framework to decide where to show the autofill popup.

id

val idInt

A virtual id that is automatically generated for each node.

onFill

val onFill: ((String) -> Unit)?

The callback that is called by the autofill framework to perform autofill.