📅  最后修改于: 2022-03-11 14:53:33.078000             🧑  作者: Mango
private fun loading(view: View, loading: Boolean) {
view.takeIf { view is ViewGroup }?.let {
for (i in 0 until (view as ViewGroup).childCount) {
val childAt = view.getChildAt(i)
(childAt as? ISkeletonDrawer)?.let {
if (!loading) {
it.startLoading()
} else {
it.stopLoading()
}
}
run { loading(childAt, loading) }
}
}
}