共用方式為


View.OnCreateVirtualViewTranslationRequests Method

Definition

Collects ViewTranslationRequests which represents the content to be translated for the virtual views in the host view.

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

Parameters

virtualIds
Int64[]

the virtual view ids which represents the virtual views in the host view.

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 called multiple times to collect the information to be translated in the host view. One ViewTranslationRequest per virtual child. The ViewTranslationRequest must contains the AutofillId corresponding to the virtualChildIds. Do not keep this Consumer after the method returns.

Attributes

Remarks

Collects ViewTranslationRequests which represents the content to be translated for the virtual views in the host view. This is called if this view returned a virtual view structure from #onProvideContentCaptureStructure and the system determined that those virtual views were relevant for translation.

The default implementation does nothing.

Java documentation for android.view.View.onCreateVirtualViewTranslationRequests(long[], 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