react-native-extra-dimensions-android
Advanced tools
Comparing version 1.1.1 to 1.1.2
13
index.js
@@ -8,14 +8,15 @@ const React = require('react'); | ||
try { | ||
if(!NativeModules.hasOwnProperty('ExtraDimensions')) { | ||
if(!NativeModules.ExtraDimensions) { | ||
throw "ExtraDimensions not defined. Try rebuilding your project. e.g. react-native run-android" | ||
} | ||
const result = NativeModules.ExtraDimensions[dim]; | ||
if(typeof result !== 'number') { | ||
return result; | ||
} | ||
// If rounding down is ODD, round up. If rounding down is EVEN, round down. | ||
return Math.floor(result) % 2 ? Math.ceil(result) : Math.floor(result); | ||
} catch (e) { | ||
console.error(e) | ||
} | ||
if(typeof result !== 'number') { | ||
return result; | ||
} | ||
// If rounding down is ODD, round up. If rounding down is EVEN, round down. | ||
return Math.floor(result) % 2 ? Math.ceil(result) : Math.floor(result); | ||
} | ||
@@ -22,0 +23,0 @@ }; |
{ | ||
"name": "react-native-extra-dimensions-android", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Access additional display metrics on Android devices: status bar height, soft menu bar height, real screen size.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1237622