react-native-safe-area-context
react-native-safe-area-context copied to clipboard
Support "immersive" mode
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?
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
If someone wants to open a PR to add support I will gladly review it :)
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!
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?
@Paduado I can't figure it out. Where do you add the WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS flag?
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
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.
when using immersive mode on android SafeAreaView
should apply bottom
padding|margin
accordingly. ( same behavior as IOS. ).