Unverified Commit caf47221 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Update DividerItemDecoration.kt

parent f1d4537e
...@@ -57,7 +57,7 @@ class DividerItemDecoration() : RecyclerView.ItemDecoration() { ...@@ -57,7 +57,7 @@ class DividerItemDecoration() : RecyclerView.ItemDecoration() {
val params = child.layoutParams as RecyclerView.LayoutParams val params = child.layoutParams as RecyclerView.LayoutParams
val bottom = child.bottom + params.bottomMargin val bottom = child.bottom + params.bottomMargin
val top = bottom - divider.intrinsicHeight val top = bottom - (divider?.intrinsicHeight ?: 0)
divider?.setBounds(left, top, right, bottom) divider?.setBounds(left, top, right, bottom)
divider?.draw(c) divider?.draw(c)
...@@ -73,4 +73,4 @@ class DividerItemDecoration() : RecyclerView.ItemDecoration() { ...@@ -73,4 +73,4 @@ class DividerItemDecoration() : RecyclerView.ItemDecoration() {
val position = parent.getChildViewHolder(view).itemViewType val position = parent.getChildViewHolder(view).itemViewType
return position == RoomsAdapter.VIEW_TYPE_HEADER return position == RoomsAdapter.VIEW_TYPE_HEADER
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment