- 添加新的UI页面基础架构(ui_page.h),包含页面操作接口 - 创建设置页面控制器(ui_settings_controller.h/.c)来管理页面导航 - 实现具体的设置页面类型:根页面、BLE页面、主题页面 - 修改display_module.c以使用新的页面系统替代旧的状态机 - 移除过时的settings_ui.h头文件和相关状态结构 - 更新事件处理逻辑以使用页面指针而非状态数据传递 - 修改主界面实现以适配统一的页面接口标准
45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
#ifndef BLINKY_UI_MAIN_H_
|
|
#define BLINKY_UI_MAIN_H_
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include <lvgl.h>
|
|
|
|
#include "mode_switch_event.h"
|
|
#include "ui/ui_page.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct ui_main_model {
|
|
lv_color_t theme_color;
|
|
lv_color_t inactive_border_color;
|
|
uint8_t battery_level;
|
|
enum mode_switch_mode mode;
|
|
uint8_t led_mask;
|
|
bool charging;
|
|
bool full;
|
|
};
|
|
|
|
void ui_main_init(const struct ui_main_model *model,
|
|
const char *date_text,
|
|
const char *time_text);
|
|
void ui_main_refresh_all(const struct ui_main_model *model,
|
|
const char *date_text,
|
|
const char *time_text);
|
|
void ui_main_refresh_status_bar(const struct ui_main_model *model);
|
|
void ui_main_refresh_battery(const struct ui_main_model *model);
|
|
void ui_main_refresh_datetime(const char *date_text, const char *time_text);
|
|
void ui_main_deinit(void);
|
|
struct ui_page *ui_main_page_get(const struct ui_main_model *model,
|
|
const char *date_text,
|
|
const char *time_text);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* BLINKY_UI_MAIN_H_ */
|