forked from github/wulkanowy-mirror
Probably fix list divider color (#1270)
Co-authored-by: Rafał Borcz <RafalBO99@outlook.com>
This commit is contained in:

committed by
GitHub

parent
2a7f846d3f
commit
b2efe0d981
@ -2,7 +2,6 @@ package io.github.wulkanowy.ui.widgets
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
@ -12,13 +11,13 @@ class DividerItemDecoration(context: Context) : DividerItemDecoration(context, V
|
||||
canvas.save()
|
||||
val dividerLeft = parent.paddingLeft
|
||||
val dividerRight = parent.width - parent.paddingRight
|
||||
val childCount = parent.childCount
|
||||
|
||||
for (i in 0..childCount - 2) {
|
||||
val child: View = parent.getChildAt(i)
|
||||
for (i in 0..parent.childCount - 2) {
|
||||
val child = parent.getChildAt(i)
|
||||
val params = child.layoutParams as RecyclerView.LayoutParams
|
||||
val dividerTop: Int = child.bottom + params.bottomMargin
|
||||
val dividerTop = child.bottom + params.bottomMargin
|
||||
val dividerBottom = dividerTop + drawable!!.intrinsicHeight
|
||||
|
||||
drawable?.setBounds(dividerLeft, dividerTop, dividerRight, dividerBottom)
|
||||
drawable?.draw(canvas)
|
||||
}
|
||||
|
Reference in New Issue
Block a user