FontIconDrawable

constructor(iconName: String, typeface: Typeface, fontFeatureSettings: String?, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp)

A drawable that draws the icon iconName using the typeface. The icon will be size × size dp, and will be tinted with tint.

Parameters

iconName

the icon name (icon aliases/font ligatures are supported)

typeface

the Paint used to draw this icon

fontFeatureSettings

the font feature settings, written in a CSS syntax

tint

the tint to be applied to this icon

size

the size of the icon, by default 24 dp


constructor(icon: Char, typeface: Typeface, fontFeatureSettings: String?, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp)

A drawable that draws the icon using the typeface. The icon will be size × size dp, and will be tinted with tint.

Parameters

icon

the icon Unicode character

typeface

the Paint used to draw this icon

fontFeatureSettings

the font feature settings, written in a CSS syntax

tint

the tint to be applied to this icon

size

the size of the icon, by default 24 dp


constructor(iconName: String, iconFont: StaticIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

A drawable that draws the icon iconName using the iconFont. The icon will be size × size dp, and will be tinted with tint.

Parameters

iconName

the icon name (icon aliases/font ligatures are supported)

iconFont

the StaticIconFont used to draw this icon

tint

the tint to be applied to this icon

context

the Context used to access some typefaces

size

the size of the icon, by default 24 dp

weight

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


constructor(icon: Char, iconFont: StaticIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

A drawable that draws the icon using the iconFont. The icon will be size × size dp, and will be tinted with tint.

Parameters

icon

the icon Unicode character

iconFont

the StaticIconFont used to draw this icon

tint

the tint to be applied to this icon

context

the Context used to access some typefaces

size

the size of the icon, by default 24 dp

weight

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


@RequiresApi(value = 26)
constructor(iconName: String, typeface: Typeface, fontFeatureSettings: String?, fontVariationSettings: Array<out FontVariation.Setting>, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

A drawable that draws the icon iconName using the variable typeface. The icon will be size × size dp, and will be tinted with tint.

Parameters

iconName

the icon name (icon aliases/font ligatures are supported)

typeface

the Paint used to draw this icon

fontFeatureSettings

the font feature settings, written in a CSS syntax

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') or the weight ('wght')

tint

the tint to be applied to this icon

density

the Density used to compute icon dimensions and variation values

size

the size of the icon, by default 24 dp

weight

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


@RequiresApi(value = 26)
constructor(icon: Char, typeface: Typeface, fontFeatureSettings: String?, fontVariationSettings: Array<out FontVariation.Setting>, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

A drawable that draws the icon using the variable typeface. The icon will be size × size dp, and will be tinted with tint.

Parameters

icon

the icon Unicode character

typeface

the Paint used to draw this icon

fontFeatureSettings

the font feature settings, written in a CSS syntax

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') or the weight ('wght')

tint

the tint to be applied to this icon

density

the Density used to compute icon dimensions and variation values

size

the size of the icon, by default 24 dp

weight

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


@RequiresApi(value = 26)
constructor(iconName: String, iconFont: VariableIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

A drawable that draws the icon iconName using the variable iconFont. The icon will be size × size dp, and will be tinted with tint.

Parameters

iconName

the icon name (icon aliases/font ligatures are supported)

iconFont

the VariableIconFont used to draw this icon

tint

the tint to be applied to this icon

context

the Context used to access some typefaces

density

the Density used to compute icon dimensions and variation values

size

the size of the icon, by default 24 dp

weight

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


@RequiresApi(value = 26)
constructor(icon: Char, iconFont: VariableIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

A drawable that draws the icon using the variable iconFont. The icon will be size × size dp, and will be tinted with tint.

Parameters

icon

the icon Unicode character

iconFont

the VariableIconFont used to draw this icon

tint

the tint to be applied to this icon

context

the Context used to access some typefaces

density

the Density used to compute icon dimensions and variation values

size

the size of the icon, by default 24 dp

weight

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


constructor(iconName: String, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

Deprecated

This constructor will be removed in a future release.

Replace with

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

A drawable that draws the icon iconName using the iconFont. 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


constructor(icon: Char, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

Deprecated

This constructor will be removed in a future release.

Replace with

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

A drawable that draws the icon using the iconFont. 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