FlexboxItemDecoration inserts decoration at the start when justifyContent=CENTER
- [x] I have searched existing issues and confirmed this is not a duplicate
Issues and steps to reproduce
FlexItemDecoration seems to add decoration at the beginning of the flex line if the layout managermJustifyContent property is set to Justify.Center. Not sure if this is the intended behaviour or I am doing something wrong here. I've linked a sample project to reproduce the issue
If I could solve this issue by overriding FlexItemDecoration, then please provide some details on how to do it.
Sample code -
val layoutManager = FlexboxLayoutManager(this, FlexDirection.ROW, FlexWrap.WRAP)
layoutManager.justifyContent = JustifyContent.CENTER
val itemDecoration = FlexboxItemDecoration(this)
itemDecoration.setDrawable(ContextCompat.getDrawable(this, R.drawable.divider_vertical)!!)
itemDecoration.setOrientation(FlexboxItemDecoration.VERTICAL)
recycler.addItemDecoration(itemDecoration)
recycler.layoutManager = layoutManager
Reference screenshot -
Expected behavior
Drawable is not drawn for the first item on each line.
Version of the flexbox library
1.0.0
Link to code
Sample project - https://github.com/Protino/FlexboxDemo
@thagikura Is this an intended behavior and not a bug?
@thagikura Can you please let me know if this is a bug, so that I will get on fixing it otherwise will close it.