withStyledAttributes

fun withStyledAttributes(context: Context, attributes: AttributeSet, styleableId: IntArray, block: (styledAttributes: TypedArray) -> Unit)

Execute block safely with styled attributes