AutofillNode
class AutofillNode
kotlin.Any | |
↳ | androidx.compose.ui.autofill.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 | |
---|---|
<init>(autofillTypes: List<AutofillType> = listOf(), boundingBox: Rect? = null, onFill: (String) -> Unit) Every autofillable composable will have an AutofillNode. |
Public methods | |
---|---|
Boolean | |
Int |
hashCode() |
Properties | |
---|---|
List<AutofillType> |
A list of autofill types for this node. |
Rect? |
The screen coordinates of the composable being autofilled. |
Int |
A virtual id that is automatically generated for each node. |
(String) -> Unit |
The callback that is called by the autofill framework to perform autofill. |
Public constructors
<init>
AutofillNode(
autofillTypes: List<AutofillType> = listOf(),
boundingBox: Rect? = null,
onFill: (String) -> Unit)
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.
Public methods
hashCode
fun hashCode(): Int
Properties
autofillTypes
val autofillTypes: List<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 boundingBox: Rect?
The screen coordinates of the composable being autofilled. This data is used by the autofill framework to decide where to show the autofill popup.