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 |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| TranslationSpec |
|
| TranslationSpec |
|
| Int |
Translation flags to be used by the |
| String |
toString()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
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: 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 the following:
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 the following:
Value: 2Public methods
describeContents
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
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 0 or a combination of the following:
|
toString
fun toString(): String
Returns a string representation of the object.
| 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 either 0 or a combination of the following:
|