Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for text in dynamic properties #1995

Merged
merged 3 commits into from
Jan 16, 2022
Merged

Conversation

gpeal
Copy link
Collaborator

@gpeal gpeal commented Jan 16, 2022

The original TextDelegate API pre-dates dynamic properties. Compose only has access to the newer dynamic properties API so this PR extends dynamic property support to include text.

val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.name))
val progress by animateLottieCompositionAsState(composition, iterations = LottieConstants.IterateForever)
val dynamicProperties = rememberLottieDynamicProperties(
    rememberLottieDynamicProperty(LottieProperty.TEXT, "Gabriel Peal", "NAME"),
)
LottieAnimation(
    composition,
    progress,
    dynamicProperties = dynamicProperties,
)

Fixes #1903

@LottieSnapshotBot
Copy link

Snapshot Tests
28: Report Diff

@gpeal gpeal merged commit ca94498 into master Jan 16, 2022
@gpeal gpeal deleted the gpeal/compose-dynamic-text branch January 16, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextDelegate for compose
2 participants