Page MenuHomePhabricator

[native] Migrate pan gesture handling in FullScreenViewModal
ClosedPublic

Authored by angelika on Feb 6 2025, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 16, 4:26 PM
Unknown Object (File)
Wed, Apr 16, 1:35 PM
Unknown Object (File)
Wed, Apr 16, 10:08 AM
Unknown Object (File)
Wed, Apr 16, 7:12 AM
Unknown Object (File)
Wed, Apr 16, 12:45 AM
Unknown Object (File)
Tue, Apr 15, 11:49 PM
Unknown Object (File)
Mon, Apr 14, 8:19 PM
Unknown Object (File)
Sun, Apr 13, 8:34 AM
Subscribers

Details

Summary

https://linear.app/comm/issue/ENG-8150/convert-fullscreenviewmodal-to-reanimated-2-syntax

Migrate panUpdate method which updates image position when pan gesture is in progress based on the delta between current and last pan translation, just like in the original implementation. Also migrate panActive value.

Depends on D14301

Test Plan

Tested after migration: verify pan gesture works.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

angelika held this revision as a draft.
native/components/full-screen-view-modal.react.js
103–115 ↗(On Diff #46946)

The math for pan delta calculation is taken from here

ashoat added inline comments.
native/components/full-screen-view-modal.react.js
1235–1270 ↗(On Diff #47080)

This approach makes sense, but I wonder how you will handle replacing panJustEnded. I guess you'll add something like this to panEnd?

if (panActive.value) {
  potentiallyGoBack();
  recenter();
  flingUpdate();
}
This revision is now accepted and ready to land.Feb 14 2025, 12:46 AM
native/components/full-screen-view-modal.react.js
1235–1270 ↗(On Diff #47080)

Yes, panEnd callback is the same as panJustEnded set to true. In the next diffs I add stuff there.

This revision was landed with ongoing or failed builds.Feb 25 2025, 2:48 AM
This revision was automatically updated to reflect the committed changes.