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

How to reduce the spacing between view-in-focus and view in background in horizontal mode? #6

Closed
kuwapa opened this issue Mar 20, 2017 · 3 comments

Comments

@kuwapa
Copy link

kuwapa commented Mar 20, 2017

Hello,

I'm trying to emulate something which looks like the shop cards demo in your sample app. However, I'm trying to reduce the spacing between the view which is expanded and the view which is in the background. How can I do this?

Btw, thanks for building this nice library.

@yarolegovich
Copy link
Owner

yarolegovich commented Mar 20, 2017

Hi.
If you have margins on root elements, remove them.
If it doesn't help, write your custom transformer that will also shift the view to the right/left depending on the position parameter or just play with pivots:

Pivot pivotX = position > 0 Pivot.X.LEFT : Pivot.X.RIGHT;
pivotX.setOn(item);
Pivot.Y.CENTER.setOn(item);
float closenessToCenter = 1f - Math.abs(position);
float scale = minScale + maxMinDiff * closenessToCenter;
item.setScaleX(scale);
item.setScaleY(scale);

@kuwapa
Copy link
Author

kuwapa commented Mar 21, 2017

Cool. Thanks a lot. Will try out a custom transformer.

@vipulasri
Copy link

@abhiank209 were you able to implement custom transformer?

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

3 participants