完成文案改字;横屏分割线只分时间;置顶图标黑色bug修复恢复品牌蓝;完成删除线恢复,版本 1.7
This commit is contained in:
@@ -156,10 +156,28 @@ class LockScreenActivity : AppCompatActivity() {
|
||||
tvClock.text = clockFmt.format(cal.time)
|
||||
tvCountdown.text = Dates.clock(now)
|
||||
|
||||
syncDivider()
|
||||
|
||||
val task = if (TimerCore.taskId > 0) Store.task(TimerCore.taskId)?.title else null
|
||||
tvTask.text = task?.takeIf { it.isNotBlank() } ?: getString(R.string.notif_no_task)
|
||||
}
|
||||
|
||||
/**
|
||||
* 横屏排版里的分割线只分割两块大时间:高度对齐倒计时文字的实际渲染高度,
|
||||
* 不再盖住下方的任务名/日期行。竖屏布局没有这个控件,查找结果为 null 直接跳过。
|
||||
*/
|
||||
private fun syncDivider() {
|
||||
val divider = findViewById<View>(R.id.lockDivider) ?: return
|
||||
divider.post {
|
||||
if (tvCountdown.height > 0 && divider.layoutParams != null &&
|
||||
divider.layoutParams.height != tvCountdown.height
|
||||
) {
|
||||
divider.layoutParams.height = tvCountdown.height
|
||||
divider.requestLayout()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Calendar 的 DAY_OF_WEEK(周日=1)转成 weekdayShort 的下标(周一=0 … 周日=6) */
|
||||
private fun weekdayIndex(cal: Calendar): Int = (cal.get(Calendar.DAY_OF_WEEK) + 5) % 7
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user