# Print output for @column tags ?>
public
final
class
TranslationCapability
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | 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).
Constants | |
|---|---|
int |
STATE_AVAILABLE_TO_DOWNLOAD
TODO: fill in javadoc
|
int |
STATE_DOWNLOADING
TODO: fill in javadoc
|
int |
STATE_NOT_AVAILABLE
The translation service does not support translation between the source and target specs. |
int |
STATE_ON_DEVICE
TODO: fill in javadoc
|
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<TranslationCapability> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
TranslationSpec
|
getSourceSpec()
|
int
|
getState()
The state of translation readiness between |
int
|
getSupportedTranslationFlags()
Translation flags for settings that are supported by the
|
TranslationSpec
|
getTargetSpec()
|
boolean
|
isUiTranslationEnabled()
Whether ui translation for the source-target |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
public static final int STATE_AVAILABLE_TO_DOWNLOAD
TODO: fill in javadoc
Value is STATE_AVAILABLE_TO_DOWNLOAD, STATE_DOWNLOADING, STATE_ON_DEVICE, STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Constant Value: 1 (0x00000001)
public static final int STATE_DOWNLOADING
TODO: fill in javadoc
Value is STATE_AVAILABLE_TO_DOWNLOAD, STATE_DOWNLOADING, STATE_ON_DEVICE, STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Constant Value: 2 (0x00000002)
public static final int STATE_NOT_AVAILABLE
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.
STATE_AVAILABLE_TO_DOWNLOAD, STATE_DOWNLOADING, STATE_ON_DEVICE, STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Constant Value: 4 (0x00000004)
public static final int STATE_ON_DEVICE
TODO: fill in javadoc
Value is STATE_AVAILABLE_TO_DOWNLOAD, STATE_DOWNLOADING, STATE_ON_DEVICE, STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE
Constant Value: 3 (0x00000003)
public int describeContents ()
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.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public TranslationSpec getSourceSpec ()
TranslationSpec describing the source data specs for this
capability.
| Returns | |
|---|---|
TranslationSpec |
This value cannot be null. |
public int getState ()
The state of translation readiness between mSourceSpec and mTargetSpec.
| Returns | |
|---|---|
int |
Value is STATE_AVAILABLE_TO_DOWNLOAD, STATE_DOWNLOADING, STATE_ON_DEVICE, STATE_NOT_AVAILABLE, or android.view.translation.TranslationCapability.STATE_REMOVED_AND_AVAILABLE |
public int getSupportedTranslationFlags ()
Translation flags for settings that are supported by the
TranslationService between the TranslationSpecs
provided in this capability.
| Returns | |
|---|---|
int |
Value is either 0 or a combination of TranslationContext.FLAG_LOW_LATENCY, TranslationContext.FLAG_TRANSLITERATION, and TranslationContext.FLAG_DEFINITIONS |
public TranslationSpec getTargetSpec ()
TranslationSpec describing the target data specs for this
capability.
| Returns | |
|---|---|
TranslationSpec |
This value cannot be null. |
public boolean isUiTranslationEnabled ()
Whether ui translation for the source-target TranslationSpecs is enabled.
Translation service will still support translation requests for this capability.
| Returns | |
|---|---|
boolean |
|
public String toString ()
Returns a string representation of the object. In general, the
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel dest, int flags)
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.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |