flexbox-layout icon indicating copy to clipboard operation
flexbox-layout copied to clipboard

Recyclerview items not aligning properly when using flexBasisPercent with FlexBoxItemDecoration/Margin

Open johnryM opened this issue 5 years ago • 0 comments

I'm using a FlexboxLayoutManager and setting flexBasisPercent to 0.5 in the viewholder to create a 2 column recyclerview.

When I try to add spacing between the recyclerview items via a FlexboxItemDecoration and adding a margin to recyclerview, some of the rows contain an item that is slightly wider than the rest which creates a row that only contains one item and a massive gap like in the image below:

image

Lowering the value in flexBasisPercent to 0.45 alleviates this issue but I was wondering if there is a way to keep it rounded to 0.5 and account for margin/dividers. Is this intended behaviour or is there some value clamping somewhere?

I'm running my sample app on a API 23 Tablet Emulator using using version 1.0.0

sample - https://github.com/johnryM/flexbox-recyclerview-sample

johnryM avatar Feb 04 '19 12:02 johnryM