Mobile: Fixes #11276: Fix new note button is pushed offscreen on certain Android devices #11323
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request fixes a regression — on certain Android devices, the "+" button for creating new notes was pushed partially or completely offscreen. This seems to have been introduced in Joplin v3.0.1 by #10123.
Fixes #11276.
Fixes #11315.
Note
Currently, this pull request targets
release-3.1
.Details
React Native Paper's
<FAB.Group>
renders an invisible<View>
that covers most/all of Joplin's UI. This view is present even when theFAB.Group
is collapsed.To allow users to continue to interact with the application while the view is visible,
react-native-paper
usespointerEvents={'box-none'}
when the FAB.Group is collapsed. Unfortunately, this breaks TalkBack on Android's "tap to navigate" feature, which significantly impacts users that rely on TalkBack to use the app.Starting from Joplin v3.0.1, the
<View>
added by React Native is made smaller by adding margins above and to the left. These margins are determined by the screen size and an offset. Even with this solution, a small portion of the screen still blocks TalkBack's tap-to-navigate. As reported in #11276, this workaround also pushed the new note/new to-do buttons offscren.This commit changes how the FAB.Group's invisible
<View>
is resized. Previously it was done with margins. Now, it's done with the top/left absolute positioning properties.Note: If this upstream pull request is merged, it should be possible to remove the workaround entirely.
Screen recording
Testing plan
TalkBack regression testing
Android 13:
out.webm
Note: Observe that the "New note" and "New to-do" buttons can be focused by TalkBack even when the menu is collapsed. See this upstream pull request for a possible fix.
Verifying that the new note button isn't pushed offscreen
Android 14 emulator in 3-button navigation mode:
Note
On the Android 14 emulator, before this PR, the "+" button was not completely pushed offscreen (about 3/4ths of the button visible).