Skip to content
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

Support "immersive" mode #63

Open
AdamGerthel opened this issue Mar 14, 2020 · 8 comments
Open

Support "immersive" mode #63

AdamGerthel opened this issue Mar 14, 2020 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed Platform: Android

Comments

@AdamGerthel
Copy link

I'm using react-native-safe-area-context in combination with react-native-android-immersive-mode but the bottom inset value seems to still include the navigation bar height even though it's not there (see official Android docs on "immersive" mode).

Are there plans to support that?

@crutchcorn
Copy link

If you apply the flag LAYOUT_FLAG_NO_LIMITS on top of the other flags it applies, it should no longer read the navbar height, as it moves outside of what the Insets API can read from:

https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_NO_LIMITS

@janicduplessis
Copy link
Member

If someone wants to open a PR to add support I will gladly review it :)

@janicduplessis janicduplessis added the enhancement New feature or request label May 26, 2020
@Paduado
Copy link

Paduado commented Jun 4, 2020

If you apply the flag LAYOUT_FLAG_NO_LIMITS on top of the other flags it applies, it should no longer read the navbar height, as it moves outside of what the Insets API can read from:

https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_NO_LIMITS

You saved me, thanks!

@michaelknoch
Copy link

I do not understand the solution from @crutchcorn . Is this fixing the insets when using immersive mode? Where do I have to set the flag?

@niklavsBariss
Copy link

@Paduado I can't figure it out. Where do you add the WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS flag?

@crutchcorn
Copy link

I wrote an article explaining exactly how to do this:

https://unicorn-utterances.com/posts/draw-under-navbar-using-react-native#The-Right-Way

And also a NPM package to handle all of the weird SDK issues that might arise in trying to do this:

https://github.com/oceanbit/react-native-immersive-bars

@niklavsBariss
Copy link

niklavsBariss commented Apr 28, 2022

I wrote an article explaining exactly how to do this:

https://unicorn-utterances.com/posts/draw-under-navbar-using-react-native#The-Right-Way

Thank you, but that doesn't seem to be what I am looking for - actually using immersive mode and expecting the inset.bottom (when portrait) to reduce by nav bar height.

@a-eid
Copy link

a-eid commented May 6, 2022

when using immersive mode on android SafeAreaView should apply bottom padding|margin accordingly. ( same behavior as IOS. ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed Platform: Android
Projects
None yet
Development

No branches or pull requests

8 participants