I developed a kind of rolling mechanism for selecting personnel in the application. This is a custom pager that allows you to display more than one element on the screen at a time (3 in my case) and surrounded by a shadow on both sides.
Here's how it should look and work on devices like the Nexus 5 , Nexus 4 , Galaxy S3 :

But on some devices, such as ( Sony Xperia and various types of Motorola ), the rendering looks bad, here is the result:

Regarding the code, I referred to this @Commonsware blog post :
http://commonsware.com/blog/2012/08/20/multiple-view-viewpager-options.html
And the third option is there, in the code of which you can find here .
Here is my code:
PagerContainer:
public class PagerContainer extends FrameLayout implements ViewPager.OnPageChangeListener { private ViewPager mPager; boolean mNeedsRedraw = false; public PagerContainer(Context context) { super(context); init(); } public PagerContainer(Context context, AttributeSet attrs) { super(context, attrs); init(); } public PagerContainer(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() {
Init element:
More research has led me to realize that this problem has something to do with hardware acceleration or lack on some devices. But disabling it with the code didn't help me either.
Has anyone encountered this problem and know how to fix it?
Thanks in advance.
android view android-viewpager rendering
Emil adz
source share