react-native-unistyles 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
[<img alt="react-native-unistyles" src="assets/banner.png">](https://reactnativeunistyles.vercel.app/)
|
2
|
+
[<img alt="react-native-unistyles-3.0" src="assets/v3.jpg">](https://github.com/jpudysz/react-native-unistyles/discussions/191)
|
3
|
+
|
2
4
|
|
3
5
|

|
4
6
|
[](https://www.npmjs.com/package/react-native-unistyles)
|
@@ -87,18 +87,19 @@ class UnistylesInsets(private val reactApplicationContext: ReactApplicationConte
|
|
87
87
|
@Suppress("DEPRECATION")
|
88
88
|
private fun getBottomInset(baseInsets: Insets, window: Window): Int {
|
89
89
|
val translucentNavigation = hasTranslucentNavigation(window)
|
90
|
+
val fullScreenMode = hasFullScreenMode(window)
|
90
91
|
|
91
92
|
// Android 11 has inconsistent FLAG_LAYOUT_NO_LIMITS, which alone does nothing
|
92
93
|
// https://stackoverflow.com/questions/64153785/android-11-window-setdecorfitssystemwindow-doesnt-show-screen-behind-status-a
|
93
94
|
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
|
94
|
-
if ((
|
95
|
+
if ((fullScreenMode && translucentNavigation) || translucentNavigation) {
|
95
96
|
return baseInsets.bottom
|
96
97
|
}
|
97
98
|
|
98
99
|
return 0
|
99
100
|
}
|
100
101
|
|
101
|
-
return if (
|
102
|
+
return if (translucentNavigation || fullScreenMode) baseInsets.bottom else 0
|
102
103
|
}
|
103
104
|
|
104
105
|
private fun forceLandscapeInsets(baseInsets: Insets, window: Window): Boolean {
|
@@ -133,6 +134,8 @@ class UnistylesInsets(private val reactApplicationContext: ReactApplicationConte
|
|
133
134
|
}
|
134
135
|
|
135
136
|
private fun hasFullScreenMode(window: Window): Boolean {
|
136
|
-
|
137
|
+
val decorFitsSystemWindows = window.decorView.fitsSystemWindows
|
138
|
+
|
139
|
+
return (window.attributes.flags and WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) == WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS || !decorFitsSystemWindows
|
137
140
|
}
|
138
141
|
}
|