AutofillNode


Every autofillable 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)?
)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn

Public properties

List<AutofillType>

A list of autofill types for this node.

Cmn
Rect?

The screen coordinates of the composable being autofilled.

Cmn
Int

A virtual id that is automatically generated for each node.

Cmn
((String) -> Unit)?

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

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 autofilled. 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.