drawIcon

fun Canvas.drawIcon(iconName: String, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT), density: Density = Density(context))

Deprecated

This function will be removed in a future release.

Replace with

drawFontIcon(iconName, iconFont, tint, context, density, size, weight)

An extension function that draws the icon iconName using iconFont into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint. If iconFont is a variable font, weight will applied as a variation setting, or else the font with the nearest weight will be picked.

Parameters

iconName

the icon name (can be a single character or a string)

context

the Context used to get specific values like density or layout direction

tint

the tint to be applied to this icon

iconFont

the icon font used to draw this icon

size

the size of the icon, by default 24 dp

weight

the font weight of the icon, by default FontWeight.Normal

density

the Density used to compute icon dimensions, by default created from context


fun Canvas.drawIcon(icon: Char, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT), density: Density = Density(context))

Deprecated

This function will be removed in a future release.

Replace with

drawFontIcon(icon, iconFont, tint, context, density, size, weight)

An extension function that draws the icon using iconFont into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint. If iconFont is a variable font, weight will applied as a variation setting, or else the font with the nearest weight will be picked.

Parameters

icon

the icon Unicode character

context

the Context used to get specific values like density or layout direction

tint

the tint to be applied to this icon

iconFont

the icon font used to draw this icon

size

the size of the icon, by default 24 dp

weight

the font weight of the icon, by default FontWeight.Normal

density

the Density used to compute icon dimensions, by default created from context