Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for building ViewTranslationRequest.
Summary
Public constructors |
Creates a new Builder.
|
Creates a new Builder.
|
Public constructors
Builder
Builder(autofillId: AutofillId)
Creates a new Builder.
Parameters |
autofillId |
AutofillId: The AutofillId of the view associated with this request. This value cannot be null . |
Builder
Builder(
autofillId: AutofillId,
virtualChildId: Long)
Creates a new Builder.
Parameters |
autofillId |
AutofillId: the AutofillId of the non-virtual view hosting the virtual view hierarchy associated with this request. This value cannot be null . |
virtualChildId |
Long: the id of the virtual view in the host view. This id is the same virtual id provided through content capture. |
Public methods
build
fun build(): ViewTranslationRequest
Builds the instance. This builder should not be touched after calling this!
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,["# ViewTranslationRequest.Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/translation/ViewTranslationRequest.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.view.translation.ViewTranslationRequest.Builder](#) |\n\nA builder for building ViewTranslationRequest.\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(android.view.autofill.AutofillId))`(`autofillId:` `[AutofillId](../autofill/AutofillId.html#)`)` Creates a new Builder. |\n| [Builder](#Builder(android.view.autofill.AutofillId,%20kotlin.Long))`(`autofillId:` `[AutofillId](../autofill/AutofillId.html#)`, `virtualChildId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Creates a new Builder. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ViewTranslationRequest](/reference/kotlin/android/view/translation/ViewTranslationRequest) | [build](#build())`()` Builds the instance. |\n| [ViewTranslationRequest.Builder](#) | [setValue](#setValue(kotlin.String,%20android.view.translation.TranslationRequestValue))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `value:` `[TranslationRequestValue](/reference/kotlin/android/view/translation/TranslationRequestValue)`)` Sets the corresponding [TranslationRequestValue](/reference/kotlin/android/view/translation/TranslationRequestValue) for the provided key. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(autofillId: AutofillId)\n```\n\nCreates a new Builder.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `autofillId` | [AutofillId](../autofill/AutofillId.html#): The [AutofillId](../autofill/AutofillId.html#) of the view associated with this request. This value cannot be `null`. |\n\n### Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(\n autofillId: AutofillId, \n virtualChildId: Long)\n```\n\nCreates a new Builder.\n\n| Parameters ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `autofillId` | [AutofillId](../autofill/AutofillId.html#): the [AutofillId](../autofill/AutofillId.html#) of the non-virtual view hosting the virtual view hierarchy associated with this request. This value cannot be `null`. |\n| `virtualChildId` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the id of the virtual view in the host view. This id is the same virtual id provided through content capture. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ViewTranslationRequest\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|---------------------------------------------------------------------------------------------|------------------------------|\n| [ViewTranslationRequest](/reference/kotlin/android/view/translation/ViewTranslationRequest) | This value cannot be `null`. |\n\n### setValue\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setValue(\n key: String, \n value: TranslationRequestValue\n): ViewTranslationRequest.Builder\n```\n\nSets the corresponding [TranslationRequestValue](/reference/kotlin/android/view/translation/TranslationRequestValue) for the provided key.\n\n| Parameters ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The key for this translation request value. This value cannot be `null`. |\n| `value` | [TranslationRequestValue](/reference/kotlin/android/view/translation/TranslationRequestValue): the translation request value holding the content to be translated. This value cannot be `null`. |\n\n| Return ||\n|-------------------------------------|--------------------------------------------|\n| [ViewTranslationRequest.Builder](#) | this builder. This value cannot be `null`. |"]]