Dzbj_ESP32-S3_Key/main/ui/screens/ui_ScreenImageReception.c
Rdzleo 75586b3744 ESP32-S3按键版电子吧唧功能完整实现
1、按键驱动重构:从GPIO中断改为iot_button组件,支持BOOT/KEY2的单击/双击/长按6种事件;
2、新增按键导航管理器(key_nav):9种上下文状态机,统一分发按键事件到对应界面业务逻辑;
3、BLE模块改造:广播默认关闭由按键触发,新增设备间图片传输(GATT Client),支持扫描配对→MTU协商→分包发送;
4、新增6个UI界面:配对(Peiwang)、更新(Update)、发送等待(ImageShar)、接收等待(ImageReception)、发送中(Sharing)、接收中(Receiving);
5、新增电池指示器组件(battery_ui):支持多界面真实电量显示,3秒渐隐效果;
6、Home界面重构:移除手势事件,改为airhub背景图+电池指示器;
7、Img界面重构:移除触摸事件,新增删除二次确认边框机制;
8、禁用ScreenSet/ScreenChar界面(保留文件),禁用触摸初始化(保留代码可恢复);
9、sleep_mgr简化:移除ScreenSet亮度UI依赖,按键唤醒由key_nav统一处理;
10、新增9张图片资源(airhub背景、配对、传输状态、电池图标等);

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 17:35:05 +08:00

28 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 接收方等待配对界面 - 显示image_reception图片
// KEY2双击后进入此界面等待与发送方BLE配对
#include "../ui.h"
lv_obj_t *ui_ScreenImageReception = NULL;
static lv_obj_t *image_reception_img = NULL;
void ui_ScreenImageReception_screen_init(void) {
ui_ScreenImageReception = lv_obj_create(NULL);
lv_obj_clear_flag(ui_ScreenImageReception, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_bg_color(ui_ScreenImageReception, lv_color_hex(0x000000), LV_PART_MAIN);
lv_obj_set_style_bg_opa(ui_ScreenImageReception, 255, LV_PART_MAIN);
// 接收方等待配对图片260x300居中显示
image_reception_img = lv_img_create(ui_ScreenImageReception);
lv_img_set_src(image_reception_img, &ui_img_image_reception_png);
lv_obj_set_align(image_reception_img, LV_ALIGN_CENTER);
lv_obj_clear_flag(image_reception_img, LV_OBJ_FLAG_SCROLLABLE);
}
void ui_ScreenImageReception_screen_destroy(void) {
if (ui_ScreenImageReception) lv_obj_del(ui_ScreenImageReception);
ui_ScreenImageReception = NULL;
image_reception_img = NULL;
}