getDimensionByAttrInDp

fun Context.getDimensionByAttrInDp(@AttrRes attrRes: Int): Int

Returns a dp representation of the dimen value that the given attrRes refers to. Throws: IllegalArgumentException - if the given attribute cannot be found.