diff --git a/App.tsx b/App.tsx index 7245f4e..bbf3e93 100644 --- a/App.tsx +++ b/App.tsx @@ -1,51 +1,38 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - * - * @format - */ - -import { NewAppScreen } from '@react-native/new-app-screen'; -import { StatusBar, StyleSheet, useColorScheme, View } from 'react-native'; +import React, { useEffect, useState } from 'react'; import { - SafeAreaProvider, - useSafeAreaInsets, -} from 'react-native-safe-area-context'; -import RNBootSplash from 'react-native-bootsplash'; -import { useEffect } from 'react'; + StatusBar, + StyleSheet, + View, + useColorScheme, +} from 'react-native'; +import { SafeAreaProvider } from 'react-native-safe-area-context'; +import SplashScreen from './src/SplashScreen'; // create this file +import Home from './src/screen/Home'; // your main screen function App() { + const isDarkMode = useColorScheme() === 'dark'; + const [isLoading, setIsLoading] = useState(true); useEffect(() => { - RNBootSplash.hide({ fade: true }); + const timer = setTimeout(() => { + setIsLoading(false); + }, 2500); + + return () => clearTimeout(timer); }, []); - const isDarkMode = useColorScheme() === 'dark'; return ( - + {isLoading ? : } ); } -function AppContent() { - const safeAreaInsets = useSafeAreaInsets(); - - return ( - - - - ); -} +export default App; const styles = StyleSheet.create({ container: { flex: 1, }, }); - -export default App; diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d173978..3d8b16b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true" - android:theme="@style/BootTheme"> + android:theme="@style/AppTheme"> diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml deleted file mode 100644 index d4aaff4..0000000 --- a/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,3 +0,0 @@ - - #ffffff - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 4b89c01..5da5eae 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,12 +1,7 @@ + - diff --git a/src/SplashScreen.tsx b/src/SplashScreen.tsx new file mode 100644 index 0000000..7697aa8 --- /dev/null +++ b/src/SplashScreen.tsx @@ -0,0 +1,65 @@ +import React, { useEffect, useRef } from 'react'; +import { + View, + Text, + StyleSheet, + Animated, + ImageBackground, + StatusBar, +} from 'react-native'; + +const SplashScreen: React.FC = () => { + const fadeAnim = useRef(new Animated.Value(0)).current; + + useEffect(() => { + Animated.timing(fadeAnim, { + toValue: 1, + duration: 1200, + useNativeDriver: true, + }).start(); + }, []); + + return ( + <> +