Fix overlapping date and unread decorations.

This commit is contained in:
Cody Henthorne
2023-07-14 11:06:44 -04:00
committed by Nicholas Tinsley
parent f6bbb59400
commit daf077b3c9
4 changed files with 84 additions and 133 deletions

View File

@@ -83,10 +83,10 @@ fun View.layoutIn(parent: View) {
layout(0, 0, measuredWidth, measuredHeight)
}
fun View.drawAsItemDecoration(canvas: Canvas, parent: View, child: View) {
fun View.drawAsTopItemDecoration(canvas: Canvas, parent: View, child: View, offset: Int = 0) {
canvas.save()
val left = parent.left
val top = child.y.toInt() - height
val top = child.y.toInt() - height - offset
canvas.translate(left.toFloat(), top.toFloat())
draw(canvas)
canvas.restore()