Property

rsp

Extension property to convert an Int to a RemoteTextUnit in Sp.

RemoteTextDynamicFontSizeSample

@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteTextDynamicFontSizeSample() {
    val fontScale = rememberNamedRemoteFloat("fontScale") { 1.2f.rf }
    val dynamicSize = (16f.rf * fontScale).rsp
    RemoteText(text = "Dynamic Size Text".rs, fontSize = dynamicSize)
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: