getChildAt(i) on gets only the direct children of a ViewGroup, is it possible to access to all children without doing nested loops?
getChildAt(i)
ViewGroup
I recently had the same issue and solved it using Kotlin's extension functions like this:
fun ViewGroup.getAllChildren(): List { val children = ArrayList() for (i in 0 until this.childCount) { children.add(this.getChildAt(i)) } return children }