refactor(hello): 视图框架批次② — hello.c 拆分为 app.c+ui/{home,full,demo}.c+ui/common/chrome.c+logic/{notify,state}.c(定案B: demo视图态留ui/;定案b: page导航包装activity栈);test_p1p2p3_repro 改多文件链接形态 (agent-177)

hello f45ba051→c06b3b4f; mipsel -Wall -Wextra 0 warning; 宿主 P1c/P2/P3+widgets 全 PASS
出入(诚实): view on_draw/on_event 路径暂未启用(注册表直绘已覆盖, on_draw 双画风险), 留批③实测; home/full 仍手绘未迁注册表
This commit is contained in:
MeowOS committed 2026-08-31 03:31:09 +08:00
1 parent 896f391fee
commit 1d2496b38c
12 files changed
+668 -364

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
/* ui/full.c — 全屏页(ACT_FULL)view + 控制器。
*
* 无控件:进入时声明全屏+状态栏收合,绘制 accent 底 + 三行文本;点任意处/左缘左滑回 home。
* 页面切换由 meow_view_page_push/pop 驱动 on_enter/on_leave(activity_push/pop 在 page_push/pop 内)。
* 注:on_leave 里 activity_active() 仍为 ACT_FULL(activity_pop 在其后),故 OFF 日志的 activity
* id 与旧 set_fullscreen(0) 略异——纯诊断日志差异,功能无变化(见报告)。
*/
#include "hello_internal.h"
static full_ctrl g_full_ctrl;
static int g_full = 0; /* 1=处于全屏视图 */
void full_draw(void)
{
const meow_theme *th = meow_theme_get();
meow_ui_clear(th->accent);
meow_ui_text_center(240, 330, "FULLSCREEN ACTIVE", 28, 0xFFFFFF);
meow_ui_text_center(240, 366, "tap anywhere = back to home", 20, 0xFFFFFF);
meow_ui_text_center(240, 394, "(left-edge swipe also returns)", 20, 0xFFFFFF);
meow_ui_flush();
}
static void full_page_enter(meow_view *v, void *ctx)
{
(void)v;
((full_ctrl *)ctx)->active = 1;
g_full = 1;
meow_ui_set_fullscreen(1);
meow_ui_statusbar_set_collapsed(1);
full_draw();
meow_log(MEOW_LOG_INFO, "fullscreen ON (collapsed), activity->%d", meow_ui_activity_active());
}
static void full_page_leave(meow_view *v, void *ctx)
{
(void)v;
((full_ctrl *)ctx)->active = 0;
g_full = 0;
meow_ui_set_fullscreen(0);
meow_ui_statusbar_set_collapsed(0);
meow_log(MEOW_LOG_INFO, "fullscreen OFF (restore), activity->%d", meow_ui_activity_active());
}
int full_is_active(void)
{
return g_full;
}
meow_view *full_view_create(void)
{
static const meow_view_hooks h = {
.on_enter = full_page_enter,
.on_leave = full_page_leave,
};
return meow_view_create(ACT_FULL, MEOW_VIEW_ACTIVITY, &h, &g_full_ctrl);
}