createFrom

Function

Common
expect fun FillableData.Companion.createFrom(booleanValue: Boolean): FillableData?

Creates a FillableData instance from a Boolean.

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

Parameters

booleanValueThe boolean data to be used for autofill.

Returns

A FillableData object containing the boolean data, or null if the platform does not support autofill.
Common
expect fun FillableData.Companion.createFrom(textValue: CharSequence): FillableData?

Creates a FillableData instance from a CharSequence.

This function is used to wrap a text value for autofill purposes.

Parameters

textValueThe text data to be used for autofill.

Returns

A FillableData object containing the text data, or null if the platform does not support autofill.
Common
expect fun FillableData.Companion.createFrom(listIndexValue: Int): FillableData?

Creates a FillableData instance from an Int.

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

Parameters

listIndexValueThe integer data to be used for autofill, representing the index of the selected item in a list.

Returns

A FillableData object containing the integer data, or null if the platform does not support autofill.
Common
expect fun FillableData.Companion.createFrom(dateMillisValue: Long): FillableData?

Creates a FillableData instance from a Long.

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

Parameters

dateMillisValueThe long data to be used for autofill, representing a date in milliseconds since the epoch.

Returns

A FillableData object containing the long data, or null if the platform does not support autofill.
Android
actual fun FillableData.Companion.createFrom(textValue: CharSequence): FillableData?

Creates a FillableData instance from a CharSequence.

This function is used to wrap a text value for autofill purposes. On Android, it creates an AutofillValue that contains the provided text.

Parameters

textValueThe text data to be used for autofill.

Returns

A FillableData object containing the text data, or null if the platform version is lower than Build.VERSION_CODES.O.
Android
actual fun FillableData.Companion.createFrom(booleanValue: Boolean): FillableData?

Creates a FillableData instance from a Boolean.

This function is used to wrap a boolean value for autofill purposes, such as the state of a checkbox or a switch. On Android, it creates an AutofillValue that represents a toggle state.

Parameters

booleanValueThe boolean data to be used for autofill.

Returns

A FillableData object containing the boolean data, or null if the platform version is lower than Build.VERSION_CODES.O.
Android
actual fun FillableData.Companion.createFrom(listIndexValue: Int): FillableData?

Creates a FillableData instance from an Int.

This function is used to wrap an integer value for autofill purposes, such as the selected index in a dropdown menu or spinner. On Android, it creates an AutofillValue that represents a list selection.

Parameters

listIndexValueThe integer data to be used for autofill, representing the index of the selected item in a list.

Returns

A FillableData object containing the integer data, or null if the platform version is lower than Build.VERSION_CODES.O.
Android
actual fun FillableData.Companion.createFrom(dateMillisValue: Long): FillableData?

Creates a FillableData instance from a Long.

This function is used to wrap a long value for autofill purposes, such as a date represented in milliseconds since the epoch. On Android, it creates an AutofillValue that represents a date.

Parameters

dateMillisValueThe long data to be used for autofill, representing a date in milliseconds.

Returns

A FillableData object containing the long data, or null if the platform version is lower than Build.VERSION_CODES.O.
Android
fun FillableData.Companion.createFrom(autofillValue: AutofillValue): FillableData?

Creates a FillableData from the platform AutofillValue type.

Parameters

autofillValueThe platform autofill value to create the FillableData from.

Returns

A FillableData object containing the platform autofill data, or null if the platform version is lower than Build.VERSION_CODES.O.