Language

View.IsContentCaptureSelfReportingEnabled Property

Definition

Returns whether this View automatically reports its lifecycle events and layout bounds to the Content Capture Version 2.

public virtual bool IsContentCaptureSelfReportingEnabled { [Android.Runtime.Register("isContentCaptureSelfReportingEnabled", "()Z", "GetIsContentCaptureSelfReportingEnabledHandler", ApiSince=37)] get; }
[<get: Android.Runtime.Register("isContentCaptureSelfReportingEnabled", "()Z", "GetIsContentCaptureSelfReportingEnabledHandler", ApiSince=37)>]
member this.IsContentCaptureSelfReportingEnabled : bool

Property Value

true if automatic self-reporting is enabled (default), false otherwise.

Attributes

Remarks

Returns whether this View automatically reports its lifecycle events and layout bounds to the Content Capture Version 2.

By default, this property returns true, which instructs the Android View system to automatically track this view's visibility, position, layout bounds, and structural changes and report them directly to the active ContentCaptureSession.

Views can override this property to return false to disable this automatic monitoring and take full manual control over when and how their properties are reported. This is particularly useful for Views that participate in hybrid hierarchies that can nest Views and Virtual Views bidirectionally. By disabling this behavior, the View itself can choose its own parent id and report the relative bounds to that parent in the Content Capture hierarchy.

ImportantForContentCapture can influence whether this View is reported to Content Capture. For example, setting it to the integer value of No also disables self-reporting. However, not being important for Content Capture influences how descendant nodes are reported. If this View is not important for Content Capture, its children will skip this View while finding their parent id and relative bounds to that parent. Therefore, if this View needs to still act as a parent to its children in the Content Capture hierarchy, but needs to control how it is reported, overriding this property and returning false is recommended.

Note: If this property returns false, the view is fully responsible for notifying the system about its lifecycle and property updates by calling methods such as NotifyNodeAppearedOrChanged(AutofillId, ContentCaptureNodeProperties) and NotifyNodeDisappeared(AutofillId) on the main thread.

Android reference for android.view.View.isContentCaptureSelfReportingEnabled.

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