rubensousa/ViewPagerCards

ViewPager card distance

CedricVandelaer opened this issue · 5 comments

Hi, great tutorial you wrote!

I was wondering if it's possible to increase the distance between the fragments in the viewpager?

Just increase the padding (start and end) and it should work.

I have done this, but this seems to increase/decrease the width of the fragment but not the space in between the fragments

I meant margin, sorry. The padding will only increase/decrease the width of the card.

But you need to do this in the adapter itself, not in the viewpager

This did not work either, I don't really know why. My fragments are just CardViews at the root of the view and giving them a margin did not change anything.

I did found a solution however by using:
mViewPager.setPageMargin((int)ScreenUtils.dpToPixels(this, 16));
But thanks for the help :)