private fun isViewDescendantOf(child: View, parent: View): Boolean { if (child === parent) { return true } val theParent = child.parent return theParent is ViewGroup && isViewDescendantOf(theParent as View, parent) }
Return true if child is an descendant of parent , ( or equal to the parent ) .