feat(ncm): 复古UI重做 (agent-211, 按 NCM_UI_DESIGN.md) — 白红/黑红双套配色(ncm_palette+主题监听实时换肤); 主页红topbar+个人区+双页签(我创建的/我收藏的, is_collected/subscribed已补); 搜索页(cloudsearch,仅确认时发请求); 歌单详情封面头块+播放全部; 播放页黑胶唱盘(行扫圆+封面裁圆+唱针+分带刷新); 播放页tick分带刷新修整页重绘隐患
ncm→90a25cf0; 0 warning; 宿主14张双主题截图目检+core测试全过
This commit is contained in:
1 parent
4cec476dd9
commit
8964cd1750
33 files changed
+1333
-320
No files matched your search
@@ -28,6 +28,7 @@
|
||||
#define ACT_PLAYLIST 2 /* 歌单详情(曲目列表) */
|
||||
#define ACT_PLAYER 3 /* 播放页(可横竖屏切,v1 允许切) */
|
||||
#define ACT_SETTINGS 4 /* 设置页 */
|
||||
#define ACT_SEARCH 5 /* 搜索页(顶栏搜索按钮进入) */
|
||||
|
||||
/* ---- 布局 ---- */
|
||||
#define APP_W 480
|
||||
@@ -44,6 +45,7 @@
|
||||
#define NCM_SONG_BATCH 64 /* song_detail 分批每批条数 */
|
||||
#define NCM_LYRIC_LINES 600 /* 歌词行上限 */
|
||||
#define NCM_COVER_MAX 288*1024 /* 封面下载限幅 ~288KB */
|
||||
#define NCM_SEARCH_MAX 32 /* 搜索结果上限(v1 只显示前 32 条,无大缓冲) */
|
||||
|
||||
/* ---- 播放/媒体会话状态(play 线程 ↔ UI/IPC 共享,mu 保护)---- */
|
||||
enum {
|
||||
@@ -121,6 +123,12 @@ typedef struct ncm_app_state {
|
||||
/* 设置(持久化 MeowData/os.meow.ncm/data)*/
|
||||
int level; /* NCM_LEVEL_* */
|
||||
int cache_limit_gb;
|
||||
|
||||
/* 搜索(结果复用 g_st.songs[] 浅拷贝区;仅搜索页上下文有效)*/
|
||||
char search_query[256];
|
||||
int search_count; /* 当前搜索结果数(含 0=无/未搜) */
|
||||
volatile int search_loading; /* 1=搜索请求在途 */
|
||||
int search_err; /* 最近一次搜索错误(0=ok) */
|
||||
} ncm_app_state_t;
|
||||
|
||||
extern ncm_app_state_t g_st; /* 全局状态(app.c 定义) */
|
||||
@@ -129,6 +137,28 @@ extern volatile int g_app_quit; /* 请求退出(线程停) */
|
||||
extern volatile int g_net_ready; /* 网络/核心库线程安全可用 */
|
||||
extern int g_host_mock; /* 1=宿主/测试:跳过网络,用预置数据 */
|
||||
|
||||
/* ---- App 侧调色板(ui/common/ncm_colors.c)----
|
||||
* 品牌红 + 播放页/登录专属色。中性色由 meow_theme_get() 语义色提供。§3.2/§3.3/§5.4。 */
|
||||
typedef struct ncm_pal {
|
||||
uint32_t red; /* 主 accent:day #C20C0C / night #EC4141 */
|
||||
uint32_t red_lit; /* 亮点变体:day #EC4141 / night #FF6A6A */
|
||||
uint32_t red_ctr; /* 红底浅块:day #FBE9E9 / night #3A1919 */
|
||||
uint32_t on_red; /* 红底前景(#FFFFFF) */
|
||||
uint32_t on_red_dim; /* 红底次前景(白 ~88%,文本用) */
|
||||
uint32_t hero; /* 登录 hero 深红压场:day #C20C0C / night #7A0E0E */
|
||||
uint32_t player_bg; /* 播放页沉浸底:day #FFFDF9 / night #0C0D10 */
|
||||
uint32_t disc; /* 黑胶盘体:day #1A1A1A / night #141414 */
|
||||
uint32_t disc_edge; /* 盘缘槽纹:day #2A2A2A / night #232323 */
|
||||
} ncm_pal_t;
|
||||
extern int g_dark; /* 1=黑红(night) 0=白红(day) */
|
||||
const ncm_pal_t *ncm_palette(int dark); /* dark==g_dark */
|
||||
void ncm_on_theme(meow_theme_mode m); /* 主题侦听:明暗变化 → 整 App 重绘 */
|
||||
void ncm_fill_round(int x, int y, int w, int h, int r, uint32_t color); /* 填充圆角矩形 */
|
||||
void ncm_draw_button(int x, int y, int w, int h, const char *label,
|
||||
uint32_t bg, uint32_t fg); /* App 侧品牌红/FILLED 按钮 */
|
||||
int first_glyph(const char *s, char *out, size_t sz); /* 取首个 UTF-8 字形(头像首字) */
|
||||
const char *ncm_text_fit(const char *s, int maxw, int size); /* 按宽裁剪("..."结尾;静态缓冲) */
|
||||
|
||||
/* ---- 通用矩形 ---- */
|
||||
typedef struct { int x, y, w, h; } ncm_rect_t;
|
||||
#define NR(x,y,w,h) ((ncm_rect_t){ (x),(y),(w),(h) })
|
||||
@@ -197,6 +227,17 @@ void settings_touch_move(int x, int y);
|
||||
void settings_open(void); /* 进设置页 */
|
||||
void settings_reload(void);
|
||||
|
||||
/* search */
|
||||
meow_view *search_view_create(void);
|
||||
int search_is_active(void);
|
||||
int search_on_tap(int x, int y);
|
||||
void search_swipe(int dir, int dist);
|
||||
void search_touch_down(int x, int y);
|
||||
void search_touch_move(int x, int y);
|
||||
void search_open(void); /* 进搜索页 */
|
||||
void search_submit(const char *kw); /* 用户确认后发起搜索(风控:仅在确认时发) */
|
||||
void search_tick(uint64_t now); /* UI tick:检查搜索 worker 完成并刷新 */
|
||||
|
||||
/* ---- logic ---- */
|
||||
int appstate_init(void); /* 初始化 ctx/data/cookie/设置;0=成功 */
|
||||
void appstate_load_settings(void);
|
||||
|
||||
Reference in new issue
Block a user