Implemet splash screen
This commit is contained in:
6
App.tsx
6
App.tsx
@@ -11,8 +11,14 @@ import {
|
|||||||
SafeAreaProvider,
|
SafeAreaProvider,
|
||||||
useSafeAreaInsets,
|
useSafeAreaInsets,
|
||||||
} from 'react-native-safe-area-context';
|
} from 'react-native-safe-area-context';
|
||||||
|
import RNBootSplash from 'react-native-bootsplash';
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
RNBootSplash.hide({ fade: true });
|
||||||
|
}, []);
|
||||||
const isDarkMode = useColorScheme() === 'dark';
|
const isDarkMode = useColorScheme() === 'dark';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
@@ -17,7 +16,8 @@
|
|||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:windowSoftInputMode="adjustResize"
|
android:windowSoftInputMode="adjustResize"
|
||||||
android:exported="true">
|
android:exported="true"
|
||||||
|
android:theme="@style/BootTheme">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
|||||||
3
android/app/src/main/res/values/colors.xml
Normal file
3
android/app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<color name="bootsplash_background">#ffffff</color>
|
||||||
|
</resources>
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="BootTheme" parent="Theme.BootSplash">
|
||||||
|
<item name="bootSplashBackground">@color/bootsplash_background</item>
|
||||||
|
<item name="bootSplashLogo">@drawable/bootsplash_logo</item>
|
||||||
|
<item name="postBootSplashTheme">@style/AppTheme</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
BIN
logo-removebg-preview.png
Normal file
BIN
logo-removebg-preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 128 KiB |
@@ -10,9 +10,10 @@
|
|||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@react-native/new-app-screen": "0.83.1",
|
||||||
"react": "19.2.0",
|
"react": "19.2.0",
|
||||||
"react-native": "0.83.1",
|
"react-native": "0.83.1",
|
||||||
"@react-native/new-app-screen": "0.83.1",
|
"react-native-bootsplash": "^7.0.2",
|
||||||
"react-native-safe-area-context": "^5.5.2"
|
"react-native-safe-area-context": "^5.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
BIN
splash.png
Normal file
BIN
splash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 259 KiB |
Reference in New Issue
Block a user