Added in API level 31

Builder

class Builder
kotlin.Any
   ↳ android.view.translation.TranslationContext.Builder

A builder for TranslationContext

Summary

Public constructors
Builder(sourceSpec: TranslationSpec, targetSpec: TranslationSpec)

Creates a new Builder.

Public methods
TranslationContext

Builds the instance.

TranslationContext.Builder

Translation flags to be used by the Translator

Public constructors

Builder

Added in API level 31
Builder(
    sourceSpec: TranslationSpec,
    targetSpec: TranslationSpec)

Creates a new Builder.

Parameters
sourceSpec TranslationSpec: TranslationSpec describing the source data to be translated. This value cannot be null.
targetSpec TranslationSpec: TranslationSpec describing the target translated data. This value cannot be null.

Public methods

build

Added in API level 31
fun build(): TranslationContext

Builds the instance. This builder should not be touched after calling this!

Return
TranslationContext This value cannot be null.

setTranslationFlags

Added in API level 31
fun setTranslationFlags(value: Int): TranslationContext.Builder

Translation flags to be used by the Translator

Parameters
value Int: Value is either 0 or a combination of android.view.translation.TranslationContext#FLAG_LOW_LATENCY, android.view.translation.TranslationContext#FLAG_TRANSLITERATION, and android.view.translation.TranslationContext#FLAG_DEFINITIONS
Return
TranslationContext.Builder This value cannot be null.