mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-08-16 07:39:52 +00:00
Develop team (#1)
* draft * Adjust IME candidate scrolling and space behavior * Remove IME buffer label and update remaining counter * Align Meshtastic handling and stabilize chat UI - Align Meshtastic send/receive flow: add routing ACK decoding/log mapping, ack timeouts, channel tracking, and richer RX/TX diagnostics. - Persist and manage PKI peer keys; add PKI backoff on NO_CHANNEL/UNKNOWN_PUBKEY and fall back to PSK when needed. - Improve chat UI state handling: safer app switching with exit callbacks, active app clearing on menu return, and safer chat container cleanup. - Fix Contacts → Compose parent selection to avoid UI tree mismatch; add broadcast compose support and refine action button behavior. - Add UI debug logging for screen/parent validity and child counts to diagnose black-screen/stacking issues. - Apply timezone offset helpers for display-time formatting and reuse in screenshot timestamps. * Add changelog entry and time helpers
This commit is contained in:
+37
-13
@@ -20,6 +20,7 @@ extern "C"
|
||||
extern const lv_image_dsc_t Chat;
|
||||
extern const lv_image_dsc_t Setting;
|
||||
extern const lv_image_dsc_t contact;
|
||||
extern const lv_image_dsc_t team_icon;
|
||||
extern const lv_image_dsc_t shutdown;
|
||||
// Note: img_usb is already declared in images.h (C++ linkage)
|
||||
}
|
||||
@@ -30,11 +31,18 @@ extern "C"
|
||||
|
||||
// Forward declarations for app entry functions (implemented in ui_*.cpp)
|
||||
void ui_gps_enter(lv_obj_t* parent);
|
||||
void ui_gps_exit(lv_obj_t* parent);
|
||||
void ui_chat_enter(lv_obj_t* parent);
|
||||
void ui_chat_exit(lv_obj_t* parent);
|
||||
void ui_contacts_enter(lv_obj_t* parent);
|
||||
void ui_contacts_exit(lv_obj_t* parent);
|
||||
void ui_team_enter(lv_obj_t* parent);
|
||||
void ui_team_exit(lv_obj_t* parent);
|
||||
void ui_setting_enter(lv_obj_t* parent);
|
||||
void ui_setting_exit(lv_obj_t* parent);
|
||||
#ifdef ARDUINO_USB_MODE
|
||||
void ui_usb_enter(lv_obj_t* parent);
|
||||
void ui_usb_exit(lv_obj_t* parent);
|
||||
#endif
|
||||
|
||||
// GPS data access - now provided by GpsService
|
||||
@@ -81,29 +89,37 @@ typedef struct
|
||||
void* user_data;
|
||||
} app_t;
|
||||
|
||||
static app_t* s_active_app = nullptr;
|
||||
|
||||
// App entry functions (implemented in ui_*.cpp files, global scope)
|
||||
|
||||
app_t ui_gps_main = {
|
||||
.setup_func_cb = ui_gps_enter,
|
||||
.exit_func_cb = nullptr,
|
||||
.exit_func_cb = ui_gps_exit,
|
||||
.user_data = nullptr,
|
||||
};
|
||||
|
||||
app_t ui_chat_main = {
|
||||
.setup_func_cb = ui_chat_enter,
|
||||
.exit_func_cb = nullptr,
|
||||
.exit_func_cb = ui_chat_exit,
|
||||
.user_data = nullptr,
|
||||
};
|
||||
|
||||
app_t ui_contacts_main = {
|
||||
.setup_func_cb = ui_contacts_enter,
|
||||
.exit_func_cb = nullptr,
|
||||
.exit_func_cb = ui_contacts_exit,
|
||||
.user_data = nullptr,
|
||||
};
|
||||
|
||||
app_t ui_team_main = {
|
||||
.setup_func_cb = ui_team_enter,
|
||||
.exit_func_cb = ui_team_exit,
|
||||
.user_data = nullptr,
|
||||
};
|
||||
|
||||
app_t ui_setting_main = {
|
||||
.setup_func_cb = ui_setting_enter,
|
||||
.exit_func_cb = nullptr,
|
||||
.exit_func_cb = ui_setting_exit,
|
||||
.user_data = nullptr,
|
||||
};
|
||||
|
||||
@@ -124,21 +140,21 @@ app_t ui_shutdown_main = {
|
||||
#ifdef ARDUINO_USB_MODE
|
||||
app_t ui_usb_main = {
|
||||
.setup_func_cb = ui_usb_enter,
|
||||
.exit_func_cb = nullptr,
|
||||
.exit_func_cb = ui_usb_exit,
|
||||
.user_data = nullptr,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO_USB_MODE
|
||||
const char* kAppNames[6] = {"GPS", "Chat", "Contacts", "USB Mass Storage", "Setting", "Shutdown"};
|
||||
const lv_image_dsc_t* kAppImages[6] = {&gps_icon, &Chat, &contact, &img_usb, &Setting, &shutdown};
|
||||
app_t* kAppFuncs[6] = {&ui_gps_main, &ui_chat_main, &ui_contacts_main, &ui_usb_main, &ui_setting_main, &ui_shutdown_main};
|
||||
#define NUM_APPS 6
|
||||
const char* kAppNames[7] = {"GPS", "Chat", "Contacts", "Team", "USB Mass Storage", "Setting", "Shutdown"};
|
||||
const lv_image_dsc_t* kAppImages[7] = {&gps_icon, &Chat, &contact, &team_icon, &img_usb, &Setting, &shutdown};
|
||||
app_t* kAppFuncs[7] = {&ui_gps_main, &ui_chat_main, &ui_contacts_main, &ui_team_main, &ui_usb_main, &ui_setting_main, &ui_shutdown_main};
|
||||
#define NUM_APPS 7
|
||||
#else
|
||||
const char* kAppNames[5] = {"GPS", "Chat", "Contacts", "Setting", "Shutdown"};
|
||||
const lv_image_dsc_t* kAppImages[5] = {&gps_icon, &Chat, &contact, &Setting, &shutdown};
|
||||
app_t* kAppFuncs[5] = {&ui_gps_main, &ui_chat_main, &ui_contacts_main, &ui_setting_main, &ui_shutdown_main};
|
||||
#define NUM_APPS 5
|
||||
const char* kAppNames[6] = {"GPS", "Chat", "Contacts", "Team", "Setting", "Shutdown"};
|
||||
const lv_image_dsc_t* kAppImages[6] = {&gps_icon, &Chat, &contact, &team_icon, &Setting, &shutdown};
|
||||
app_t* kAppFuncs[6] = {&ui_gps_main, &ui_chat_main, &ui_contacts_main, &ui_team_main, &ui_setting_main, &ui_shutdown_main};
|
||||
#define NUM_APPS 6
|
||||
#endif
|
||||
|
||||
#if LVGL_VERSION_MAJOR == 9
|
||||
@@ -205,9 +221,13 @@ static void create_app(lv_obj_t* parent, const char* name, const lv_image_dsc_t*
|
||||
}
|
||||
if (c == LV_EVENT_CLICKED) {
|
||||
set_default_group(app_g);
|
||||
if (s_active_app && s_active_app != func_cb && s_active_app->exit_func_cb) {
|
||||
(*s_active_app->exit_func_cb)(parent);
|
||||
}
|
||||
if (func_cb->setup_func_cb) {
|
||||
(*func_cb->setup_func_cb)(parent);
|
||||
}
|
||||
s_active_app = func_cb;
|
||||
menu_hidden();
|
||||
} },
|
||||
LV_EVENT_CLICKED, app_fun);
|
||||
@@ -229,6 +249,10 @@ void menu_name_label_event_cb(lv_event_t* e)
|
||||
// App entry functions are implemented in ui_gps.cpp, ui_chat.cpp, ui_setting.cpp
|
||||
|
||||
} // namespace
|
||||
void ui_clear_active_app()
|
||||
{
|
||||
s_active_app = nullptr;
|
||||
}
|
||||
|
||||
// GPS data access - now provided by TLoRaPagerBoard
|
||||
// GPS data collection task is now in TLoRaPagerBoard class
|
||||
|
||||
Reference in New Issue
Block a user