Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to attach recycelerviewPager's page each other or overlap #153

Open
AshleighLovesChocolate opened this issue Mar 13, 2017 · 0 comments

Comments

@AshleighLovesChocolate
Copy link

i want to attach recyclerviewPager's pages each other

like padding is 0

in the onScrolled >>>>>>>>>>

            for (int j = 0; j < childCount; j++) {
                View v = recyclerView.getChildAt(j);
                //往左 从 padding 到 -(v.getWidth()-padding) 的过程中,由大到小
                float rate = 0;
                if (v.getLeft() <= padding) {
                    if (v.getLeft() >= padding - v.getWidth()) {
                        rate = (padding - v.getLeft()) * 1f / v.getWidth();
                    } else {
                        rate = 1;
                    }
                    v.setScaleY(1 - rate * 0.1f);
                    v.setScaleX(1 - rate * 0.1f);  

                } else {
                    //往右 从 padding 到 recyclerView.getWidth()-padding 的过程中,由大到小
                    if (v.getLeft() <= recyclerView.getWidth() - padding) {
                        rate = (recyclerView.getWidth() - padding - v.getLeft()) * 1f / v.getWidth();
                    }
                    v.setScaleY(0.9f + rate * 0.1f);
                    v.setScaleX(0.9f + rate * 0.1f);
                    v.setTranslationX(-2.0f);
                    v.setAlpha((float)0.3);
                }
            }
        }

I tried to changed setScaleX -> nothing ( that means X doesn't scale so they can attach each other )

But the problem is text or images are shrinks because only Y has scaled

I want to make the whole view smaller than the focused item and attach to each other

is there any way to help me? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant