Skip to content
Snippets Groups Projects
Commit b110309e authored by karoljd's avatar karoljd
Browse files

Created SplashScreen, WelcomeScreen

parent 01210277
No related branches found
No related tags found
No related merge requests found
Pipeline #72875 failed
import React, {Component} from 'react';
import {
Platform,
StyleSheet,
View,
Text,
Image,
TouchableOpacity,
Alert,
} from 'react-native';
export default class SplashScreen extends Component<{}> {
constructor() {
super();
this.state = {
isVisible: true,
};
}
Hide_Splash_Screen = () => {
this.setState({
isVisible: false,
});
};
componentDidMount() {
var that = this;
setTimeout(function() {
that.Hide_Splash_Screen();
}, 5000);
}
render() {
let Splash_Screen = (
<View style={styles.SplashScreen_RootView}>
<View style={styles.SplashScreen_ChildView}>
<Image
source={require('D:\\BachelorOppgave\\FastTrackTaxi_ReactNative\\AppIcons\\fast_track_taxi_logo_ferdig.png')}
style={{width: '100%', height: '100%', resizeMode: 'contain'}}
/>
</View>
</View>
);
return (
<View style={styles.MainContainer}>
<Text style={{textAlign: 'center'}}>
Skulle komme til Velkommen sida, men fortsatt vet ikke hvordan :(
</Text>
{this.state.isVisible === true ? Splash_Screen : null}
</View>
);
}
}
const styles = StyleSheet.create({
MainContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingTop: Platform.OS === 'ios' ? 20 : 0,
},
SplashScreen_RootView: {
justifyContent: 'center',
flex: 1,
margin: 10,
position: 'absolute',
width: '100%',
height: '100%',
},
SplashScreen_ChildView: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#00BCD4',
flex: 1,
},
});
......@@ -4,6 +4,7 @@ import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment