react-native-navigation-bar-color-fix-behavior-status-bar
Version:
React Native component to change bottom bar/navigation bar color on Android
31 lines (27 loc) • 736 B
JavaScript
import {NativeModules, Platform} from 'react-native';
const {NavigationBarColor} = NativeModules;
const changeNavigationBarColor = (
color = String,
light = false,
animated = true,
) => {
if (Platform.OS === 'android') {
const LightNav = light ? true : false;
NavigationBarColor.changeNavigationBarColor(color, LightNav, animated);
}
};
const hideNavigationBar = () => {
if (Platform.OS === 'android') {
return NavigationBarColor.hideNavigationBar();
} else {
return false;
}
};
const showNavigationBar = () => {
if (Platform.OS === 'android') {
NavigationBarColor.showNavigationBar();
} else {
return false;
}
};
export {changeNavigationBarColor, hideNavigationBar, showNavigationBar};