TranslationCapability
class TranslationCapability : Parcelable
| kotlin.Any | |
| ↳ | android.view.translation.TranslationCapability | 
Capability class holding information for a pair of TranslationSpecs. 
Holds information and limitations on how to create a TranslationContext which can be used by TranslationManager.createOnDeviceTranslator(TranslationContext, Executor, Consumer).
Summary
| Constants | |
|---|---|
| static Int | The translation service supports translation between the source and target specs, and it is ready to be downloaded onto the device. | 
| static Int | The translation service supports translation between the source and target specs, and it is being downloaded onto the device currently. | 
| static Int | The translation service does not support translation between the source and target specs. | 
| static Int | The translation service supports translation between the source and target specs, and it is downloaded and ready to use on device. | 
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int | |
| TranslationSpec | 
 | 
| Int | getState()The state of translation readiness between  | 
| Int | Translation flags for settings that are supported by the translation service between the  | 
| TranslationSpec | 
 | 
| Boolean | Whether ui translation for the source-target  | 
| String | toString() | 
| Unit | writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. | 
| Properties | |
|---|---|
| static Parcelable.Creator<TranslationCapability!> | |
Constants
STATE_AVAILABLE_TO_DOWNLOAD
static val STATE_AVAILABLE_TO_DOWNLOAD: Int
The translation service supports translation between the source and target specs, and it is ready to be downloaded onto the device. 
 Value is android.view.translation.TranslationCapability#STATE_AVAILABLE_TO_DOWNLOAD, android.view.translation.TranslationCapability#STATE_DOWNLOADING, android.view.translation.TranslationCapability#STATE_ON_DEVICE, android.view.translation.TranslationCapability#STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Value: 1STATE_DOWNLOADING
static val STATE_DOWNLOADING: Int
The translation service supports translation between the source and target specs, and it is being downloaded onto the device currently. 
 Value is android.view.translation.TranslationCapability#STATE_AVAILABLE_TO_DOWNLOAD, android.view.translation.TranslationCapability#STATE_DOWNLOADING, android.view.translation.TranslationCapability#STATE_ON_DEVICE, android.view.translation.TranslationCapability#STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Value: 2STATE_NOT_AVAILABLE
static val STATE_NOT_AVAILABLE: Int
The translation service does not support translation between the source and target specs.
Note: This state is not returned from calling TranslationManager.getOnDeviceTranslationCapabilities. This state will only appear as part of capability updates from TranslationManager.addOnDeviceTranslationCapabilityUpdateListener if existing support was dropped.
Value is
android.view.translation.TranslationCapability#STATE_AVAILABLE_TO_DOWNLOAD, android.view.translation.TranslationCapability#STATE_DOWNLOADING, android.view.translation.TranslationCapability#STATE_ON_DEVICE, android.view.translation.TranslationCapability#STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
      Value: 4STATE_ON_DEVICE
static val STATE_ON_DEVICE: Int
The translation service supports translation between the source and target specs, and it is downloaded and ready to use on device. 
 Value is android.view.translation.TranslationCapability#STATE_AVAILABLE_TO_DOWNLOAD, android.view.translation.TranslationCapability#STATE_DOWNLOADING, android.view.translation.TranslationCapability#STATE_ON_DEVICE, android.view.translation.TranslationCapability#STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Value: 3Public 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 specs for this capability.
| Return | |
|---|---|
| TranslationSpec | This value cannot be null. | 
getState
fun getState(): Int
The state of translation readiness between mSourceSpec and mTargetSpec.
| Return | |
|---|---|
| Int | Value is android.view.translation.TranslationCapability#STATE_AVAILABLE_TO_DOWNLOAD,android.view.translation.TranslationCapability#STATE_DOWNLOADING,android.view.translation.TranslationCapability#STATE_ON_DEVICE,android.view.translation.TranslationCapability#STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE | 
getSupportedTranslationFlags
fun getSupportedTranslationFlags(): Int
Translation flags for settings that are supported by the translation service between the TranslationSpecs provided in this capability.
| 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 | 
getTargetSpec
fun getTargetSpec(): TranslationSpec
TranslationSpec describing the target data specs for this capability.
| Return | |
|---|---|
| TranslationSpec | This value cannot be null. | 
isUiTranslationEnabled
fun isUiTranslationEnabled(): Boolean
Whether ui translation for the source-target TranslationSpecs is enabled. 
Translation service will still support translation requests for this capability.
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 | 
