# androidx.compose.ui.autofill

Common/AllAndroid/JVM

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/Autofill` | **This interface is deprecated.** You no longer have to call these apis when focus changes. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/ContentDataType` | Content data type information. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/ContentType` | Content type information. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` | Represents a single piece of data for autofill purposes. | Cmn |

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillManager` | Autofill API. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillNode` | **This class is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillTree` | **This class is deprecated.** Use the new semantics-based Autofill APIs androidx.compose.ui.autofill.ContentType and androidx.compose.ui.autofill.ContentDataType instead. | Cmn |

## Objects

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.Companion` |   | Cmn |

## Enums

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AutofillType` | **This enum is deprecated.** Use the new semantics-based API and androidx.compose.ui.autofill.ContentType instead. | Cmn |

## Modifiers

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/contentType.modifier` | Set autofill hint with `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.Modifier).contentType(androidx.compose.ui.autofill.ContentType)`. | Cmn |

## Top-level functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/ContentDataType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#ContentDataType(kotlin.Int)(dataType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/ContentType` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#ContentType(kotlin.String)(contentHint: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Create a custom `ContentType` with `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#ContentType(kotlin.String)`. | android |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.FillableData.Companion).createFromAutofillValue(android.view.autofill.AutofillValue)( autofillValue: https://developer.android.com/reference/android/view/autofill/AutofillValue.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` from the platform `https://developer.android.com/reference/android/view/autofill/AutofillValue.html` type. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.FillableData.Companion).createFromBoolean(kotlin.Boolean)(booleanValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.FillableData.Companion).createFromDateMillis(kotlin.Long)(dateMillisValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.FillableData.Companion).createFromListIndex(kotlin.Int)(listIndexValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.FillableData.Companion).createFromText(kotlin.CharSequence)(textValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html`. | Cmn android |
| `https://developer.android.com/reference/android/view/autofill/AutofillValue.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.FillableData).toAutofillValue()()` Retrieves the underlying platform `https://developer.android.com/reference/android/view/autofill/AutofillValue.html` from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData`. | android |

## Extension properties summary

|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/ContentDataType.https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#(androidx.compose.ui.autofill.ContentDataType).dataType()` | android |

## Top-level functions

### ContentDataType

android 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/ContentDataType.android.kt+function:ContentDataType)

```
fun ContentDataType(dataType: Int): ContentDataType
```

### ContentType

android 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/ContentType.android.kt+function:ContentType)

```
fun ContentType(contentHint: String): ContentType
```

Create a custom `ContentType` with `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#ContentType(kotlin.String)`.

This creates a `ContentType` with the parameter `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/package-summary#ContentType(kotlin.String)` passed in. This API can be used if the Autofill hint is not present in the list of `contentType`s provided by Compose.

For example, `ContentType(androidx.autofill.HintConstants.AUTOFILL_HINT_FLIGHT_CONFIRMATION_CODE)` can be used to create a new flight confirmation code hint.

## Extension functions

### FillableData.Companion.createFromAutofillValue

android 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/FillableData.android.kt+function:createFromAutofillValue)

```
fun FillableData.Companion.createFromAutofillValue(
    autofillValue: AutofillValue
): FillableData?
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` from the platform `https://developer.android.com/reference/android/view/autofill/AutofillValue.html` type.

| Parameters |
|---|---|
| `autofillValue: https://developer.android.com/reference/android/view/autofill/AutofillValue.html` | The platform autofill value to create the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` from. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` object containing the platform autofill data, or `null` if the platform version is lower than `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O`. |

### FillableData.Companion.createFromBoolean

Cmn android 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/FillableData.+function:createFromBoolean)

```
fun FillableData.Companion.createFromBoolean(booleanValue: Boolean): FillableData?
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html`.

This function is used to wrap a boolean value for autofill purposes, such as the state of a checkbox or a switch.

| Parameters |
|---|---|
| `booleanValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | The boolean data to be used for autofill. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` object containing the boolean data, or `null` if the platform does not support autofill. |

### FillableData.Companion.createFromDateMillis

Cmn android 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/FillableData.+function:createFromDateMillis)

```
fun FillableData.Companion.createFromDateMillis(dateMillisValue: Long): FillableData?
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html`.

This function is used to wrap a long value for autofill purposes, such as a date represented in milliseconds since the epoch.

| Parameters |
|---|---|
| `dateMillisValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The long data to be used for autofill, representing a date in milliseconds since the epoch. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` object containing the long data, or `null` if the platform does not support autofill. |

### FillableData.Companion.createFromListIndex

Cmn android 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/FillableData.+function:createFromListIndex)

```
fun FillableData.Companion.createFromListIndex(listIndexValue: Int): FillableData?
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html`.

This function is used to wrap an integer value for autofill purposes, such as the selected index in a dropdown menu or spinner.

| Parameters |
|---|---|
| `listIndexValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The integer data to be used for autofill, representing the index of the selected item in a list. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` object containing the integer data, or `null` if the platform does not support autofill. |

### FillableData.Companion.createFromText

Cmn android 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/FillableData.+function:createFromText)

```
fun FillableData.Companion.createFromText(textValue: CharSequence): FillableData?
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` instance from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html`.

This function is used to wrap a text value for autofill purposes. Depending on the platform, the text might be truncated to a safe length if it is too long to prevent crashing the IPC.

| Parameters |
|---|---|
| `textValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | The text data to be used for autofill. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData?` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` object containing the text data, or `null` if the platform does not support autofill. |

### FillableData.toAutofillValue

android 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/FillableData.android.kt+function:toAutofillValue)

```
fun FillableData.toAutofillValue(): AutofillValue?
```

Retrieves the underlying platform `https://developer.android.com/reference/android/view/autofill/AutofillValue.html` from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData`.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/view/autofill/AutofillValue.html?` | The platform `https://developer.android.com/reference/android/view/autofill/AutofillValue.html`, or `null` if the `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/FillableData` is not an instance of `https://developer.android.com/reference/kotlin/androidx/compose/ui/autofill/AndroidFillableData` or the platform version is lower than `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O`. |

## Extension properties

### ContentDataType.dataType

android 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/ContentDataType.android.kt+symbol:dataType)

```
val ContentDataType.dataType: Int
```