getChildAt(i) on gets only the direct children of a ViewGroup, is it possible to access to all children without doing nested loops?
ViewGroup using forEach{}If you want to iterate through all childViews, you can use predefined kotlin extension forEach in any ViewGroup. Example:
yourViewGroup.forEach{ childView ->
// do something with this childView
}
.children.toList in a ViewGroupTo return a list of Views, you can use function children to return a Sequence and then use toList() to transform it to a List. Example:
val yourChildViewsList: List