Skip to content

Commit

Permalink
example: add button to show splash screen again
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Jan 13, 2021
1 parent 601a293 commit 07be457
Showing 1 changed file with 37 additions and 22 deletions.
59 changes: 37 additions & 22 deletions examples/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Text,
TouchableOpacity,
Linking,
Button,
} from 'react-native'
import SplashScreen from 'react-native-splash-screen'

Expand All @@ -26,30 +27,37 @@ export default class example extends Component {
SplashScreen.hide();
}


render() {
return (
<TouchableOpacity
style={styles.container}
onPress={(e)=> {
Linking.openURL('https://coding.imooc.com/class/304.html');
}}
>
<View >
<Text style={styles.item}>
SplashScreen 启动屏
</Text>
<Text style={styles.item}>
@:http://www.devio.org/
</Text>
<Text style={styles.item}>
GitHub:https://github.com/crazycodeboy
</Text>
<Text style={styles.item}>
Email:[email protected]
</Text>
<View style={styles.container}>
<TouchableOpacity
onPress={(e)=> {
Linking.openURL('https://coding.imooc.com/class/304.html');
}}
>
<View >
<Text style={styles.item}>
SplashScreen 启动屏
</Text>
<Text style={styles.item}>
@:http://www.devio.org/
</Text>
<Text style={styles.item}>
GitHub:https://github.com/crazycodeboy
</Text>
<Text style={styles.item}>
Email:[email protected]
</Text>
</View>
</TouchableOpacity>
<View style={styles.showSplashButtonView}>
<Button
title={"Show splash screen again"}
testID={"ShowSplashScreenButton"}
onPress={()=> {SplashScreen.show(); setTimeout(()=> SplashScreen.hide(), 3000)}}
/>
</View>
</TouchableOpacity>
</View>
)
}

Expand All @@ -59,7 +67,10 @@ const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f3f2f2',
marginTop: 30
paddingTop: 30,
paddingBottom: 30,
paddingLeft: 30,
paddingRight: 30,
},
item: {
fontSize: 20,
Expand All @@ -69,4 +80,8 @@ const styles = StyleSheet.create({
height: 0.3,
backgroundColor: 'darkgray',
},
showSplashButtonView: {
marginTop:30,
alignSelf: 'baseline',
}
})

0 comments on commit 07be457

Please sign in to comment.