test(binding): add animation delete test

This commit is contained in:
Gabor Kiss-Vamosi
2023-11-23 21:02:38 +01:00
parent a65ca267bf
commit 1320f4fc02
2 changed files with 16 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -150,8 +150,24 @@ static void create_ui(void)
lv_label_set_text(btn_label, "A multi-line text with a ° symbol");
lv_obj_set_width(btn_label, lv_pct(100));
}
if(i == 3) {
/*Start an infinite animation and delete this button later*/
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, btn);
lv_anim_set_values(&a, LV_OPA_COVER, LV_OPA_50);
lv_anim_set_exec_cb(&a, opa_anim_cb); /*Pass a callback*/
lv_anim_set_time(&a, 300);
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
lv_anim_start(&a);
}
}
/*Wait and delete the button with the animation*/
lv_test_wait(300);
lv_obj_delete(lv_obj_get_child(cont, 3));
/*Large byte array*/
static uint8_t canvas_buf[CANVAS_WIDTH_TO_STRIDE(400, 2) * 100 * 2 + LV_DRAW_BUF_ALIGN];