mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-15 10:58:54 +00:00
V1.0.6
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Copyright (C) 2022-2024 ArtInChip Technology Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
@@ -10,28 +13,34 @@
|
||||
#include "lvgl.h"
|
||||
#include "gif_ui.h"
|
||||
|
||||
static int end_flag = 0;
|
||||
|
||||
static void gif_event(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_READY) {
|
||||
int *end_flag = (int *)lv_event_get_user_data(e);
|
||||
*end_flag = 1;
|
||||
end_flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void gif_ui_init(int *end_flag)
|
||||
int gif_check_finish()
|
||||
{
|
||||
return end_flag;
|
||||
}
|
||||
|
||||
void gif_ui_init()
|
||||
{
|
||||
lv_obj_t * img;
|
||||
img = lv_gif_create(lv_scr_act());
|
||||
|
||||
lv_gif_set_src(img, LVGL_PATH(gif/cherub.gif));
|
||||
lv_gif_set_src(img, LVGL_PATH(gif/bulb.gif));
|
||||
|
||||
printf("path:%s\n", LVGL_PATH(gif/cherub.gif));
|
||||
printf("path:%s\n", LVGL_PATH(gif/bulb.gif));
|
||||
// must call after lv_gif_set_src
|
||||
lv_gif_set_loop_count(img, 1);
|
||||
lv_obj_align(img, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
lv_obj_add_event_cb(img, gif_event, LV_EVENT_ALL, end_flag);
|
||||
lv_obj_add_event_cb(img, gif_event, LV_EVENT_ALL, NULL);
|
||||
printf("gif_ini_ok\n");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Copyright (c) 2022-2024 ArtInChip Technology Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
@@ -13,7 +16,9 @@ extern "C" {
|
||||
#include "lvgl.h"
|
||||
#include "aic_ui.h"
|
||||
|
||||
void gif_ui_init(int *end_flag);
|
||||
void gif_ui_init(void);
|
||||
|
||||
int gif_check_finish(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
Reference in New Issue
Block a user