4

I want to tweak the original View Pager which shows a hint of next child.. see the image below:

enter image description here

I tried creating my own ViewPager which extends the original View Pager but i was unable to make it work.

I would really appreciate if you can point me towards any tutorial or library which does this or something similar.

Thanks.

mudit
  • 25,306
  • 32
  • 90
  • 132
  • Can you try setting the page width in the adapter for the view pager? http://developer.android.com/reference/android/support/v4/view/PagerAdapter.html#getPageWidth(int) – Anukool Sep 11 '13 at 08:54
  • In PagerAdapter, there is an option to get the PageWidth but there is no option to set it. – mudit Sep 11 '13 at 09:04
  • Are you using a custom pager adapter. Try extending PagerAdapter and overriding the getPageWidth() method. Try returning page width = 0.8f . – Anukool Sep 11 '13 at 09:06

1 Answers1

6

Try extending the pager adapter -
Override the getPageWidth method.

    @Override
    public float getPageWidth(int position) {
        return 0.8f; // 1f means 100 percent
    }
Anukool
  • 5,301
  • 8
  • 29
  • 41