fix(launcher): M6.20 播放页右滑返回+顶部下滑通知中心+时钟1s刷新 — 推卡验收

This commit is contained in:
AskaEth committed 2026-09-03 13:42:32 +08:00
1 parent 3d70a3dd2c
commit cd9d9da3bd
4 files changed
+31 -6

No files matched your search

+28 -3
View File
@@ -269,7 +269,7 @@ static int64_t np_progress_seek(int tx, int ty)
return 0;
}
void run_now_playing(void)
void run_now_playing(struct app *apps, int napps)
{
int tfd = open(DEV_TOUCH, O_RDONLY | O_NONBLOCK);
if (tfd >= 0) { unsigned char ev[16]; while (read(tfd, ev, sizeof ev) == 16) {} }
@@ -291,6 +291,7 @@ void run_now_playing(void)
int td = 0, td_ok = 0, tdx = -1, tdy = -1, tlx = -1, tly = -1;
unsigned long long last_prog = now_ms();
unsigned long long np_last_status_tick = now_ms(); /* M6.20:播放页状态栏时钟 1s 刷新(主界面同语义) */
int need_redraw = 1;
char last_title[128] = "";
uint32_t last_state = 0xFFFFFFFFu;
@@ -327,8 +328,26 @@ void run_now_playing(void)
if (td_ok) {
int dx = tlx - tdx, dy = tly - tdy;
int adx = dx < 0 ? -dx : dx, ady = dy < 0 ? -dy : dy;
/* 左缘右滑返回(全局手势语义):回到主界面(不清理媒体会话) */
if (meow_edge_back(tdx, dx, dy)) break;
/* 顶部热区下滑 → 打开通知中心(与主界面同语义;mnp_top_swipe_down
* 内部已排除左缘 down_x<24,与下方返回手势互斥)。run_notif_center
* 为阻塞模态,返回后整页重画播放页。 */
if (mnp_top_swipe_down(tdx, tdy, dx, dy, SB_BAR_H, 65)) {
notif_click_t click;
memset(&click, 0, sizeof click);
click.app_idx = -1;
click.status = NOTIF_CLICK_STATUS_NONE;
run_notif_center(apps, napps, &click, 0, 0, 0);
need_redraw = 1;
meow_dirty_full();
meow_ui_flush();
}
/* 左缘右滑返回(全局手势语义),或任意横向右滑返回——与主界面
* 「左滑进入 Now Playing」对称(main_menu 左滑仅要求 tx>=MEOW_EDGE_W,
* 返回却需精确落 24px 左缘带,用户反向右滑极易落空 → 滑不出来)。
* 播放页无横向分页内容、无进度条拖动(进度=点按,幅度<60 走 tap 分支),
* 故任意位置横向右滑恒判返回,安全。回到主界面(不清理媒体会话) */
else if (meow_edge_back(tdx, dx, dy) ||
(dx >= MEOW_EDGE_SWIPE && adx > ady)) break;
if (adx < 60 && ady < 60) {
int cmd = np_btn_tap(tlx, tly);
if (cmd) { meow_media_playctl((uint32_t)cmd, 0); need_redraw = 1; }
@@ -407,6 +426,12 @@ void run_now_playing(void)
last_prog = now;
np_repaint_progress();
}
/* M6.20:播放页状态栏时钟 1s 刷新(与主界面/子页同语义;draw_clock 喂 SDK 全局
* 状态栏 + 标脏顶条,SDK present() 重绘——否则时间冻结在进入播放页那一刻)。 */
if (now - np_last_status_tick >= 1000) {
np_last_status_tick = now;
draw_clock();
}
usleep(10000);
}
meow_ui_activity_pop(); /* M7.0b:退出 Now Playing,回主 activity(控件 owner 仍钉哨兵,复用) */