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

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

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

Returns a string representation of the object.

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 the following:

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 the following:

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 the following:

Value: 2

Public methods

describeContents

Added in API level 31
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

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 the following:

toString

Added in API level 31
fun toString(): String

Returns a string representation of the object.

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 the following:

Properties

CREATOR

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