修复:移除常驻通知底部模板按钮;提前完成只留带备注记录、隐藏无备注源任务行(v0.8)
This commit is contained in:
@@ -129,29 +129,8 @@ object Notif {
|
||||
)
|
||||
b.setCustomContentView(rv)
|
||||
b.setCustomBigContentView(rv)
|
||||
|
||||
// 模板动作保留作兜底(自定义布局生效时系统不会重复绘制这两颗按钮)。
|
||||
// 文字必须有:屏幕朗读器读兜底动作时靠它提供语义。
|
||||
if (TimerCore.mode == TimerCore.MODE_FOCUS) {
|
||||
b.addAction(
|
||||
NotificationCompat.Action(
|
||||
if (running) R.drawable.ic_pause else R.drawable.ic_play,
|
||||
context.getString(if (running) R.string.notif_action_pause else R.string.notif_action_resume),
|
||||
serviceAction(
|
||||
context,
|
||||
if (running) TimerService.ACTION_PAUSE else TimerService.ACTION_RESUME,
|
||||
21,
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
b.addAction(
|
||||
NotificationCompat.Action(
|
||||
R.drawable.ic_stop,
|
||||
context.getString(R.string.notif_action_stop),
|
||||
serviceAction(context, TimerService.ACTION_STOP, 23),
|
||||
)
|
||||
)
|
||||
// 不加模板 Action:暂停/结束按钮只保留自定义布局右侧的两颗,
|
||||
// 模板按钮会在通知下方再画一排,重复且占屏。
|
||||
return b.build()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user