Hello, <@UHAJKUSTU>, I'm currently making an app f...
# decompose
o
Hello, @Arkadii Ivanov, I'm currently making an app for iOs and I'm trying to use Predictive Back Gesture implementation from the documentation, which implements the Cupertino back swipe. But I ran into the following problem: if there is an element with horizontal scrolling on the screen (LazyRow for example), it stops scrolling normally because
Modifier.handleBackGestures
from
PredictiveBackGestureOverlay
is prioritized. Any ideas how to fix it?
u
I am looking to solve for the same @Arkadii Ivanov Any help or sample would be greatly appreciated
a
That's kind of the same behavior with Android. The gesture is always intercepted at the screen edges.
u
How can we set priority. For example pager should take precedence over the edge swiping Same goes for lazy column Like how it is for native iOS behaviour
Right now they interfere
a
The pager shouldn't take priority, as it works the same on Android.
There is no way currently. But you can copy the implementation of the overlay and try tuning it.
If you have a full screen horizontally scrollable gallery of images, the user wouldn't be able to leave the screen at all. This behavior is by design.
u
I have tried and could not come up with something which would be similar to native iOS behaviour Android allows only edge swiping while iOS allows mid page swiping too So pager when swiped should intercept them until we have reached the first page where the back handler should intercept This is the default behaviour in iOS
a
I'm not sure if native iOS allows swiping in the middle of the screen. The Decompose overlay only detects at the edges, the width is customizable though.
u
It does. For example: Take a look at twitter app. Search section. When left swiping between pages, the pager intercepts until we reach the first page Then the back handler navigates
a
That's custom behavior I believe. Similar how telegram implemented it on Android. I tried system settings on iOS, only edges are working.
Decompose doesn't allow this sort of customizations at the moment. It always intercepts, same as on Android. This is to prevent blocking the user from leaving the screen, if there is a full screen horizontally scrollable widget.
u
Yeah I guess so. Slack Android app also has this same customised behaviour. Wonder if its actually possible with decompose
a
The only way is to copy and tune the overlay for your needs.
u
Got it. Thanks
👍 1
I think this diff to overlay kind of works. Though, additional changes might be needed.
u
Let me try this