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

issue about viewpager component #1028

Closed
1 task
zhengzhong1 opened this issue Oct 18, 2024 · 1 comment
Closed
1 task

issue about viewpager component #1028

zhengzhong1 opened this issue Oct 18, 2024 · 1 comment

Comments

@zhengzhong1
Copy link

Version

0.47.0

Issues and Steps to Reproduce

I need to dynamically adjust the height of the viewpager to achieve the effect shown in the following figure:
image

In Viewpager2, I can dynamically calculate and refresh the height of viewpager2 by listening to ViewPager2.OnPageChangeCallback, calculating the difference between the current page and the target page, and sliding the differencer;

In litho, I did not find the ViewPager2.OnPageChangeCallback interface, only the lower-level RecyclerView.OnScrollListener interface, so I am wondering if there is an implementation similar to the native ScrollEventAdapter in litho;

Expected Behavior

Link to Code

Please show some code we can use to reproduce this issue. Consider using PlaygroundComponentSpec to provide a small example of the issue

@zielinskimz
Copy link
Contributor

Hey, I don't think it is possible with the existing ViewPager component unfortunately. You'd have to try to build your own component based on the ViewPager2 and expose the APIs you need.

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

2 participants