Browse Source

Added android splash screen

Arnaud Vergnet 1 year ago
parent
commit
cb5fac940b

+ 2
- 0
App.js View File

@@ -17,6 +17,7 @@ import ConnectionManager from "./src/managers/ConnectionManager";
17 17
 import URLHandler from "./src/utils/URLHandler";
18 18
 import {setSafeBounceHeight} from "react-navigation-collapsible";
19 19
 import {enableScreens} from 'react-native-screens';
20
+import SplashScreen from 'react-native-splash-screen'
20 21
 
21 22
 // Native optimizations https://reactnavigation.org/docs/react-native-screens
22 23
 enableScreens(true);
@@ -175,6 +176,7 @@ export default class App extends React.Component<Props, State> {
175 176
             showUpdate: this.storageManager.preferences.updateNumber.current !== Update.number.toString(),
176 177
             showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && this.storageManager.preferences.showAprilFoolsStart.current === '1',
177 178
         });
179
+        SplashScreen.hide();
178 180
     }
179 181
 
180 182
     /**

+ 8
- 0
android/app/src/main/java/fr/amicaleinsat/application/MainActivity.java View File

@@ -1,5 +1,6 @@
1 1
 package fr.amicaleinsat.application;
2 2
 
3
+import android.os.Bundle;
3 4
 import com.facebook.react.ReactActivity;
4 5
 import com.facebook.react.ReactActivityDelegate;
5 6
 import com.facebook.react.ReactRootView;
@@ -7,6 +8,8 @@ import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
7 8
 import android.content.Intent;
8 9
 import android.content.res.Configuration;
9 10
 
11
+import org.devio.rn.splashscreen.SplashScreen;
12
+
10 13
 public class MainActivity extends ReactActivity {
11 14
 
12 15
     // Added automatically by Expo Config
@@ -18,6 +21,11 @@ public class MainActivity extends ReactActivity {
18 21
         sendBroadcast(intent);
19 22
     }
20 23
 
24
+   @Override
25
+    protected void onCreate(Bundle savedInstanceState) {
26
+        SplashScreen.show(this);
27
+        super.onCreate(savedInstanceState);
28
+    }
21 29
 
22 30
     /**
23 31
      * Returns the name of the main component registered from JavaScript.

+ 0
- 1
android/app/src/main/java/fr/amicaleinsat/application/generated/BasePackageList.java View File

@@ -21,7 +21,6 @@ public class BasePackageList {
21 21
         new expo.modules.permissions.PermissionsPackage(),
22 22
         new expo.modules.securestore.SecureStorePackage(),
23 23
         new expo.modules.sqlite.SQLitePackage(),
24
-        new expo.modules.updates.UpdatesPackage(),
25 24
         new expo.modules.webbrowser.WebBrowserPackage()
26 25
     );
27 26
   }

BIN
android/app/src/main/res/drawable-xxhdpi/launch_screen.png View File


+ 12
- 0
android/app/src/main/res/layout/launch_screen.xml View File

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+                android:orientation="vertical" android:layout_width="match_parent"
4
+                android:layout_height="match_parent">
5
+
6
+    <ImageView
7
+        android:layout_width="match_parent"
8
+        android:layout_height="match_parent"
9
+        android:background="@color/colorPrimary"
10
+        android:scaleType="fitCenter"
11
+        android:src="@drawable/launch_screen" />
12
+</RelativeLayout>

+ 1
- 0
android/app/src/main/res/values/colors.xml View File

@@ -4,4 +4,5 @@
4 4
   <color name="navigationBarColor">#121212</color>
5 5
   <color name="colorPrimaryDark">#be1522</color>
6 6
   <color name="colorPrimary">#be1522</color>
7
+  <color name="primary_dark">#be1522</color>
7 8
 </resources>

+ 1
- 0
ios/Podfile View File

@@ -43,4 +43,5 @@ target 'Campus' do
43 43
 
44 44
   # react-native-cli autolinking
45 45
   use_native_modules!
46
+
46 47
 end

+ 10
- 9
package.json View File

@@ -18,21 +18,13 @@
18 18
     ]
19 19
   },
20 20
   "dependencies": {
21
-    "expo": "^37.0.0",
22
-    "react": "~16.9.0",
23
-    "react-dom": "16.9.0",
24
-    "react-native": "~0.61.5",
25
-    "react-native-gesture-handler": "~1.6.0",
26
-    "react-native-reanimated": "~1.7.0",
27
-    "react-native-screens": "~2.2.0",
28
-    "react-native-unimodules": "~0.9.0",
29
-    "react-native-web": "~0.11.7",
30 21
     "@expo/vector-icons": "^10.0.0",
31 22
     "@react-native-community/masked-view": "0.1.6",
32 23
     "@react-navigation/bottom-tabs": "^5.1.1",
33 24
     "@react-navigation/drawer": "^5.1.1",
34 25
     "@react-navigation/native": "^5.0.9",
35 26
     "@react-navigation/stack": "^5.1.1",
27
+    "expo": "^37.0.0",
36 28
     "expo-barcode-scanner": "~8.1.0",
37 29
     "expo-camera": "latest",
38 30
     "expo-linear-gradient": "~8.1.0",
@@ -40,17 +32,26 @@
40 32
     "expo-permissions": "~8.1.0",
41 33
     "expo-secure-store": "~8.1.0",
42 34
     "i18n-js": "^3.3.0",
35
+    "react": "~16.9.0",
36
+    "react-dom": "16.9.0",
37
+    "react-native": "~0.61.5",
43 38
     "react-native-animatable": "^1.3.3",
44 39
     "react-native-app-intro-slider": "^4.0.0",
45 40
     "react-native-appearance": "~0.3.3",
46 41
     "react-native-autolink": "^3.0.0",
47 42
     "react-native-calendars": "^1.260.0",
48 43
     "react-native-collapsible": "^1.5.2",
44
+    "react-native-gesture-handler": "~1.6.0",
49 45
     "react-native-image-modal": "^1.0.6",
50 46
     "react-native-modalize": "^1.3.6",
51 47
     "react-native-paper": "^3.8.0",
48
+    "react-native-reanimated": "~1.7.0",
52 49
     "react-native-render-html": "^4.1.2",
53 50
     "react-native-safe-area-context": "0.7.3",
51
+    "react-native-screens": "~2.2.0",
52
+    "react-native-splash-screen": "^3.2.0",
53
+    "react-native-unimodules": "~0.9.0",
54
+    "react-native-web": "~0.11.7",
54 55
     "react-native-webview": "8.1.1",
55 56
     "react-navigation-collapsible": "^5.5.0",
56 57
     "react-navigation-header-buttons": "^3.0.5"

Loading…
Cancel
Save