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 |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| 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()Returns a string representation of the object. |
| 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 one of the following:
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 one of the following:
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 one of the following:
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 one of the following:
Value: 3Public 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 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 one of the following: |
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 0 or a combination of the following:
|
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
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:
|