Fragula icon indicating copy to clipboard operation
Fragula copied to clipboard

Restrict swiping area

Open professorDeveloper opened this issue 1 year ago • 3 comments

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 avatar Aug 09 '23 21:08 professorDeveloper

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

massivemadness avatar Aug 10 '23 06:08 massivemadness

Hi @massivemadness please can you write example 🙏🙏

professorDeveloper avatar Aug 10 '23 07:08 professorDeveloper

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 🫤

massivemadness avatar Aug 12 '23 11:08 massivemadness