TranslationResponse
class TranslationResponse : Parcelable
| kotlin.Any | |
| ↳ | android.view.translation.TranslationResponse |
Response from the translation service, which contains the translated result.
Summary
| Nested classes | |
|---|---|
|
A builder for |
|
| Constants | |
|---|---|
| static Int |
The languages of the request is not available to be translated. |
| static Int |
The translation service was successful in translating. |
| static Int |
The translation service returned unknown translation result. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int | |
| SparseArray<TranslationResponseValue!> |
List of translated |
| Int |
The translation result status code. |
| SparseArray<ViewTranslationResponse!> |
List of translated |
| Boolean |
Whether this response contains complete translated values, or is the final response in a series of partial responses. |
| String |
toString() |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<TranslationResponse!> | |
Constants
TRANSLATION_STATUS_CONTEXT_UNSUPPORTED
static val TRANSLATION_STATUS_CONTEXT_UNSUPPORTED: Int
The languages of the request is not available to be translated.
Value: 2TRANSLATION_STATUS_SUCCESS
static val TRANSLATION_STATUS_SUCCESS: Int
The translation service was successful in translating.
Value: 0TRANSLATION_STATUS_UNKNOWN_ERROR
static val TRANSLATION_STATUS_UNKNOWN_ERROR: Int
The translation service returned unknown translation result.
Value: 1Public 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 |
getTranslationResponseValues
fun getTranslationResponseValues(): SparseArray<TranslationResponseValue!>
List of translated TranslationResponseValues. The key of entries in this list will be their respective index in TranslationRequest.getTranslationRequestValues().
| Return | |
|---|---|
SparseArray<TranslationResponseValue!> |
This value cannot be null. |
getTranslationStatus
fun getTranslationStatus(): Int
The translation result status code.
getViewTranslationResponses
fun getViewTranslationResponses(): SparseArray<ViewTranslationResponse!>
List of translated ViewTranslationResponses. The key of entries in this list will be their respective index in TranslationRequest.getViewTranslationRequests().
| Return | |
|---|---|
SparseArray<ViewTranslationResponse!> |
This value cannot be null. |
isFinalResponse
fun isFinalResponse(): Boolean
Whether this response contains complete translated values, or is the final response in a series of partial responses.
This is true by default.
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 |