Added in API level 31

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 TranslationContext

Constants
static Int

This context will enable the Translator to return dictionary definitions.

static Int

This context will perform translations in low latency mode.

static Int

This context will enable the Translator to return transliteration results.

Inherited constants
Public methods
Int

TranslationSpec

TranslationSpec describing the source data to be translated.

TranslationSpec

TranslationSpec describing the target translated data.

Int

Translation flags to be used by the Translator

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<TranslationContext!>

Constants

FLAG_DEFINITIONS

Added in API level 31
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: 4

FLAG_LOW_LATENCY

Added in API level 31
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: 1

FLAG_TRANSLITERATION

Added in API level 31
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: 2

Public methods

describeContents

Added in API level 31
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getSourceSpec

Added in API level 31
fun getSourceSpec(): TranslationSpec

TranslationSpec describing the source data to be translated.

Return
TranslationSpec This value cannot be null.

getTargetSpec

Added in API level 31
fun getTargetSpec(): TranslationSpec

TranslationSpec describing the target translated data.

Return
TranslationSpec This value cannot be null.

getTranslationFlags

Added in API level 31
fun getTranslationFlags(): Int

Translation flags to be used by the Translator

Return
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

toString

Added in API level 31
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 31
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 either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 31
static val CREATOR: Parcelable.Creator<TranslationContext!>