react-native-navigation-mode 1.2.0 → 1.2.1

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.
@@ -30,7 +30,7 @@ class NavigationModeModule(reactContext: ReactApplicationContext) :
30
30
  if (activity != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
31
31
  val insets = activity.window.decorView.rootWindowInsets
32
32
  if (insets != null) {
33
- val navBar = insets.getInsets(WindowInsets.Type.navigationBars())
33
+ val navBar = insets.getInsets(WindowInsets.Type.navigationBars()) ?: return 0
34
34
  return (navBar.bottom / density).toInt() // Convert pixels to dp
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation-mode",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Detect Android navigation mode (3-button, 2-button, or gesture)",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",