Skip to content

Commit

Permalink
Set perpendicular item spacing for grids too
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Sep 1, 2024
1 parent 91c6e4a commit 3366b4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ class DpadGridSpacingDecorationTest : DpadRecyclerViewTest() {

// when
onRecyclerView("Set spacing") { recyclerView ->
recyclerView.setItemSpacing(itemSpacing)
recyclerView.setItemMinEdgeSpacing(minEdgeSpacing)
recyclerView.setItemMaxEdgeSpacing(maxEdgeSpacing)
recyclerView.setItemSpacing(itemSpacing)

// then
assertThat(recyclerView.getSpacingDecoration()).isEqualTo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,10 @@ open class DpadRecyclerView @JvmOverloads constructor(
updateSpacingDecoration { previousDecoration ->
when {
previousDecoration is DpadGridSpacingDecoration -> {
previousDecoration.copy(itemSpacing = spacing)
previousDecoration.copy(
itemSpacing = spacing,
perpendicularItemSpacing = spacing
)
}

previousDecoration is DpadLinearSpacingDecoration -> {
Expand Down

0 comments on commit 3366b4b

Please sign in to comment.