# AutofillTree

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/autofill/AutofillTree.kt+class:androidx.compose.ui.autofill.AutofillTree) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0) Common/AllAndroid/JVM
- Cmn

  ```
  class AutofillTree
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

The autofill tree is a temporary data structure that is used before the Semantics Tree is implemented. This data structure is used by compose components to set autofill hints (via `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode`s). It is also used by the autofill framework to communicate with Compose components (by calling `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#performAutofill(kotlin.Int,kotlin.String)`).

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree` will be replaced by Autofill Semantics (b/138604305).

Since this is a temporary implementation, it is implemented as a list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#children()`, which is essentially a tree of height = 1

## Summary

| ### Public constructors |
|---|---|
| `[AutofillTree](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#AutofillTree())()` **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 |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html?` | `[performAutofill](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#performAutofill(kotlin.Int,kotlin.String))(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` **This function is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[plusAssign](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#plusAssign(androidx.compose.ui.autofill.AutofillNode))(autofillNode: https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode)` **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 |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#children()` **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

### AutofillTree

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
[AutofillTree](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#AutofillTree())()
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

## Public functions

### performAutofill

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
fun [performAutofill](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#performAutofill(kotlin.Int,kotlin.String))(id: Int, value: String): Unit?
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

The autofill framework uses this function to 'fill' the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode` represented by `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#performAutofill(kotlin.Int,kotlin.String)` with the specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#performAutofill(kotlin.Int,kotlin.String)`.

### plusAssign

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
operator fun [plusAssign](https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree#plusAssign(androidx.compose.ui.autofill.AutofillNode))(autofillNode: AutofillNode): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

Add the specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree`.

## Public properties

### children

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val children: MutableMap<Int, AutofillNode>
```

> [!CAUTION]
> **This property is deprecated.**   
> Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead.

A map which contains `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode`s, where every node represents an autofill-able field.