fun TextView.setOnboardingIcon(@DrawableRes id: Int) { val icon = context.getDrawableWithTint(id, context.getColorFromAttr(R.attr.iconActive))?.apply { val size = context.resources.getDimensionPixelSize(R.dimen.onboarding_header_icon_height_width) setBounds(size) } putCompoundDrawablesRelative(start = icon) }
Sets the drawableStart of a header in an onboarding card.