Lottie grandchild fix v2 - #2802
Open
MarkYav wants to merge 3 commits into
Open
Conversation
…ent layer is not rendered.
Replaced the shallow parent mapping with a topological traversal algorithm (buildAncestorTransforms) to accurately capture the entire hierarchy of ancestral transforms for each layer. Previously, Lottie layers completely discarded transforms generated past their immediate parent, breaking deep Lottie hierarchies. Providing the entire ancestral lineage as a sequential list natively preserves the top-down cascading render sequence, letting the RemoteCanvas apply each layer's intrinsic rotation, translation, and custom anchor points accurately. Additionally, wrapped the heavy hierarchical list allocations in a remember(animation.layers) block in LottieAnimation to prevent Garbage Collection churn and performance lags during recompositions.
yschimke
reviewed
Aug 17, 2026
| // TODO: Replace passing a transform param in and applying it to the transform stack with | ||
| // graphicsLayer transforms in the calling composable, once the ANDROID_NATIVE player supports | ||
| // graphicsLayer | ||
| // (b/408913726) |
Collaborator
There was a problem hiding this comment.
Can we remove this comment, it's not true any more.
yschimke
reviewed
Aug 17, 2026
| private fun populateAncestorTransforms( | ||
| layer: com.google.android.horologist.remotecompose.lottie.format.Layer, | ||
| currentStack: | ||
| List<com.google.android.horologist.remotecompose.lottie.format.GraphicElement.Transform>, |
yschimke
reviewed
Aug 17, 2026
| } | ||
| } | ||
|
|
||
| composeRule.onNodeWithTag("Box").captureRoboImage(testName("_grandparent")) |
Collaborator
There was a problem hiding this comment.
It's hard from the test to reason about whether it's right or wrong. Can we either describe how to tell if it's working.
or alternatively, is there a way to make the image tell a story. Such as each layer being a some item like a circle with a number, and the transforms make each layer move out of the way, but without the grandparent, you won't see all 3?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #2795
WHAT
WHY
HOW
Checklist 📋