MCPcopy Create free account
hub / github.com/Sunhat/react-native-extra-dimensions-android / get

Function get

index.js:3–23  ·  view source on GitHub ↗
(dim)

Source from the content-addressed store, hash-verified

1import { NativeModules, Platform } from 'react-native';
2
3export function get(dim) {
4 if (Platform.OS !== 'android') {
5
6 console.warn('react-native-extra-dimensions-android is only available on Android. Trying to access', dim);
7 return 0;
8 } else { // android
9 try {
10 if (!NativeModules.ExtraDimensions) {
11 throw "ExtraDimensions not defined. Try rebuilding your project. e.g. react-native run-android";
12 }
13 const result = NativeModules.ExtraDimensions[dim];
14
15 if (typeof result !== 'number') {
16 return result;
17 }
18 return result;
19 } catch (e) {
20 console.error(e);
21 }
22 }
23}
24
25export function getRealWindowHeight() {
26 return get('REAL_WINDOW_HEIGHT');

Callers 6

getRealWindowHeightFunction · 0.85
getRealWindowWidthFunction · 0.85
getStatusBarHeightFunction · 0.85
getSoftMenuBarHeightFunction · 0.85
getSmartBarHeightFunction · 0.85
isSoftMenuBarEnabledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected