ContentCaptureSession.NewViewStructure(View) Method

Definition

Creates a ViewStructure for a "standard" view.

[Android.Runtime.Register("newViewStructure", "(Landroid/view/View;)Landroid/view/ViewStructure;", "", ApiSince=29)]
public Android.Views.ViewStructure NewViewStructure (Android.Views.View view);
[<Android.Runtime.Register("newViewStructure", "(Landroid/view/View;)Landroid/view/ViewStructure;", "", ApiSince=29)>]
member this.NewViewStructure : Android.Views.View -> Android.Views.ViewStructure

Parameters

view
View

Returns

Attributes

Remarks

Creates a ViewStructure for a "standard" view.

This method should be called after a visible view is laid out; the view then must populate the structure and pass it to #notifyViewAppeared(ViewStructure).

<b>Note: </b>views that manage a virtual structure under this view must populate just the node representing this view and return right away, then asynchronously report (not necessarily in the UI thread) when the children nodes appear, disappear or have their text changed by calling ContentCaptureSession#notifyViewAppeared(ViewStructure), ContentCaptureSession#notifyViewDisappeared(AutofillId), and ContentCaptureSession#notifyViewTextChanged(AutofillId, CharSequence) respectively. The structure for the a child must be created using ContentCaptureSession#newVirtualViewStructure(AutofillId, long), and the autofillId for a child can be obtained either through childStructure.getAutofillId() or ContentCaptureSession#newAutofillId(AutofillId, long).

When the virtual view hierarchy represents a web page, you should also:

<ul> <li>Call ContentCaptureManager#getContentCaptureConditions() to infer content capture events should be generate for that URL. <li>Create a new ContentCaptureSession child for every HTML element that renders a new URL (like an IFRAME) and use that session to notify events from that subtree. </ul>

<b>Note: </b>the following methods of the structure will be ignored: <ul> <li>ViewStructure#setChildCount(int)<li>ViewStructure#addChildCount(int)<li>ViewStructure#getChildCount()<li>ViewStructure#newChild(int)<li>ViewStructure#asyncNewChild(int)<li>ViewStructure#asyncCommit()<li>ViewStructure#setWebDomain(String)<li>ViewStructure#newHtmlInfoBuilder(String)<li>ViewStructure#setHtmlInfo(android.view.ViewStructure.HtmlInfo)<li>ViewStructure#setDataIsSensitive(boolean)<li>ViewStructure#setAlpha(float)<li>ViewStructure#setElevation(float)<li>ViewStructure#setTransformation(android.graphics.Matrix)</ul>

Java documentation for android.view.contentcapture.ContentCaptureSession.newViewStructure(android.view.View).

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