Is it possible in compose to walk through the sema...
# compose-android
t
Is it possible in compose to walk through the semantic tree of child composables after the layout phase? Something like the Layout inspector can do. I also want to collect the position information of all semantic elements. So for example i would like to know where all child text elements are. I only need to do this when the composable is in inspection mode.
So i found following solution but it accesses an hidden API (again 😞😞
Copy code
val view = LocalView.current
LaunchedEffect(Unit) {
    (view as? androidx.compose.ui.platform.AndroidComposeView)?.semanticsOwner?.let { semanticsOwner ->
        //do something with it.
    }
}
There is an other approach to get infos but not in form of semantics nodes using:
Copy code
val inspectionTables = LocalInspectionTables.current
It is not hidden but also not recommended to use.