Udostępnij za pośrednictwem


View.OnCreateViewTranslationRequest(Int32[], IConsumer) Method

Definition

Collects a ViewTranslationRequest which represents the content to be translated in the view.

[Android.Runtime.Register("onCreateViewTranslationRequest", "([ILjava/util/function/Consumer;)V", "GetOnCreateViewTranslationRequest_arrayILjava_util_function_Consumer_Handler", ApiSince=31)]
public virtual void OnCreateViewTranslationRequest (int[] supportedFormats, Java.Util.Functions.IConsumer requestsCollector);
[<Android.Runtime.Register("onCreateViewTranslationRequest", "([ILjava/util/function/Consumer;)V", "GetOnCreateViewTranslationRequest_arrayILjava_util_function_Consumer_Handler", ApiSince=31)>]
abstract member OnCreateViewTranslationRequest : int[] * Java.Util.Functions.IConsumer -> unit
override this.OnCreateViewTranslationRequest : int[] * Java.Util.Functions.IConsumer -> unit

Parameters

supportedFormats
Int32[]

the supported translation formats. For now, the only possible value is the android.view.translation.TranslationSpec#DATA_FORMAT_TEXT.

requestsCollector
IConsumer

a ViewTranslationRequest collector that can be used to collect the information to be translated in the view. The requestsCollector only accepts one request; an IllegalStateException is thrown if more than one ViewTranslationRequest is submitted to it. The AutofillId must be set on the ViewTranslationRequest.

Attributes

Remarks

Collects a ViewTranslationRequest which represents the content to be translated in the view.

The default implementation does nothing.

Java documentation for android.view.View.onCreateViewTranslationRequest(int[], java.util.function.Consumer<android.view.translation.ViewTranslationRequest>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to