{"id":15319140,"url":"https://github.com/zoontek/react-native-extra-dimensions-android","last_synced_at":"2025-10-09T05:30:37.202Z","repository":{"id":60106772,"uuid":"291757186","full_name":"zoontek/react-native-extra-dimensions-android","owner":"zoontek","description":"Access additional display metrics on Android devices: status bar height, soft menu bar height, real screen size.","archived":false,"fork":true,"pushed_at":"2020-08-31T17:08:59.000Z","size":459,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-02T09:03:54.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Sunhat/react-native-extra-dimensions-android","license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoontek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-31T15:45:14.000Z","updated_at":"2022-09-25T05:53:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zoontek/react-native-extra-dimensions-android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoontek%2Freact-native-extra-dimensions-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoontek%2Freact-native-extra-dimensions-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoontek%2Freact-native-extra-dimensions-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoontek%2Freact-native-extra-dimensions-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoontek","download_url":"https://codeload.github.com/zoontek/react-native-extra-dimensions-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235791916,"owners_count":19045577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T09:03:54.177Z","updated_at":"2025-10-09T05:30:31.894Z","avatar_url":"https://github.com/zoontek.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Notice\n\nPull requests always welcome!\n\n## ExtraDimensions\n\nThis module allows you to access additional display metrics on Android devices. (RN 0.57.0+)\n\n- Actual width and height of the screen (including elements such as soft menu bar)\n- Soft menu height\n- Status bar height\n- Smart bar height (MeiZu)\n\n### Why?\n\nThere is currently a bug in React Native where [`Dimensions.get('window').height` sometimes returns\nthe wrong value](https://github.com/facebook/react-native/issues/4934).\n\nAlso, some apps may want to set the background of status bar and soft menu bar to transparent, thus the top-level\nview needs to fill up the real screen size.\n\n### Installation\n\n1. Install with npm\n   ```\n   npm install react-native-extra-dimensions-android --save\n   ```\n2. linking\n\n   ```\n   react-native link react-native-extra-dimensions-android\n   ```\n\n2b. You may have to register the module (in android/app/src/main/java/com/YOUR-PROJECT-NAME/MainApplication.java)\n`react-native link` should automatically do the following for you. If it doesn't, you might have to add it yourself.\n\n    ```\n    import ca.jaysoo.extradimensions.ExtraDimensionsPackage;  // \u003c--- import\n\n    public class MainApplication extends Application implements ReactApplication {\n      ......\n      protected List\u003cReactPackage\u003e getPackages() {\n        return Arrays.\u003cReactPackage\u003easList(\n          new MainReactPackage(),\n          new ExtraDimensionsPackage()  // \u003c--- add here\n        );\n      }\n      ......\n    }\n    ```\n\n3. As this is a package with Java, you'll need to rebuild the project.\n\ne.g. `react-native run-android`\n\n4. Whenever you want to use it within React Native code now you can:\n\n`var ExtraDimensions = require('react-native-extra-dimensions-android');`\n\nOr, if you are using ES6\n\n`import ExtraDimensions from 'react-native-extra-dimensions-android';`\n\n### Demo\n\n![](./screenshot.png)\n\n### API\n\n`ExtraDimensions.get(dimension: string)` that takes in a dimension name, and returns its value as a `number`.\n\nSupported dimensions are:\n\n- `REAL_WINDOW_HEIGHT` - Actual height of screen including system decor elements\n- `REAL_WINDOW_WIDTH` - Actual width of screen including system decor elements\n- `STATUS_BAR_HEIGHT` - Height of the status bar\n- `SOFT_MENU_BAR_HEIGHT` - Height of the soft menu bar (supported on most new Android devices)\n- `SMART_BAR_HEIGHT` - Height of the MeiZu's device smart bar\n\nAlternatively, there are methods for each constant, to fulfill autocomplete in your IDE\n\n`ExtraDimensions.getRealWindowHeight()`\n\n`ExtraDimensions.getRealWindowWidth()`\n\n`ExtraDimensions.getStatusBarHeight()`\n\n`ExtraDimensions.getSoftMenuBarHeight()`\n\n`ExtraDimensions.getSmartBarHeight()`\n\n`ExtraDimensions.isSoftMenuBarEnabled()`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoontek%2Freact-native-extra-dimensions-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoontek%2Freact-native-extra-dimensions-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoontek%2Freact-native-extra-dimensions-android/lists"}