sync(SDK): 增量同步主仓 M6.37–M6.39 至公开 SDK 仓
sdk/: - 同步 meow_ui_widget/input/gfx/lazygrid/audio/media/img 等源码与头 (SDK 默认列表/容器控件默认 MD3 — meow_list_set_container 可回退; 全局 App 内底部上滑回桌面 — meow_ui_input_is_home_swipe 系统保留手势; LazyGrid/LazyColumn/LazyRow MD3 化;叠加让位自抑改 app_id 判定; DSD 音频格式等) - 新增独立模块源码 meow_img_color / meow_lyric / meow_lyric_view 及对应宿主 test_*.c - 保留公开仓自包含适配:vendored meow_font.c/meow_font.h/meow_notif.h 不动; build_sdk.sh 自包含版本不动;meow_ui_gfx.c 仅改 meow_font.h include 路径; meow_ui_internal.h 去除 FreeType 内部声明 - meow_ipc.h 同步到主仓 launcher 版本(含 AUDIO_FMT_DOP/媒体歌词/蓝牙输出协议) - 不含 FreeType 矢量字 meow_ft_*(需 freetype vendor,公开仓以位图 meow_font 自包含);不含 mipsel 二进制 / .o / .a / 固件 / 密钥 / devdocs examples/hello/: - 新增 ui/demo/sdk2/sdk2.c;build_hello.sh 纳入该文件(保持自包含) docs / README / .gitignore: - docs/MEOW_APP_SDK.md 补 §12.5(默认 MD3 容器 + 底部上滑回桌面 + 两个新 API) - README 能力清单补「默认 MD3 容器」与「底部上滑回桌面」 - .gitignore 补新增宿主测试二进制 验证:sdk/meow_ui.a 与 examples/hello/hello 交叉编译均 0 warning;工作区无生成物。
This commit is contained in:
1 parent
a1687486bc
commit
c0396e40ce
45 files changed
+4665
-175
No files matched your search
+24
-13
@@ -268,35 +268,46 @@ int meow_lazygrid_hit(meow_lazygrid *g, int x, int y)
|
||||
}
|
||||
|
||||
/* ---- 绘制(只画可见行;clip 钳到宫格视口)---- */
|
||||
/* MD3 容器(默认 renderer P0):格=格内对称内缩 surfaceContainer 圆角卡(radius_card)+ 卡内 tonal
|
||||
* 选中(primaryContainer)/ 按压(primary α26);画布=整格(触控目标),卡在其内对称内缩(同
|
||||
* meow_listview 行>卡范式:卡片外仍命中整格,视觉卡留出呼吸空隙)。完全自绘(set_item_draw)
|
||||
* 覆盖本 renderer,App 自理容器观感。 */
|
||||
#define MEOW_LAZYGRID_CARD_MARGIN 8 /* 格内对称边距(卡内缩;与 cell gap 叠加出卡间空隙) */
|
||||
static void lg_draw_cell(meow_lazygrid *g, const meow_theme *th, int index,
|
||||
int cell_x, int cell_y, meow_lazygrid_item *it)
|
||||
{
|
||||
int sel = (index == g->sel);
|
||||
int txtcol = sel ? th->onPrimaryContainer : th->onSurface;
|
||||
int subcol = sel ? th->onPrimaryContainer : th->onSurfaceVariant;
|
||||
uint32_t bg = sel ? th->primaryContainer : th->surfaceContainerLow;
|
||||
meow_gfx_fill_round(cell_x, cell_y, g->cell_w, g->cell_h, th->radius_card, bg);
|
||||
int m = MEOW_LAZYGRID_CARD_MARGIN;
|
||||
int cw = g->cell_w - 2 * m, chh = g->cell_h - 2 * m; /* 卡尺寸(格内对称内缩) */
|
||||
int cx = cell_x + m, cy = cell_y + m; /* 卡左上 */
|
||||
int press = meow_input_touch_down() &&
|
||||
meow_input_touch_x() >= cell_x && meow_input_touch_x() < cell_x + g->cell_w &&
|
||||
meow_input_touch_y() >= cell_y && meow_input_touch_y() < cell_y + g->cell_h;
|
||||
meow_gfx_fill_round(cx, cy, cw, chh, th->radius_card, th->surfaceContainer);
|
||||
if (sel) meow_gfx_fill_round(cx, cy, cw, chh, th->radius_card, th->primaryContainer);
|
||||
else if (press) meow_gfx_fill_round_alpha(cx, cy, cw, chh, th->radius_card, th->primary, 26);
|
||||
|
||||
int pad = 8;
|
||||
int thh = meow_ui_text_height(th->font_body);
|
||||
int chh = g->cell_h, cw = g->cell_w;
|
||||
/* 图标(可选):居中于格顶 ~50%。 */
|
||||
/* 图标(可选):居中于卡顶 ~50%(卡中心=格中心,因对称内缩)。 */
|
||||
if (it->icon) {
|
||||
int isz = cw * 6 / 10; if (isz > chh * 5 / 10) isz = chh * 5 / 10;
|
||||
int isz = g->cell_w * 6 / 10; if (isz > g->cell_h * 5 / 10) isz = g->cell_h * 5 / 10;
|
||||
if (isz < 16) isz = 16;
|
||||
int icx = cell_x + cw / 2, icy = cell_y + pad + isz / 2;
|
||||
int icx = cx + cw / 2, icy = cy + pad + isz / 2;
|
||||
meow_ui_img_scaled(icx - isz / 2, icy - isz / 2, isz, isz, (meow_img *)it->icon);
|
||||
}
|
||||
/* 标题 + 副标题(主界面:名 + 状态)。底部对齐。 */
|
||||
/* 标题 + 副标题(主界面:名 + 状态)。卡内底部对齐。 */
|
||||
int has_sub = (it->subtitle && it->subtitle[0]);
|
||||
int ty = cell_y + chh - pad - thh - (has_sub ? (thh + 2) : 0);
|
||||
if (it->title) meow_ui_text_center(cell_x + cw / 2, ty, it->title, th->font_body, txtcol);
|
||||
if (has_sub) meow_ui_text_center(cell_x + cw / 2, ty + thh + 2, it->subtitle, th->font_body, subcol);
|
||||
int ty = cy + chh - pad - thh - (has_sub ? (thh + 2) : 0);
|
||||
if (it->title) meow_ui_text_center(cx + cw / 2, ty, it->title, th->font_body, txtcol);
|
||||
if (has_sub) meow_ui_text_center(cx + cw / 2, ty + thh + 2, it->subtitle, th->font_body, subcol);
|
||||
|
||||
/* 选中描边(轮廓);禁用整体变淡。 */
|
||||
if (sel) meow_ui_draw_rect_round(cell_x, cell_y, cw, chh, th->radius_card, th->primary);
|
||||
/* 选中描边(轮廓);禁用卡内变淡(圆角 α,防圆角外叠出灰方块)。 */
|
||||
if (sel) meow_ui_draw_rect_round(cx, cy, cw, chh, th->radius_card, th->primary);
|
||||
if (!it->enabled)
|
||||
meow_ui_fill_rect_alpha(cell_x, cell_y, cw, chh, th->onSurface, 90);
|
||||
meow_gfx_fill_round_alpha(cx, cy, cw, chh, th->radius_card, th->onSurface, 90);
|
||||
}
|
||||
|
||||
void meow_lazygrid_draw(meow_lazygrid *g, const meow_theme *th)
|
||||
|
||||
Reference in new issue
Block a user