There are various sensory processing and hardware acceleration issues in the CommonsWare-associated workaround. A simpler and more elegant solution, in my opinion, is to specify a negative field for the ViewPager:
ViewPager.setPageMargin( getResources().getDimensionPixelOffset(R.dimen.viewpager_margin));
Then I specified this dimension in my dimens.xml :
<dimen name="viewpager_margin">-64dp</dimen>
To compensate for overlapping pages, each page view has the opposite edge:
android:layout_marginLeft="@dimen/viewpager_margin_fix" android:layout_marginRight="@dimen/viewpager_margin_fix"
Again in the dimens.xml :
<dimen name="viewpager_margin_fix">32dp</dimen>
(Note that the size of viewpager_margin_fix is half the size of the absolute viewpager_margin .)
We applied this in an application for the Dutch newspaper De Telegraaf Krant :


Paul Lammertsma Jan 06 '14 at 11:32 2014-01-06 11:32
source share