Added in API level 31
Builder
class Builder
| kotlin.Any | |
| ↳ | android.view.translation.ViewTranslationRequest.Builder |
A builder for building ViewTranslationRequest.
Summary
| Public constructors | |
|---|---|
Builder(autofillId: AutofillId)Creates a new Builder. |
|
Builder(autofillId: AutofillId, virtualChildId: Long)Creates a new Builder. |
|
| Public methods | |
|---|---|
| ViewTranslationRequest |
build()Builds the instance. |
| ViewTranslationRequest.Builder |
setValue(key: String, value: TranslationRequestValue)Sets the corresponding |
Public constructors
Builder
Added in API level 31
Builder(autofillId: AutofillId)
Creates a new Builder.
| Parameters | |
|---|---|
autofillId |
AutofillId: The AutofillId of the view associated with this request. This value cannot be null. |
Builder
Added in API level 31
Builder(
autofillId: AutofillId,
virtualChildId: Long)
Creates a new Builder.
| Parameters | |
|---|---|
autofillId |
AutofillId: the AutofillId of the non-virtual view hosting the virtual view hierarchy associated with this request. This value cannot be null. |
virtualChildId |
Long: the id of the virtual view in the host view. This id is the same virtual id provided through content capture. |
Public methods
build
Added in API level 31
fun build(): ViewTranslationRequest
Builds the instance. This builder should not be touched after calling this!
| Return | |
|---|---|
ViewTranslationRequest |
This value cannot be null. |
setValue
Added in API level 31
fun setValue(
key: String,
value: TranslationRequestValue
): ViewTranslationRequest.Builder
Sets the corresponding TranslationRequestValue for the provided key.
| Parameters | |
|---|---|
key |
String: The key for this translation request value. This value cannot be null. |
value |
TranslationRequestValue: the translation request value holding the content to be translated. This value cannot be null. |
| Return | |
|---|---|
ViewTranslationRequest.Builder |
this builder. This value cannot be null. |