flexbox-layout
flexbox-layout copied to clipboard
Recyclerview items not aligning properly when using flexBasisPercent with FlexBoxItemDecoration/Margin
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:
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