TranslationCapability
class TranslationCapability : Parcelable
kotlin.Any | |
↳ | android.view.translation.TranslationCapability |
Capability class holding information for a pair of TranslationSpec
s.
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: 1
STATE_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: 2
STATE_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: 4
STATE_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: 3
Public 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 0 or android.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 TranslationSpec
s provided in this capability.
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 |
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 TranslationSpec
s 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 either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |