Page MenuHomePhabricator

[native] Make it possible to swipe back from anywhere
ClosedPublic

Authored by ashoat on Jan 21 2023, 1:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 8:04 PM
Unknown Object (File)
Fri, Nov 8, 2:56 AM
Unknown Object (File)
Fri, Nov 8, 2:56 AM
Unknown Object (File)
Fri, Nov 8, 2:56 AM
Unknown Object (File)
Fri, Nov 8, 2:56 AM
Unknown Object (File)
Mon, Nov 4, 3:15 AM
Unknown Object (File)
Mon, Nov 4, 3:15 AM
Unknown Object (File)
Mon, Nov 4, 3:15 AM
Subscribers

Details

Summary

The core change here is to set gestureResponseDistance and swipeEdgeWidth to a large value so they trigger anywhere on the screen.

After this change SwipeableMessage wasn't triggering anymore. In D304 I made it wait for the swipe-to-go-back gesture, but now that the swipe-to-go-back gesture is everywhere, the swipe-to-reply gesture didn't activate at all.

I removed the waitFor from D304 and it felt like things were okay. Perhaps something has changed in React Navigation since D304, but if not I think the fact that you swipe anywhere to go back now will make these gestures less likely to conflict.

After this diff, if we notice ourselves accidentally triggering swipe-to-reply when meaning to trigger swipe-to-go-back, we can revisit this decision.

Test Plan

Deployed dev and release builds to my iOS device and tried swiping around in a MessageList (triggering Chat gesture) and ThreadList (triggering CommunityDrawer gesture)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/navigation/community-drawer-navigator.react.js
56

1000 seems ok for most of the phone's width today, but why we are hardcoding this value instead of using something calculated for the width?

That's fair, I should probably use useWindowDimensions (link)

This revision is now accepted and ready to land.Jan 26 2023, 10:46 AM

Enable gestures on Android

This revision was landed with ongoing or failed builds.Jan 26 2023, 12:02 PM
This revision was automatically updated to reflect the committed changes.