Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-native-navigation-bar-color
Advanced tools
React Native component to change bottom bar/navigation bar color on Android
React Native Navigation Bar Color Change is a React Native library for change color of navigation/Bottom bar on Android.
$ npm install react-native-navigation-bar-color --save
$ react-native link react-native-navigation-bar-color
android/app/src/main/java/[...]/MainApplication.java
import com.thebylito.navigationbarcolor.NavigationBarColorPackage;
to the imports at the top of the filenew NavigationBarColorPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
project(':react-native-navigation-bar-color').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation-bar-color/android')
android/app/build.gradle
:
compile project(':react-native-navigation-bar-color')
Android Implementation
import React, { Component } from 'react';
import { View, Text, Button } from 'react-native';
import changeNavigationBarColor, {
HideNavigationBar,
ShowNavigationBar,
} from 'react-native-navigation-bar-color';
export default class Mynewapp extends Component {
setNavigationColor = (color) => {
changeNavigationBarColor(color);
};
hideNavigation = () => {
HideNavigationBar();
};
showNavigation = () => {
ShowNavigationBar();
};
render() {
return (
<View
style={{
flex: 1,
justifyContent: 'space-around',
alignContent: 'center',
alignItems: 'center',
}}
>
<Button
title="Set color red"
onPress={() => {
this.setNavigationColor('red');
}}
/>
<Button
title="Set color blue"
onPress={() => {
this.setNavigationColor('blue');
}}
/>
<Button
title="Hide bar"
onPress={() => {
this.hideNavigation();
}}
/>
<Button
title="Show bar"
onPress={() => {
this.showNavigation();
}}
/>
<Text>Hello Word!</Text>
</View>
);
}
}
changeNavigationBarColor(color, Boolean(light icon color) )
: (Android)Change color of Navigation/Bottom bar. color can be a HEX color, or name. ex: green, blue, #80b3ff, #ffffff....
Light is true? icon color may be White. False? May be a Black or Gray.
Promise
example = async () => {
try{
const response = await changeNavigationBarColor('#80b3ff');
console.log(response)// {success: true}
}catch(e){
console.log(e)// {success: false}
}
};
##OR
example = async () => {
try{
const response = await changeNavigationBarColor('#80b3ff', true);
console.log(response)// {success: true}
}catch(e){
console.log(e)// {success: false}
}
};
HideNavigationBar()
: (Android)Hide Navigation Bar
import { HideNavigationBar } from 'react-native-navigation-bar-color';
...
hide = () => {
HideNavigationBar();
};
ShowNavigationBar()
: (Android)Show Navigation Bar
import { ShowNavigationBar } from 'react-native-navigation-bar-color';
...
show = () => {
ShowNavigationBar();
};
MIT
FAQs
React Native component to change bottom bar/navigation bar color on Android
The npm package react-native-navigation-bar-color receives a total of 11,025 weekly downloads. As such, react-native-navigation-bar-color popularity was classified as popular.
We found that react-native-navigation-bar-color demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.