TranslationContext
class TranslationContext : Parcelable
| kotlin.Any | |
| ↳ | android.view.translation.TranslationContext | 
Info class holding information for Translators and used by TranslationManager.createOnDeviceTranslator(TranslationContext, Executor, Consumer).
Summary
| Nested classes | |
|---|---|
| A builder for  | |
| Constants | |
|---|---|
| static Int | This context will enable the  | 
| static Int | This context will perform translations in low latency mode. | 
| static Int | This context will enable the  | 
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int | |
| TranslationSpec | 
 | 
| TranslationSpec | 
 | 
| Int | Translation flags to be used by the  | 
| String | toString() | 
| Unit | writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. | 
| Properties | |
|---|---|
| static Parcelable.Creator<TranslationContext!> | |
Constants
FLAG_DEFINITIONS
static val FLAG_DEFINITIONS: Int
This context will enable the Translator to return dictionary definitions. 
 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
Value: 4FLAG_LOW_LATENCY
static val FLAG_LOW_LATENCY: Int
This context will perform translations in low latency mode. 
 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
Value: 1FLAG_TRANSLITERATION
static val FLAG_TRANSLITERATION: Int
This context will enable the Translator to return transliteration results. 
 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
Value: 2Public methods
describeContents
fun describeContents(): Int
| Return | |
|---|---|
| Int | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0orandroid.os.Parcelable#CONTENTS_FILE_DESCRIPTOR | 
getSourceSpec
fun getSourceSpec(): TranslationSpec
TranslationSpec describing the source data to be translated.
| Return | |
|---|---|
| TranslationSpec | This value cannot be null. | 
getTargetSpec
fun getTargetSpec(): TranslationSpec
TranslationSpec describing the target translated data.
| Return | |
|---|---|
| TranslationSpec | This value cannot be null. | 
getTranslationFlags
fun getTranslationFlags(): Int
Translation flags to be used by the Translator
| Return | |
|---|---|
| Int | Value is either 0or a combination ofandroid.view.translation.TranslationContext#FLAG_LOW_LATENCY,android.view.translation.TranslationContext#FLAG_TRANSLITERATION, andandroid.view.translation.TranslationContext#FLAG_DEFINITIONS | 
toString
fun toString(): String
| Return | |
|---|---|
| String | a string representation of the object. | 
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
| dest | Parcel: This value cannot be null. | 
| flags | Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either0or a combination ofandroid.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
