Function

hasAnyAncestor

Returns whether the node has at least one ancestor that satisfies the given matcher.

hasAnyAncestor

Source set: Common
public fun hasAnyAncestor(matcher: SemanticsMatcher): SemanticsMatcher

Returns whether the node has at least one ancestor that satisfies the given matcher.

Example: For the following tree

|-X
|-A
|-B
|-C1
|-C2

In case of C1, we would check the matcher against A and B

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: