通知完成卡文案更新;已完成显示紧急度;饼图标注对称;热力图标签间距;重要度改竖线图标;重复新增随时置顶(v0.9)
This commit is contained in:
@@ -145,7 +145,8 @@ class HeatmapView @JvmOverloads constructor(
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
if (days.isEmpty()) return
|
||||
|
||||
val labelW = context.dpf(18f)
|
||||
// 标签列加宽到 24dp,文字右缘离第一列图块 8dp,行名与色块不再贴在一起
|
||||
val labelW = context.dpf(24f)
|
||||
val gap = context.dpf(3f)
|
||||
val firstMs = Dates.dayStartOfKey(days.first().key)
|
||||
val startCol = weekdayIndex(firstMs) // 第一列从周一算起,前面留空
|
||||
@@ -175,7 +176,7 @@ class HeatmapView @JvmOverloads constructor(
|
||||
val baseline = cell / 2f + context.spf(10f) * 0.35f
|
||||
for (row in listOf(0, 2, 4, 6)) {
|
||||
val y = top + row * (cell + gap) + baseline
|
||||
canvas.drawText(Dates.weekdayShort(row), labelW - context.dpf(3f), y, textPaint)
|
||||
canvas.drawText(Dates.weekdayShort(row), labelW - context.dpf(8f), y, textPaint)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,8 +254,13 @@ class LabelDonutView @JvmOverloads constructor(
|
||||
tag.slice.name, tagNamePaint, maxW, TextUtils.TruncateAt.END,
|
||||
).toString()
|
||||
|
||||
canvas.drawText(value, textX, tag.y - context.dpf(3f), tagValuePaint)
|
||||
canvas.drawText(name, textX, tag.y + context.dpf(13f), tagNamePaint)
|
||||
// 时间与任务名分别落在引线上、下方,两段间隙取同一值(4dp),
|
||||
// 按各自字体的 descent / ascent 反推基线,保证视觉上下对称
|
||||
val gap = context.dpf(4f)
|
||||
val vfm = tagValuePaint.fontMetrics
|
||||
val nfm = tagNamePaint.fontMetrics
|
||||
canvas.drawText(value, textX, tag.y - gap - vfm.descent, tagValuePaint)
|
||||
canvas.drawText(name, textX, tag.y + gap - nfm.ascent, tagNamePaint)
|
||||
}
|
||||
|
||||
/** 环上的百分比文字:底色偏亮时改黑字,否则看不出来 */
|
||||
|
||||
Reference in New Issue
Block a user