How to know animation loaded completely?

Hi @kisvegabor , @embeddedt


I am using “move left” animation to change screen.
the previous screen must be deleted after animation done and new screen is displayed completely.
If the previous screen was deleted before, animation will also do, but with a white screen.

So I want to delete all things(such as stylte and user data) related to the previous screen after new screen have loaded completely.
How to know that time?

For ex:
lv_scr_load_anim(new_screen, LV_SCR_LOAD_ANIM_MOVE_RIGHT, 1000, 0, true);
If true is set, old screen will be auto deleted, ※ but style and user data will be not

There seems to be a callback specific for this (lv_anim_ready_cb_t) ( Animations — LVGL documentation)

An inferior method would be to use animation duration and then schedule a task/activity to run after that time.

unfortunately, lv_anim_ready_cb_t can not be used with lv_scr_load_anim. :frowning:

I suggest adding an LV_EVENT_DELETE event for the old screen. It will be called when the screen loader deletes the screen and you can do additional clean up.

It’s a good ideal.
Thanks for your support.