How to use a ready callback with animations?

What do you want to achieve?

Calling a function when animation is ready.

What have you tried so far?

Created an animation in SquareLine Studio. This can be called correctly and is working.
But when creating the ready callback (lv_anim_set_ready_cb) I do not understand how to reference the animation (lv_anim_t *).
My conclusion is that the callback needs to reference a property of the animation (PropertyAnimation_0, PropertyAnimation_1, etc.), but these are not declared externally.

Please advise.

Others

  • SquareLine Studio version: 1.4.2
  • Operating system: Windows 10
  • Target hardware: ESP32

LV_EVENT_READY is only implemented for select functions in LVGL like keyboard confirm-button, and several others, not for general animation, as seen after checking the LVGL source-code.

The mentioned callback (lv_anim_set_ready_cb) is implemented in LVGL:

/*Set a callback to indicate when the animation is ready (idle).*/
lv_anim_set_ready_cb(&a, ready_cb);

The issue is that it references an animation created by SquareLIne Studio which is not reachable from the user application.

Old story Animation not looping cerrectly - #6 by Marian_M