Skip to content

Commit dabd35a

Browse files
added splash screen setup
1 parent da8a14a commit dabd35a

File tree

14 files changed

+505
-375
lines changed

14 files changed

+505
-375
lines changed

App.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Sample React Native App
33
* https://github.com/facebook/react-native
44
* https://dribbble.com/shots/5726952-Bingo-App-UI-Kit/attachments/11021810?mode=media
5-
* https://aboutreact.com/custom-navigation-drawer-sidebar-with-image-and-icon-in-menu-options/
65
* https://github.dev/itzpradip/react-navigation-v6-mix
76
* https://github.com/NyashaNziramasanga/react-native-horizontal-scroll-menu
87
* @format

README.md

+73
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Features:
44

5+
:white_check_mark: Splash Screen Image Upon Starting of Application
6+
57
:white_check_mark: Folder Architecture
68

79
:white_check_mark: Stack, Tab and Drawer Navigation
@@ -150,6 +152,77 @@ npm run-android
150152

151153
npm run ios
152154

155+
# For Splash Screen
156+
157+
- Convert your icons to different sizes using https://www.appicon.co/
158+
- replace this images with android/app/src/main/res images ( Folder name starts with **mipmap** )
159+
- Update Your App Name in android/app/src/main/res/values/string.xml
160+
- Create color.xml file and paste below in android/app/src/main/res/values
161+
162+
```
163+
<?xml version="1.0" encoding="utf-8"?>
164+
<resources>
165+
<!-- color for the app bar and other primary UI elements -->
166+
<color name="colorPrimary">#FFFFFF</color>
167+
<color name="colorPrimaryDark">#A52D53</color>
168+
<color name="splashscreen_background">#FFFFFF</color>
169+
<color name="colorAccent">#FFFFFF</color>
170+
</resources>
171+
172+
```
173+
174+
- Create background_splash.xml file and paste below in android/app/src/main/res/drawable
175+
176+
```
177+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
178+
<item android:drawable="@color/colorPrimary"/>
179+
<item>
180+
<bitmap
181+
android:gravity="center"
182+
android:src="@mipmap/ic_launcher"/>
183+
</item>
184+
</layer-list>
185+
186+
```
187+
188+
- Create splashscreen.xml file and paste below in android/app/src/main/res/drawable
189+
190+
```
191+
<?xml version="1.0" encoding="utf-8"?>
192+
193+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
194+
<item android:drawable="@color/splashscreen_background"/>
195+
<item>
196+
<bitmap
197+
android:gravity = "center"
198+
android:src="@mipmap/ic_launcher"/>
199+
</item>
200+
</layer-list>
201+
202+
```
203+
204+
- Import above in android/app/src/main/AndroidManifest.xml in activity
205+
206+
```
207+
<activity
208+
...
209+
android:theme="@style/SplashTheme"
210+
>
211+
```
212+
213+
- Add Below in android/app/src/main/res/values/styles.xml under resourses
214+
215+
```
216+
<resources>
217+
...
218+
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
219+
<!-- Customize your theme here. -->
220+
<item name="android:windowBackground">@drawable/splashscreen</item>
221+
<item name="android:windowDisablePreview">true</item>
222+
</style>
223+
</resources>
224+
```
225+
153226
# Light Mode
154227

155228
<img src="/screenshots/1.png" width="300px"></img>

android/app/src/main/AndroidManifest.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
1818
android:launchMode="singleTask"
1919
android:windowSoftInputMode="adjustResize"
20-
android:exported="true">
20+
android:exported="true"
21+
android:theme="@style/SplashTheme"
22+
>
2123
<intent-filter>
2224
<action android:name="android.intent.action.MAIN" />
2325
<category android:name="android.intent.category.LAUNCHER" />

android/app/src/main/assets/index.android.bundle

+397-372
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2+
<item android:drawable="@color/colorPrimary"/>
3+
<item>
4+
<bitmap
5+
android:gravity="center"
6+
android:src="@mipmap/ic_launcher"/>
7+
</item>
8+
</layer-list>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@color/splashscreen_background"/>
5+
<item>
6+
<bitmap
7+
android:gravity = "center"
8+
android:src="@mipmap/ic_launcher"/>
9+
</item>
10+
</layer-list>
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- color for the app bar and other primary UI elements -->
4+
<color name="colorPrimary">#FFFFFF</color>
5+
<color name="colorPrimaryDark">#A52D53</color>
6+
<color name="splashscreen_background">#FFFFFF</color>
7+
<color name="colorAccent">#FFFFFF</color>
8+
</resources>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">CareerWill</string>
2+
<string name="app_name">RNFeatures</string>
33
</resources>

android/app/src/main/res/values/styles.xml

+5
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
<!-- Customize your theme here. -->
66
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
77
</style>
8+
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
9+
<!-- Customize your theme here. -->
10+
<item name="android:windowBackground">@drawable/splashscreen</item>
11+
<item name="android:windowDisablePreview">true</item>
12+
</style>
813

914
</resources>

0 commit comments

Comments
 (0)