1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Mobile: Fixes #9142: Detect faster left-right swipes to open the sidemenu (#9802)

This commit is contained in:
Henry Heino 2024-02-02 09:49:23 -08:00 committed by GitHub
parent e71ec2bc49
commit a133bb06a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1071,11 +1071,20 @@ class AppComponent extends React.Component {
logger.info('root.biometrics: shouldShowMainContent', shouldShowMainContent);
logger.info('root.biometrics: this.state.sensorInfo', this.state.sensorInfo);
// The right sidemenu can be difficult to close due to a bug in the sidemenu
// library (right sidemenus can't be swiped closed).
//
// Additionally, it can interfere with scrolling in the note viewer, so we use
// a smaller edge hit width.
const menuEdgeHitWidth = menuPosition === 'right' ? 20 : 30;
const mainContent = (
<View style={{ flex: 1, backgroundColor: theme.backgroundColor }}>
<SideMenu
menu={sideMenuContent}
edgeHitWidth={20}
edgeHitWidth={menuEdgeHitWidth}
toleranceX={4}
toleranceY={20}
openMenuOffset={this.state.sideMenuWidth}
menuPosition={menuPosition}
onChange={(isOpen: boolean) => this.sideMenu_change(isOpen)}