Animation example fails to animate on ESP32


I have ported the keyboard portion of this example onto an esp32 with touchscreen project. The keyboard pops up fine and disappears as described in the code. But it just disappears after the animation time elapses. There is no animation played back, however when changing tabs animation works fine. I have checked lv_conv.h if I have missed anything, but could not find anything.
I find it rather confusing that one animation plays fine, but this one would not.

What MCU/Processor/Board and compiler are you using?

ESP32, ILI9341 with 4-wire touchscreen.

Code to reproduce

        lv_anim_t a;
        a.var = kb;
        a.start = lv_obj_get_y(kb);
        a.end = LV_VER_RES;
        a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y;
        a.path_cb = lv_anim_path_linear;
        a.ready_cb = kb_hide_anim_end;
        a.act_time = 0;
        a.time = 300;
        a.playback = 0;
        a.playback_pause = 0;
        a.repeat = 0;
        a.repeat_pause = 0;

the kb_hide_anim_end callback is executed fine after 300ms, hence I assume setup of the animation is correct. It also works fine in the demo with the browser.

What am I possibly overlooking?

  1. Did you enable LV_USE_ANIMATION in lv_conf.h?
  2. Is lv_task_handler being called in an appropriate timeframe (every 5-10 ms)?
  3. Is lv_tick_inc called in a separate loop from lv_task_handler? Basically, not like this:
/* avoid this, some platforms have issues */
while(1) {

All yes.
Please let me again point out again that animation works perfectly fine if I change the tabs of the tabview! Does this not kind of rule out the basics?

Just to be sure I understand correctly: if you change to “List” tab and back to “Write” tab it works fine.

Please update lvgl and lv_examples from the master branch. Maybe there was a minor bug that is already fixed.

Yes you understand correctly. I am just not using the complete example, I have only taken the snippets that create the keyboard when the text area is clicked, along with the animation code. If I switch the tab, there is animation from left to right. But the animation from the code above will not animate, but execute kb_hide_anim_end once finished “not animating” in this case. will try latest master.

same result with latest master.

Edit: Ahh just had an idea, maybe its a layout function that prevents the .y property to affect the actual position of the keyboard? will check …

gnarr – lv_page_set_scrl_layout(tab2, LV_LAYOUT_COL_M); was the cause.
It slid into the code because I was trying to get the keyboard fill the screen horizontally with no slack around and just would not get this to work. Using the code from the example this part suddenly worked, but not because of the line above, which only kept the y component from actually having an effect on the whole layout …

sorry for the hassle! :see_no_evil:

1 Like

No problem! :wink: