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

FlexboxItemDecoration inserts decoration at the start when justifyContent=CENTER

Open Protino opened this issue 7 years ago • 2 comments

  • [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 - image

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

Protino avatar Sep 08 '18 18:09 Protino

@thagikura Is this an intended behavior and not a bug?

Protino avatar Dec 28 '18 10:12 Protino

@thagikura Can you please let me know if this is a bug, so that I will get on fixing it otherwise will close it.

Protino avatar Mar 19 '19 07:03 Protino