1、补充提交LVGL的UI文件夹和spiffs_image资源文件夹

This commit is contained in:
Rdzleo 2026-02-27 10:42:11 +08:00
parent a003370db7
commit b544de56bb
7 changed files with 3028 additions and 17 deletions

BIN
.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
main/.DS_Store vendored

Binary file not shown.

View File

@ -78,23 +78,17 @@ void ui_event_ImageDel(lv_event_t * e) {
void ui_event_ScreenImg( lv_event_t * e) {
lv_event_code_t event_code = lv_event_get_code(e);
// 界面加载完成事件:首次进入时才初始化图片
// 界面加载完成事件:每次进入都显示当前图片
if ( event_code == LV_EVENT_SCREEN_LOADED ) {
if (first_load) {
first_load = false;
// 初始化图片列表内部有guard不会重复初始化
init_spiffs_image_list();
// 初始化图片列表
init_spiffs_image_list();
// 获取第一张可用图片
const char *first_img = get_current_image();
if (first_img) {
// 显示第一张SPIFFS图片
update_ui_ImgBle(first_img);
} else {
// 没有图片保持显示UI资源图片 ui_img_s1_png
ESP_LOGI("ScreenImg", "SPIFFS无可用图片显示默认UI图片");
}
// 每次进入界面都显示当前图片支持BLE导航和手势切换回来
const char *current_img = get_current_image();
if (current_img) {
update_ui_ImgBle(current_img);
} else {
ESP_LOGI("ScreenImg", "SPIFFS无可用图片显示默认UI图片");
}
// 每次加载界面时检查是否需要显示 ContainerDle
@ -110,13 +104,19 @@ if ( event_code == LV_EVENT_SCREEN_LOADED ) {
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_TOP ) {
lv_indev_wait_release(lv_indev_get_act());
// 离开界面前隐藏容器
// 离开界面前清理资源和隐藏容器
#if LV_USE_GIF
pages_cleanup_gif();
#endif
ui_ScreenImg_hide_delete_container();
_ui_screen_change( &ui_ScreenHome, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_ScreenHome_screen_init);
}
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_BOTTOM ) {
lv_indev_wait_release(lv_indev_get_act());
// 离开界面前隐藏容器
// 离开界面前清理资源和隐藏容器
#if LV_USE_GIF
pages_cleanup_gif();
#endif
ui_ScreenImg_hide_delete_container();
// 设置返回到Img界面
ui_ScreenSet_set_previous(&ui_ScreenImg, &ui_ScreenImg_screen_init);
@ -202,6 +202,9 @@ lv_obj_add_event_cb(ui_ScreenImg, ui_event_ScreenImg, LV_EVENT_ALL, NULL);
void ui_ScreenImg_screen_destroy(void)
{
#if LV_USE_GIF
pages_cleanup_gif();
#endif
if (ui_ScreenImg) lv_obj_del(ui_ScreenImg);
// NULL screen variables

BIN
spiffs_image/02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
spiffs_image/03.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
spiffs_image/default.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB