ToxicBakery / ViewPagerTransforms

Library containing common animations needed for transforming ViewPager scrolling for Android v13+.
https://toxicbakery.github.io/ViewPagerTransforms/
Apache License 2.0
2.57k stars 489 forks source link

Doesn't work when multiple pages are visible. #32

Open osrl opened 9 years ago

osrl commented 9 years ago

I override PagerAdapter.getPageWidth:

@Override
public float getPageWidth(int position) {
    return 0.5f;
}
ToxicBakery commented 9 years ago

Can you please be more descriptive. It is hard to help when the issue is vague. What output did you get and what output did you expect. Example projects are best for conveying problems.

osrl commented 9 years ago

I've added these to your demo app:

In your activity_main.xml

android:paddingLeft="160dp"
android:paddingRight="160dp"
android:clipToPadding="false"

In your pager adapter:

    @Override
    public float getPageWidth(int position) {
        return 1.5f;
    }

In your onCreate:

    mPager.setPageMargin(6);
    mPager.setOffscreenPageLimit(9);

I choose ZoomOutSlideTransformer from the spinner. Expected behaviour is; center page should be bigger, and should slide zoom out when scrolled.

I hope I was explanatory.