Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for BatchUpdates
objects.
Summary
Public constructors
Public methods
open fun transformChild(
id: Int,
transformation: Transformation
): BatchUpdates.Builder!
Adds a transformation to replace the value of a child view with the fields in the screen.
When multiple transformations are added for the same child view, they are applied in the same order as added.
Note: The transformations are applied after the updates
are applied to the presentation template.
Parameters |
id |
Int: view id of the children view. |
transformation |
Transformation: an implementation provided by the Android System. This value cannot be null . |
Exceptions |
java.lang.IllegalArgumentException |
if transformation is not a class provided by the Android System. |
updateTemplate
open fun updateTemplate(updates: RemoteViews): BatchUpdates.Builder!
Applies the updates
in the underlying presentation template.
Note: The updates are applied before the transformations
are applied to the children views.
Theme does not work with RemoteViews layout. Avoid hardcoded text color or background color: Autofill on different platforms may have different themes.
Parameters |
updates |
RemoteViews: a RemoteViews with the updated actions to be applied in the underlying presentation template. This value cannot be null . |
Exceptions |
java.lang.IllegalArgumentException |
if condition is not a class provided by the Android System. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# BatchUpdates.Builder\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/autofill/BatchUpdates.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.autofill.BatchUpdates.Builder](#) |\n\nBuilder for [BatchUpdates](/reference/kotlin/android/service/autofill/BatchUpdates) objects.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [BatchUpdates](/reference/kotlin/android/service/autofill/BatchUpdates)! | [build](#build())`()` Creates a new [BatchUpdates](/reference/kotlin/android/service/autofill/BatchUpdates) instance. |\n| open [BatchUpdates.Builder](#)! | [transformChild](#transformChild(kotlin.Int,%20android.service.autofill.Transformation))`(`id:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `transformation:` `[Transformation](/reference/kotlin/android/service/autofill/Transformation)`)` Adds a transformation to replace the value of a child view with the fields in the screen. |\n| open [BatchUpdates.Builder](#)! | [updateTemplate](#updateTemplate(android.widget.RemoteViews))`(`updates:` `[RemoteViews](../../widget/RemoteViews.html#)`)` Applies the `updates` in the underlying presentation template. |\n\nPublic constructors\n-------------------\n\n### Builder\n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun build(): BatchUpdates!\n```\n\nCreates a new [BatchUpdates](/reference/kotlin/android/service/autofill/BatchUpdates) instance.\n\n| Exceptions ||\n|-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `java.lang.IllegalStateException` | if [build()](#build()) was already called before or no call to [updateTemplate(android.widget.RemoteViews)](#updateTemplate(android.widget.RemoteViews)) or [transformChild(int,android.service.autofill.Transformation)](#transformChild(kotlin.Int,%20android.service.autofill.Transformation)) has been made. |\n\n### transformChild\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun transformChild(\n id: Int, \n transformation: Transformation\n): BatchUpdates.Builder!\n```\n\nAdds a transformation to replace the value of a child view with the fields in the screen.\n\nWhen multiple transformations are added for the same child view, they are applied in the same order as added.\n\n**Note:** The transformations are applied after the [updates](#updateTemplate(android.widget.RemoteViews)) are applied to the presentation template.\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): view id of the children view. |\n| `transformation` | [Transformation](/reference/kotlin/android/service/autofill/Transformation): an implementation provided by the Android System. This value cannot be `null`. |\n\n| Return ||\n|----------------------------|---------------|\n| [BatchUpdates.Builder](#)! | this builder. |\n\n| Exceptions ||\n|--------------------------------------|--------------------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if `transformation` is not a class provided by the Android System. |\n\n### updateTemplate\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun updateTemplate(updates: RemoteViews): BatchUpdates.Builder!\n```\n\nApplies the `updates` in the underlying presentation template.\n\n**Note:** The updates are applied before the [transformations](#transformChild(kotlin.Int,%20android.service.autofill.Transformation)) are applied to the children views.\n\nTheme does not work with RemoteViews layout. Avoid hardcoded text color or background color: Autofill on different platforms may have different themes.\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updates` | [RemoteViews](../../widget/RemoteViews.html#): a [RemoteViews](../../widget/RemoteViews.html#) with the updated actions to be applied in the underlying presentation template. This value cannot be `null`. |\n\n| Return ||\n|----------------------------|--------------|\n| [BatchUpdates.Builder](#)! | this builder |\n\n| Exceptions ||\n|--------------------------------------|---------------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if `condition` is not a class provided by the Android System. |"]]