fix: gesture direction for left modal stack#37601
Conversation
|
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@youssef-lr may I kindly ask you to review this PR? 👀 |
|
On it. |
|
@kirillzyusko in Android emulator, how do I simulate a swipe? clicking and holding doesn't seem to work for me |
@youssef-lr By default gesture-based navigation is iOS specific feature. If we want to support it in Android then we need to open a new discussion (because from one side - it gives a cool feature, but from the other side - it will not be supported if we migrate to native stack navigators) 👀 |
|
Oh, so in the android native recording you're just pressing back and not actually swiping? |
| }, | ||
| leftModalNavigator: { | ||
| ...commonScreenOptions, | ||
| cardStyleInterpolator: (props) => modalCardStyleInterpolator(isSmallScreenWidth, false, props, SLIDE_LEFT_OUTPUT_RANGE_MULTIPLIER), |
There was a problem hiding this comment.
I'm curious what this does SLIDE_LEFT_OUTPUT_RANGE_MULTIPLIER, @kirillzyusko? And why did we remove it after changing the direction?
There was a problem hiding this comment.
@youssef-lr basically it was reverting the animation. And when we multiply extrapolated values (let's say we move screen from 0 to 336) by -1 - we change a direction of animation.
But in react-navigation this -1 multiplier is already handled if you specify gestureDirection.
So if I specify gestureDirection as horizontal-inverted - it'll automatically drive the animation from left to right, but since we multiplied it before by -1 we kind of getting double inversion which results in right-to-left (default) animation.
That's why I removed this - I delegated a control fully to react-navigation.
There was a problem hiding this comment.
Ahh makes sense, thanks for clarifying!
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: Nativeios.native.1.moviOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@youssef-lr Ah, you about my recording? Yes, I kind of dismiss it with swipe gesture, but it's a newly introduced feature (available in Android 13 and Android 14 by default) and backward compatible with previous "hardware back button" functionality. So this swipe is handled by OS (not by app) and when such swipe occurs it's simply simulate a press on hardware/emulated software back button (typically was prior to Android 10 in the bottom of the screen). |
youssef-lr
left a comment
There was a problem hiding this comment.
LGTM, thanks for working on this! Left one comment mainly because I'm curious :D
|
@kirillzyusko probably out of scope, any reason you can think of why the animation of the search page and workspace switched are not 60fps compared to the profile page? See my recording in the checklist |
This is a very good question 😅 I don't have the answer at the moment (need to perform a profiling to understand it better), but I'm currently working on replacing |
Awesome, can't wait! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 1.4.48-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.4.48-0 🚀
|
Details
Added right-to-left gesture for Search/Workspace screens.
Fixed Issues
$ #37354
PROPOSAL: N/A
Tests
Offline tests
Not needed
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
telegram-cloud-document-2-5406699501597507749.mp4
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-01.at.13.43.19.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop