Files
MeowOS-For-R3P2/patch_v2/hello_app/ui/full.c
T
MeowOS 1d2496b38c 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 仍手绘未迁注册表
2026-08-31 03:31:09 +08:00

57 lines
1.8 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.
/* 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);
}