Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for TranslationContext
Summary
Public constructors |
Creates a new Builder.
|
Public constructors
Public methods
build
fun build(): TranslationContext
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,["# TranslationContext.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/TranslationContext.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.TranslationContext.Builder](#) |\n\nA builder for [TranslationContext](/reference/kotlin/android/view/translation/TranslationContext)\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(android.view.translation.TranslationSpec,%20android.view.translation.TranslationSpec))`(`sourceSpec:` `[TranslationSpec](/reference/kotlin/android/view/translation/TranslationSpec)`, `targetSpec:` `[TranslationSpec](/reference/kotlin/android/view/translation/TranslationSpec)`)` Creates a new Builder. |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TranslationContext](/reference/kotlin/android/view/translation/TranslationContext) | [build](#build())`()` Builds the instance. |\n| [TranslationContext.Builder](#) | [setTranslationFlags](#setTranslationFlags(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Translation flags to be used by the [Translator](/reference/kotlin/android/view/translation/Translator) |\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(\n sourceSpec: TranslationSpec, \n targetSpec: TranslationSpec)\n```\n\nCreates a new Builder.\n\n| Parameters ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sourceSpec` | [TranslationSpec](/reference/kotlin/android/view/translation/TranslationSpec): [TranslationSpec](/reference/kotlin/android/view/translation/TranslationSpec) describing the source data to be translated. This value cannot be `null`. |\n| `targetSpec` | [TranslationSpec](/reference/kotlin/android/view/translation/TranslationSpec): [TranslationSpec](/reference/kotlin/android/view/translation/TranslationSpec) describing the target translated data. This value cannot be `null`. |\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(): TranslationContext\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-------------------------------------------------------------------------------------|------------------------------|\n| [TranslationContext](/reference/kotlin/android/view/translation/TranslationContext) | This value cannot be `null`. |\n\n### setTranslationFlags\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setTranslationFlags(value: Int): TranslationContext.Builder\n```\n\nTranslation flags to be used by the [Translator](/reference/kotlin/android/view/translation/Translator)\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is either `0` or a combination of [android.view.translation.TranslationContext#FLAG_LOW_LATENCY](/reference/kotlin/android/view/translation/TranslationContext#FLAG_LOW_LATENCY:kotlin.Int), [android.view.translation.TranslationContext#FLAG_TRANSLITERATION](/reference/kotlin/android/view/translation/TranslationContext#FLAG_TRANSLITERATION:kotlin.Int), and [android.view.translation.TranslationContext#FLAG_DEFINITIONS](/reference/kotlin/android/view/translation/TranslationContext#FLAG_DEFINITIONS:kotlin.Int) |\n\n| Return ||\n|---------------------------------|------------------------------|\n| [TranslationContext.Builder](#) | This value cannot be `null`. |"]]