Listen to layer (object) position
See original GitHub issueIs there any way to listen to an object position that is part of the lottie animation? I can change its position by applying a value callback to its keypath. What I need is to listen to its position without modifying it.
If not, will you handle it in future releases?
I tried to use LottieValueCallback to get the position:
lottieAnimationView.addValueCallback(
new KeyPath("Gift Outlines"),
LottieProperty.TRANSFORM_POSITION,
new LottieValueCallback<PointF>(){
@Override
public PointF getValue(LottieFrameInfo<PointF> frameInfo) {
return super.getValue(frameInfo);
}
}
);
The problem is that super.getValue(frameInfo) always returns null. I assumed super.getValue(frameInfo) return the position of the “Gift Outlines” at the current call and it will be called each time “Gift Outlines” moves . I need t to listen to “Gift Outlines” position.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
object-position - CSS: Cascading Style Sheets - MDN Web Docs
The object-position CSS property specifies the alignment of the selected replaced element's contents within the element's box.
Read more >Get Layer Transform XY Top Left Coordinate Position
Here is a screen capture to show the difference between the layer top left coordinate and the transform X Y position (which match...
Read more >LayerList | API Reference | ArcGIS API for JavaScript 4.25
The LayerList widget provides a way to display a list of layers, and switch on/off their visibility. The ListItem API provides access to...
Read more >Sorting Layers and Sorting Order Explained (Unity 2D)
Let's learn all about how 2D Sorting works with Sorting Layers and Sorting Order. Get the Complete Builder-Defender Course!
Read more >Position from Scale in After Effects: Free Video Tutorial & Guide
Parent the rest of the layers to the Null by dragging the swirl symbol from any ... So the position from scale expression...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This doesn’t resolve anything.
You don’t understand the problem. Please read again what @islamassi wrote. At the moment, the so called
LottieValueCallbackis more of a dynamic getter than a callback. Lottie uses this getter in order to change the animated values for each frame.We need a callback with the animated value without changing the value returned by the getter. For this, we need to use the hacks I wrote above.
If we return null in the getter, we just lose the animation. Nothing will happen.
Thanks for the investigation. I’ll try to look in to this further for a future release.