Example of tab navigator customization.
alex-melnyk / tabber Goto Github PK
View Code? Open in Web Editor NEW[OLD] Example of using react-native-multibar
[OLD] Example of using react-native-multibar
Example of tab navigator customization.
Hi Alex
I tested your project with "react-navigation": "^2.5.5" and It has error.
First of all, THANKS for an amazing example!
Can you assist me in making a draggable tab? So that on dragging to certain x,y it opens another screen?
I'm trying to use react-native-interactable
inside <AddButton />
screen (Medium post v1), but my button remains static.
Here is the code of <AddButton />
page:
import React, { Component } from "react";
import { Animated, TouchableHighlight, View, StyleSheet } from "react-native";
import Interactable from "react-native-interactable";
class AddButton extends Component {
render() {
return (
<Animated.View style={styles.container}>
<Interactable.View
snapPoints={[{ x: 0, y: 72 }, { x: 0, y: 250 }]}
initialPosition={{ x: 0, y: 250 }}
>
<Animated.View
style={{
position: "absolute",
width: 96,
height: 96,
backgroundColor: "#EE2C38",
borderRadius: 48
}}
/>
</Interactable.View>
</Animated.View>
);
}
}
const styles = StyleSheet.create({
container: {
position: "absolute",
alignItems: "center",
backgroundColor: "red",
width: 96,
height: 96,
borderRadius: 48
}
});
export { AddButton };
ViewOverflow problem android
Error: Native component for "RNViewOverflow" does not exist
I have set up this tweaked it a bit to get it to work with my app, yet its not rendering completely correct as shown in some of the previous examples. I have my attached code and screenshot.
const {height, width} = Dimensions.get("window");
const AuthStack = FluidNavigator({
Login: { screen: Login },
Register: { screen: Register }
const PredictiveStack = FluidNavigator({
Matrix: { screen: PredictiveMatrix}
})
const BottomTab = createBottomTabNavigator({
Home: {
screen: Home,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<IconButton
icon="home"
color={tintColor}
size={24}
/>
)
})
},
Chat: {
screen: Chat,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<IconButton
icon="chat"
color={tintColor}
size={24}
/>
)
})
},
MultiBar: {
screen: () => Chat,
navigationOptions: ({ navigation }) => ({
tabBarIcon: () => (
<MultiBarToggle
toggleColor='#893168'
navigation={navigation}
actionSize={30}
routes={[
{
routeName: 'PredictiveStack',
color: '#FF8360',
icon: (
<IconButton
icon="home"
color="#333333"
size={15}
/>
)
},
{
routeName: 'Chat',
color: '#E8E288',
icon: (
<IconButton
icon="chat"
color="#333333"
size={15}
/>
)
},
{
routeName: 'ProfileStack',
color: '#7DCE82',
icon: (
<IconButton
icon="person"
color="#333333"
size={15}
/>
)
},
]}
icon={(
<IconButton
icon={require('./assets/icons/baseline_keyboard_voice_white_48dp.png')}
color="#FFFFFF"
size={60}
/>
)}
/>
)
}),
params: {
navigationDisabled: true
}
},
Photo: {
screen: Photo,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<IconButton
icon="room"
color={tintColor}
size={24}
/>
)
})
},
Profile: {
screen: ProfileStack,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<IconButton
icon="redeem"
color={tintColor}
size={24}
/>
)
})
}
}, {
tabBarComponent: MultiBar,
tabBarOptions: {
adaptive: true,
showLabel: false,
inactiveTintColor: '#e4e2e9',
activeTintColor: '#FFFFFF',
style:{
backgroundColor: '#310E31'
}
}
});
const styles = MediaQueryStyleSheet.create({
// was trying to fix it with this but it doesn't work
style: {
height: hp('8%'),
width: wp('100%'),
backgroundColor: '#310E31'
}
},
//Media Queries styles:
{
"@media (max-device-height: 1920)": {
style: {
height: hp('8%'),
width: wp('100%'),
backgroundColor: '#310E31'
}
},
"@media (max-device-height: 2800)": {
style: {
height: hp('10%'),
width: wp('100%'),
backgroundColor: '#310E31'
}
}
}
);
const Nav = createAppContainer(FluidNavigator(
{
AuthLoading: AuthLoading,
App: BottomTab,
Auth: AuthStack
},
{
initialRouteName: 'AuthLoading'
}
));
class Navigation extends Component {
render() {
return (
<Nav/>
);
}
}
export default Navigation;`
Great repo. Loved the article on Medium. Question - can't seem to find where you state the three icons above the "Plus" button. I am getting simple circles (which I can change the color of!). Any help appreciated. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.