constraintlayout
constraintlayout copied to clipboard
App crashes when trying to animate fontSize in MotionScene for Compose
I'm using version 1.0.1 of Motion Layout for Jetpack Compose alongside with compose bom 2024.02.01, material3 and a JSON5 motion scene, and when i try to do a simple use case such animating Text() font size, the app crashes with the next error message:
java.lang.IllegalArgumentException: no paragraph androidx.compose.foundation.text.modifiers.TextStringSimpleNode.draw(TextStringSimpleNode.kt:390)
I followed the example in: https://github.com/androidx/constraintlayout/wiki/Compose-MotionLayout-JSON-Syntax
custom: { background: '#0000FF', textColor: '#FFFFFF', textSize: 12 }
var properties = motionProperties("a") Text(text = "Hello", modifier = Modifier .layoutId(properties.value.id()) .background(properties.value.color("background")) ,color = properties.value.color("textColor") ,fontSize = properties.value.fontSize("textSize") )
I think it has something to do with the implementation of the new Modifier.Node() method for Text composables drawing/rendering