I am trying to achieve this in a ViewPager
The first fragment (blue) is displayed and the beginning of the next fragment must be displayed as well, so the user understands he can swipe to switch views. The idea is scroll 20% of the screen programmatically to the left.
Any thoughts are welcome
EDIT: This is exactly what I need to to: the central view needs to overlap both side views
You can try adding this to your PageAdapter:
public float getPageWidth(int position) { if (position == 0 || position == 2) { return 0.8f; } return 1f; }
Try using a negative value for ViewPager.setPageMargin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With