Added in API level 31

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 TranslationResponse

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 TranslationResponseValues.

Int

The translation result status code.

SparseArray<ViewTranslationResponse!>

List of translated ViewTranslationResponses.

Boolean

Whether this response contains complete translated values, or is the final response in a series of partial responses.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<TranslationResponse!>

Constants

TRANSLATION_STATUS_CONTEXT_UNSUPPORTED

Added in API level 31
static val TRANSLATION_STATUS_CONTEXT_UNSUPPORTED: Int

The languages of the request is not available to be translated.

Value: 2

TRANSLATION_STATUS_SUCCESS

Added in API level 31
static val TRANSLATION_STATUS_SUCCESS: Int

The translation service was successful in translating.

Value: 0

TRANSLATION_STATUS_UNKNOWN_ERROR

Added in API level 31
static val TRANSLATION_STATUS_UNKNOWN_ERROR: Int

The translation service returned unknown translation result.

Value: 1

Public methods

describeContents

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

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

getViewTranslationResponses

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

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

Added in API level 31
fun toString(): String
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 31
static val CREATOR: Parcelable.Creator<TranslationResponse!>