-
-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Android,Fabric): add FullWindowOverlay support for Android #2733
Draft
kkafar
wants to merge
27
commits into
main
Choose a base branch
from
@kkafar/implement-fullwindow-overlay-android
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Feb 24, 2025
Currently blocked by a layout bug when changing screen orientation on Android SDK 34. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR aims to add experimental support for
FullWindowOverlay
component on Android.Supersedes #2421, #2425 (shoutout to @maciekstosio & @mfazekas for the initial work & research)
State:
Description copied from the "docs" I've added for this component in this PR
FullWindowOverlay
Caution
Support of this component on Android is currently experimental and limited to new architecture.
In addition to navigation primitives described above ☝️, the library exposes
FullWindowOverlay
component. Its purpose is to enable displaying overlay above all other application contents.Example usage can be found in
TestFullWindowOverlay
example in our test app.Below we shortly describe current characteristics of the component.
Note
Description below should be treated as implementation details and not as stable behavior description, unless explicitly stated otherwise.
View hierarchy placement
On both platforms - iOS & Android the
FullWindowOverlay
component gives you opportunity to mount your views directly underUIWindow
&Window
respectively.This allows for presenting the content above all main application content.
When using
FullWindowOverlay
the views are mounted in a subtree separate from mainreact-native
subtree. This has some diverging behavior implications for each platform. Please see below the behavior description.Behavior aspects
Note
Description below should be treated as implementation details and not as stable behavior description, unless explicitly stated otherwise.
Dimensions
FullWindowOverlay
should have dimensions of full window. It does not take safe area insets into account - it is left to the user to handle.In Android applications that do not have edge-to-edge enabled (vast majority of applications targeting SDK 34 or lower) the status & navigation bars are expected.
Gestures
By design, the
FullWindowOverlay
component blocks gesture interaction with content underneath.The gestures for views in
FullWindowOverlay
's subtree are fully supported.Interaction with modal components
In this section we describe briefly how the
FullWindowOverlay
component behaves when used simultaneously with different modal components.Due to platform differences the behavior is slightly different depending whether it is used on iOS or Android devices.
iOS
On iOS the
FullWindowOverlay
stays above navigation screens with modal presentation. The same applies for e.g.Modal
fromreact-native
. We do not guarantee thatthis will be the case for any third-party modal component, since it depends on its internal implementation.
Android
On Android we use
TYPE_APPLICATION_ATTACHED_DIALOG
to mountthe component directly under the window. Together with
react-native
'sModal
implementation details this implies thatModal
will be displayed above theFullWindowOverlay
if displayed from already mounted
FullWindowOverlay
- and vice versa -FullWindowOverlay
will be displayed above theModal
if displayed from already mountedModal
.To make
FullWindowOverlay
display always on top of everything on Android is technically possible, however requires explicit permission from the application user. At the moment we decidedto avoid this and settled on "weaker" implementation. Please note that we might add this option some time in the future (in a non-breaking way).
and back to PR description...
Changes
Test code and steps to reproduce
Test1096
,TestFullWindowOverlay
Checklist