ToxicBakery / ViewPagerTransforms

Library containing common animations needed for transforming ViewPager scrolling for Android v13+.

Home Page:https://toxicbakery.github.io/ViewPagerTransforms/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work when multiple pages are visible.

osrl opened this issue · comments

I override PagerAdapter.getPageWidth:

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

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.

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.