Skip to content

Commit

Permalink
[Refactor] - Use prebuilt Rect::setEmpty instead of `Rect::set(0,0,…
Browse files Browse the repository at this point in the history
…0,0)`
  • Loading branch information
Cliabhach committed Oct 26, 2018
1 parent 130b839 commit fdbc067
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AllToursItemDecoration(
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
val adjustedPos = parent.getChildAdapterPosition(view) - 1 // item position, minus 1 for the header
if (adjustedPos < 0) {
outRect.set(0, 0, 0, 0)
outRect.setEmpty()
} else {
val column = (adjustedPos) % spanCount // item column

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SearchDividerItemDecoration(context: Context) : RecyclerView.ItemDecoratio
} else if ((it is SearchBaseListItemViewModel || it.hasDivider) && (position < adapter.itemCount - 1 )) {
outRect.set(0, 0, 0, mDividerHeight)
} else {
outRect.set(0, 0, 0, 0)
outRect.setEmpty()
}
}
}
Expand Down

0 comments on commit fdbc067

Please sign in to comment.