Open ln-12 opened 1 year ago
I want to display my text with an alpha value dependent on its state. Usually, I would do it like shown here to wrap all composables which should be affected:
CompositionLocalProvider(LocalContentAlpha provides if(isDisabled) { ContentAlpha.high } else { ContentAlpha.disabled }) { RichText( modifier = Modifier.padding(8.dp), ) { Markdown(message.body) } }
However, this solution does not work with RichText, so I found this alternative solution:
RichText
MaterialRichText( modifier = Modifier.alpha(if(isDisabled) { ContentAlpha.high } else { ContentAlpha.disabled }) ) { RichText( modifier = Modifier.padding(8.dp), ) { Markdown(message.body) } }
Are you planning to support setting values using CompositionLocalProvider?
CompositionLocalProvider
I want to display my text with an alpha value dependent on its state. Usually, I would do it like shown here to wrap all composables which should be affected:
However, this solution does not work with
RichText
, so I found this alternative solution:Are you planning to support setting values using
CompositionLocalProvider
?