react-native-unistyles 2.7.1 → 2.7.2-rc.1

Sign up to get free protection for your applications and to get access to all the features.
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
  ![GitHub package.json version](https://img.shields.io/github/package-json/v/jpudysz/react-native-unistyles?style=for-the-badge)
4
6
  [![npm downloads](https://img.shields.io/npm/dm/react-native-unistyles?style=for-the-badge)](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 ((hasFullScreenMode(window) && translucentNavigation) || translucentNavigation) {
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 (hasTranslucentNavigation(window) || hasFullScreenMode(window)) baseInsets.bottom else 0
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
- return (window.attributes.flags and WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) == WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "2.7.1",
3
+ "version": "2.7.2-rc.1",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",