Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

App crashes when trying to animate fontSize in MotionScene for Compose #853

Open
@David8aO

Description

@David8aO

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions