Added in API level 31

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

TranslationSpec describing the source data specs for this capability.

Int

The state of translation readiness between mSourceSpec and mTargetSpec.

Int

Translation flags for settings that are supported by the translation service between the TranslationSpecs provided in this capability.

TranslationSpec

TranslationSpec describing the target data specs for this capability.

Boolean

Whether ui translation for the source-target TranslationSpecs is enabled.

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<TranslationCapability!>

Constants

STATE_AVAILABLE_TO_DOWNLOAD

Added in API level 31
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: 1

STATE_DOWNLOADING

Added in API level 31
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: 2

STATE_NOT_AVAILABLE

Added in API level 31
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: 4

STATE_ON_DEVICE

Added in API level 31
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: 3

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 specs for this capability.

Return
TranslationSpec This value cannot be null.

getState

Added in API level 31
fun getState(): Int

The state of translation readiness between mSourceSpec and mTargetSpec.

Return
Int Value is one of the following:

getSupportedTranslationFlags

Added in API level 31
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

Added in API level 31
fun getTargetSpec(): TranslationSpec

TranslationSpec describing the target data specs for this capability.

Return
TranslationSpec This value cannot be null.

isUiTranslationEnabled

Added in API level 31
fun isUiTranslationEnabled(): Boolean

Whether ui translation for the source-target TranslationSpecs is enabled.

Translation service will still support translation requests for this capability.

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<TranslationCapability!>