forked from sunlight3d/ReactNativeTutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d91e3fa
commit 241e285
Showing
78 changed files
with
13,429 additions
and
78 deletions.
There are no files selected for viewing
Binary file modified
BIN
+2 KB
(130%)
React Native tutorial-14-Nesting navigators with TabNavigator/code/.DS_Store
Binary file not shown.
Binary file modified
BIN
+4 KB
(170%)
React Native tutorial-14-Nesting navigators with TabNavigator/code/tutorialproject/.DS_Store
Binary file not shown.
152 changes: 92 additions & 60 deletions
152
...tutorial-14-Nesting navigators with TabNavigator/code/tutorialproject/.idea/workspace.xml
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 19 additions & 6 deletions
25
React Native tutorial-14-Nesting navigators with TabNavigator/code/tutorialproject/App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
import React from 'react'; | ||
import {Text, View } from 'react-native'; | ||
|
||
import { TabNavigator } from "react-navigation"; | ||
import FirstScreen from './tabs/FirstScreen' | ||
import SecondScreen from './tabs/SecondScreen' | ||
import {TabNavigator} from "react-navigation"; | ||
|
||
|
||
var MainScreenNavigator = TabNavigator({ | ||
Tab1: {screen: FirstScreen}, | ||
Tab2: {screen: SecondScreen} | ||
}); | ||
}, { | ||
tabBarPosition: 'bottom', | ||
swipeEnabled: true, | ||
tabBarOptions: { | ||
activeTintColor: 'white', | ||
activeBackgroundColor: 'darkgreen', | ||
inactiveTintColor: 'black', | ||
inactiveBackgroundColor: 'green', | ||
labelStyle: { | ||
fontSize: 16, | ||
padding:0 | ||
} | ||
} | ||
} | ||
); | ||
|
||
MainScreenNavigator.navigationOptions = { | ||
title: 'My Chats', | ||
title: "Tab example" | ||
}; | ||
|
||
export default MainScreenNavigator; // Export your root navigator as the root component | ||
|
||
|
||
export default MainScreenNavigator; |
Binary file added
BIN
+582 Bytes
...-Nesting navigators with TabNavigator/code/tutorialproject/images/icon-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+735 Bytes
...ting navigators with TabNavigator/code/tutorialproject/images/icon-shopping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 23 additions & 7 deletions
30
...tutorial-14-Nesting navigators with TabNavigator/code/tutorialproject/tabs/FirstScreen.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
/** | ||
* Created by hoangnd on 6/27/17. | ||
* Created by hoangnd on 7/4/17. | ||
*/ | ||
|
||
import React from 'react'; | ||
import {Text, View, Button} from 'react-native'; | ||
const util = require('util'); | ||
import {Text, View, Button, Image} from 'react-native'; | ||
|
||
export default class FirstScreen extends React.Component { | ||
static navigationOptions = { | ||
tabBarLabel: 'Home', | ||
tabBarIcon: ({tintColor}) => ( | ||
<Image | ||
source={require('../images/icon-home.png')} | ||
style={{width: 22, height: 22, tintColor: 'white'}}> | ||
</Image> | ||
) | ||
} | ||
render() { | ||
return <Text>List of recent chats</Text> | ||
return <View style={ | ||
{ | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
} | ||
}> | ||
<Text style={{fontSize: 30}}> | ||
This is tab 1 | ||
</Text> | ||
</View> | ||
} | ||
} | ||
|
||
} |
29 changes: 24 additions & 5 deletions
29
...utorial-14-Nesting navigators with TabNavigator/code/tutorialproject/tabs/SecondScreen.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
/** | ||
* Created by hoangnd on 6/27/17. | ||
* Created by hoangnd on 7/4/17. | ||
*/ | ||
import React from 'react'; | ||
import {Text, View, Button} from 'react-native'; | ||
const util = require('util'); | ||
import {Text, View, Button, Image} from 'react-native'; | ||
|
||
export default class SecondScreen extends React.Component { | ||
static navigationOptions = { | ||
tabBarLabel: 'Shopping', | ||
tabBarIcon: ({tintColor}) => ( | ||
<Image | ||
source={require('../images/icon-shopping.png')} | ||
style={{width: 22, height: 22, tintColor: 'white'}}> | ||
</Image> | ||
) | ||
} | ||
|
||
render() { | ||
return <Text>List of recent chats</Text> | ||
return <View style={ | ||
{ | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
} | ||
}> | ||
<Text style={{fontSize: 30}}> | ||
This is tab 2 | ||
</Text> | ||
</View> | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
React Native tutorial-2-Create a hello world app on Windows/.idea/jsLibraryMappings.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
React Native tutorial-2-Create a hello world app on Windows/.idea/misc.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
React Native tutorial-2-Create a hello world app on Windows/.idea/modules.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
190 changes: 190 additions & 0 deletions
190
React Native tutorial-2-Create a hello world app on Windows/.idea/workspace.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+6 KB
React Native tutorial-2-Create a hello world app on Windows/code/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions
8
React Native tutorial-2-Create a hello world app on Windows/code/TutorialProject/.babelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"presets": ["babel-preset-expo"], | ||
"env": { | ||
"development": { | ||
"plugins": ["transform-react-jsx-source"] | ||
} | ||
} | ||
} |
Oops, something went wrong.