react-native-extra-dimensions-android
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -7,3 +7,9 @@ const React = require('react'); | ||
get(dim) { | ||
return NativeModules.ExtraDimensions[dim]; | ||
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); | ||
} | ||
@@ -10,0 +16,0 @@ }; |
{ | ||
"name": "react-native-extra-dimensions-android", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"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", |
@@ -36,5 +36,5 @@ | ||
3. You may have to register the module (in android/app/src/main/java/com/YOUR-PROJECT-NAME/MainApplication.java) | ||
2b. You may have to register the module (in android/app/src/main/java/com/YOUR-PROJECT-NAME/MainApplication.java) | ||
`react-native link` should automatically do the following for you. If it doesn't, you might have to add it yourself. | ||
``` | ||
@@ -54,3 +54,6 @@ import ca.jaysoo.extradimensions.ExtraDimensionsPackage; // <--- import | ||
``` | ||
3. As this is a package with Java, you'll need to rebuild the project. | ||
e.g. `react-native run-android` | ||
4. Whenever you want to use it within React Native code now you can: | ||
@@ -57,0 +60,0 @@ |
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
1237384
273
21
80
1