https://github.com/cwbudde/cordova-plugin-android-window-tools
This Plugin contains code to access certain window properties (sizes, insets, etc.)
https://github.com/cwbudde/cordova-plugin-android-window-tools
cordova-android cordova-plugin navigation-bar notch statusbar
Last synced: 10 months ago
JSON representation
This Plugin contains code to access certain window properties (sizes, insets, etc.)
- Host: GitHub
- URL: https://github.com/cwbudde/cordova-plugin-android-window-tools
- Owner: CWBudde
- License: mit
- Created: 2020-06-18T12:38:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-14T00:49:30.000Z (almost 6 years ago)
- Last Synced: 2025-07-01T12:20:00.845Z (12 months ago)
- Topics: cordova-android, cordova-plugin, navigation-bar, notch, statusbar
- Language: Java
- Size: 43 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Android Window Tools for Cordova
================================
Plugin for Cordova 8.0+ to perform some basic window operations like setting certain flags or changing the statusbar color. Also getting various sizes and insets.
Released under MIT license; see LICENSE for details.
How does it work?
-----------------
A loose collection of various tools that perform simple tasks on the Android side.
Installation
------------
**Cordova**
`cordova plugin add cordova-plugin-android-window-tools`
Code example
------------
Here are some examples on how you can use this plugin
```js
AndroidWindowTools.getSoftwareKeys(successSoftKeysFunction, errorFunction);
AndroidWindowTools.getDisplayCutout(successFunction, errorFunction);
AndroidWindowTools.getRealSize(successRealSizeFunction, errorFunction);
// See https://developer.android.com/reference/android/view/Window#setNavigationBarColor(int)
AndroidWindowTools.setNavigationBarColor('#f00', successFunction, errorFunction);
// See https://developer.android.com/reference/android/view/Window#setStatusBarColor(int)
AndroidWindowTools.setStatusBarColor('#0f0', successFunction, errorFunction);
// See https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
AndroidWindowTools.setSystemUiVisibility(AndroidWindowTools.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | AndroidWindowTools.SYSTEM_UI_FLAG_LAYOUT_STABLE | AndroidWindowTools.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, successFunction, errorFunction);
// See https://developer.android.com/reference/android/view/WindowManager.LayoutParams
AndroidWindowTools.addWindowFlag(AndroidWindowTools.FLAG_FULLSCREEN, successFunction, errorFunction);
AndroidWindowTools.clearWindowFlag(AndroidWindowTools.FLAG_FORCE_NOT_FULLSCREEN, successFunction, errorFunction);
```