val arrowUp = rememberVectorPainter(image = ImageVector.vectorResource(R.drawable.ds_icon_arrowup))
val arrowDown = rememberVectorPainter(image = ImageVector.vectorResource(R.drawable.ds_icon_arrowdown))
val arrowRight = rememberVectorPainter(image = ImageVector.vectorResource(R.drawable.ds_icon_arrowright))
val iconSize = CustomTypography.xSmall.fontSize
val accent = CustomColors.iconAccent
val attention = CustomColors.iconAttention
val tertiary = CustomColors.iconTertiary
val inlineContentMap = remember(iconSize, accent, attention, tertiary) {
mapOf(
"increase" to inlineIcon(iconSize, arrowUp, accent),
"decrease" to inlineIcon(iconSize, arrowDown, attention),
"nochange" to inlineIcon(iconSize, arrowRight, tertiary),
)
}
Is this the best way to write this?
Should I used derviedStateOf
when creating inlineContentMap
?
Does it make sense to use rememberVectorPainter
since we already use remember on inlineMap?
Can we increase its performance taking into account that this will be rendered into an annotedString
in Text
?
Thanks!