Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Margin between items #39

Open
hosseinaminii opened this issue May 15, 2017 · 4 comments
Open

Margin between items #39

hosseinaminii opened this issue May 15, 2017 · 4 comments

Comments

@hosseinaminii
Copy link

Hello
How can I add margin between items? Currently I add margins for every item in my adapter onCreateView() method but it is not work when I use ChipsLayoutManger.

Thanks

@michalbrz
Copy link

Hi,
I had the same problem but fortunately this issue is indirectly mentioned in Readme:

You may need an RecyclerView.ItemDecoration to work with ChipsLayoutManager for fast setup as showed in sample.
It contained in same package and named SpacingItemDecoration.

So you need to apply SpacingItemDecoration to your RecyclerView.
It could be written more clearly (why and how to use it), but at least it's there.
Its usage is quite straighforward, you can see a sample here:

rvBottomSheet.addItemDecoration(new SpacingItemDecoration(getResources().getDimensionPixelOffset(R.dimen.item_space),

@asche910
Copy link

asche910 commented Dec 8, 2018

Thanks a a lot!this helps me

@ChandanBera
Copy link

Thanks...this code help for me.

@kisa002
Copy link

kisa002 commented Mar 5, 2021

@michalbrz thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants