TranslationRequest
class TranslationRequest : Parcelable
| kotlin.Any | |
| ↳ | android.view.translation.TranslationRequest |
Translation request sent to the translation service by the android.view.translation.Translator which contains the text to be translated.
Summary
| Nested classes | |
|---|---|
|
A builder for |
|
| Constants | |
|---|---|
| static Int |
Indicates this request wants to receive the dictionary result. |
| static Int |
Indicates this request is willing to accept partial responses. |
| static Int |
Indicates this request wants to receive the standard translation result. |
| static Int |
Indicates this request wants to receive the transliteration result. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| Int |
getFlags()Request flags. |
| MutableList<TranslationRequestValue!> |
List of |
| MutableList<ViewTranslationRequest!> |
List of |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<TranslationRequest!> | |
Constants
FLAG_DICTIONARY_RESULT
static val FLAG_DICTIONARY_RESULT: Int
Indicates this request wants to receive the dictionary result.
See TranslationResponseValue.EXTRA_DEFINITIONS for more detail on the structure of the returned data.
Value is either 0 or a combination of the following:
Value: 2FLAG_PARTIAL_RESPONSES
static val FLAG_PARTIAL_RESPONSES: Int
Indicates this request is willing to accept partial responses.
The partial responses can be accessed by TranslationResponse.getTranslationResponseValues() or TranslationResponse.getViewTranslationResponses(). These responses will each contain only a subset of the corresponding translated values.
The are no guarantees to the number of translated values or the order in which these values are returned in the TranslationResponse.
This flag denotes the client can expect multiple partial responses, but there may not necessarily be multiple responses.
.Value is either
0 or a combination of the following:
Value: 8FLAG_TRANSLATION_RESULT
static val FLAG_TRANSLATION_RESULT: Int
Indicates this request wants to receive the standard translation result.
Value is either 0 or a combination of the following:
Value: 1FLAG_TRANSLITERATION_RESULT
static val FLAG_TRANSLITERATION_RESULT: Int
Indicates this request wants to receive the transliteration result.
This returns a CharSequence representation of the transliteration of the translated text. See TranslationResponseValue.getTransliteration().
Value is either 0 or a combination of the following:
Value: 4Public methods
describeContents
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
|
getFlags
fun getFlags(): Int
Request flags. FLAG_TRANSLATION_RESULT by default.
| Return | |
|---|---|
Int |
Value is either 0 or a combination of the following:
|
getTranslationRequestValues
fun getTranslationRequestValues(): MutableList<TranslationRequestValue!>
List of TranslationRequestValues to be translated. The index of entries in this list will be their respective key in the android.util.SparseArray returned by calling TranslationResponse.getTranslationResponseValues().
| Return | |
|---|---|
MutableList<TranslationRequestValue!> |
This value cannot be null. |
getViewTranslationRequests
fun getViewTranslationRequests(): MutableList<ViewTranslationRequest!>
List of ViewTranslationRequests to be translated. The index of entries in this list will be their respective key in the android.util.SparseArray returned by calling TranslationResponse.getViewTranslationResponses().
| Return | |
|---|---|
MutableList<ViewTranslationRequest!> |
This value cannot be null. |
toString
fun toString(): String
Returns a string representation of the object.
| 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 the following:
|