Status bar for React Native Android
A react native android module to control the android statusbar.
Setup
There are five steps in the setup process
- install module
- update
android/settings.gradle
- update
android/app/build.gradle
- Register module in MainActivity.java
- Rebuild and restart package manager
- install module
npm i --save react-native-android-statusbar
android/settings.gradle
...include ':react-native-android-statusbar'project(':react-native-android-statusbar').projectDir = new File(settingsDir, '../node_modules/react-native-android-statusbar')
android/app/build.gradle
...dependencies { ... compile project(':react-native-android-statusbar')}
- register module on React Native >= 0.19 (in MainActivity.java)
// <--- import
- register module on React Native < 0.19 (in MainActivity.java)
// <--- import
- Run
react-native run-android
from your project root directory
Usage
var StatusBarAndroid = ; /* The following functions do not reflect on versions before 16 */StatusBarAndroidStatusBarAndroid /* The following functions do not reflect on versions before 21 */StatusBarAndroid;StatusBarAndroid;StatusBarAndroid; /*Supported formats are: #RRGGBB #AARRGGBB or :'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow','lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua','fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'.*/