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

Restrict swiping area #30

Open
professorDeveloper opened this issue Aug 9, 2023 · 3 comments
Open

Restrict swiping area #30

professorDeveloper opened this issue Aug 9, 2023 · 3 comments
Assignees
Labels
feature A new feature or improvement

Comments

@professorDeveloper
Copy link

Hi, I wanted to ask something. Is it possible to restrict swiping, i.e. if you swipe anywhere other than the farthest part of the screen on the left, it should not go back

@professorDeveloper professorDeveloper added the feature A new feature or improvement label Aug 9, 2023
@massivemadness
Copy link
Owner

Hi @professorDeveloper, yes it's possible. You have to wrap your nested scrollable views in a custom container like this
https://github.com/android/views-widgets-samples/blob/master/ViewPager2/app/src/main/java/androidx/viewpager2/integration/testapp/NestedScrollableHost.kt

@professorDeveloper
Copy link
Author

Hi @massivemadness please can you write example 🙏🙏

@massivemadness massivemadness changed the title Hi Bro i have question Restrict swiping area Aug 12, 2023
@massivemadness
Copy link
Owner

You can try to wrap all your non-scrollable views in a container like this or ViewGroup that will intercept all the gestures. But I don't think it's a good solution 🫤

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

No branches or pull requests

2 participants