Issue description: When PagerAdapter.getPageWidth() < 1f, the item shows at the left side.
My question I want the item to be at center or right side. So when scrolling left or right, all the items will be center-alignment. (ViewPager width = page width + 2*pageMargin)
You can translate Canvas in drawChild method,like
@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
canvas.save();
canvas.translate(distance, 0); // change any distance value you want
boolean r = super.drawChild(canvas, child, drawingTime);
canvas.restore();
return r;
}
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