Browse Source

Fixed image modal view jump by setting status bar to opaque

Arnaud Vergnet 1 year ago
parent
commit
eab232c4dc
2 changed files with 36 additions and 19 deletions
  1. 6
    9
      App.js
  2. 30
    10
      app.json

+ 6
- 9
App.js View File

@@ -40,9 +40,6 @@ export default class App extends React.Component<Props, State> {
40 40
         currentTheme: null,
41 41
     };
42 42
 
43
-    onIntroDone: Function;
44
-    onUpdateTheme: Function;
45
-
46 43
     navigatorRef: Object;
47 44
 
48 45
     defaultRoute: string | null;
@@ -55,8 +52,6 @@ export default class App extends React.Component<Props, State> {
55 52
     constructor() {
56 53
         super();
57 54
         LocaleManager.initTranslations();
58
-        this.onIntroDone = this.onIntroDone.bind(this);
59
-        this.onUpdateTheme = this.onUpdateTheme.bind(this);
60 55
         SplashScreen.preventAutoHide();
61 56
         this.navigatorRef = React.createRef();
62 57
         this.defaultRoute = null;
@@ -82,12 +77,12 @@ export default class App extends React.Component<Props, State> {
82 77
     /**
83 78
      * Updates the theme
84 79
      */
85
-    onUpdateTheme() {
80
+    onUpdateTheme = () => {
86 81
         this.setState({
87 82
             currentTheme: ThemeManager.getCurrentTheme()
88 83
         });
89 84
         this.setupStatusBar();
90
-    }
85
+    };
91 86
 
92 87
     setupStatusBar() {
93 88
         if (ThemeManager.getNightMode()) {
@@ -95,12 +90,14 @@ export default class App extends React.Component<Props, State> {
95 90
         } else {
96 91
             StatusBar.setBarStyle('dark-content', true);
97 92
         }
93
+        StatusBar.setTranslucent(false);
94
+        StatusBar.setBackgroundColor(ThemeManager.getCurrentTheme().colors.surface);
98 95
     }
99 96
 
100 97
     /**
101 98
      * Callback when user ends the intro. Save in preferences to avaoid showing back the introSlides
102 99
      */
103
-    onIntroDone() {
100
+    onIntroDone = () => {
104 101
         this.setState({
105 102
             showIntro: false,
106 103
             showUpdate: false,
@@ -109,7 +106,7 @@ export default class App extends React.Component<Props, State> {
109 106
         AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.showIntro.key, '0');
110 107
         AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.updateNumber.key, Update.number.toString());
111 108
         AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.showAprilFoolsStart.key, '0');
112
-    }
109
+    };
113 110
 
114 111
     async componentDidMount() {
115 112
         await this.loadAssetsAsync();

+ 30
- 10
app.json View File

@@ -3,18 +3,30 @@
3 3
     "name": "Campus",
4 4
     "description": "Application mobile compatible Android et iOS pour l'Amicale INSA Toulouse. Grâce à cette application, vous avez facilement accès aux news du campus, aux emplois du temps, à l'état de la laverie, et bien d'autres services ! Ceci est une version Beta, Toutes les fonctionnalités ne sont pas encore implémentées, et il est possible de rencontrer quelques bugs.",
5 5
     "slug": "application-amicale",
6
-    "scheme": "campus-insat",
6
+    "backgroundColor": "#ffffff",
7 7
     "privacy": "public",
8
+    "version": "2.0.0",
8 9
     "platforms": [
9 10
       "ios",
10
-      "android",
11
-      "web"
11
+      "android"
12 12
     ],
13
-    "version": "2.0.0",
14 13
     "orientation": "portrait",
15 14
     "primaryColor": "#be1522",
16
-    "userInterfaceStyle": "automatic",
17 15
     "icon": "./assets/android.icon.png",
16
+    "scheme": "campus-insat",
17
+    "facebookAutoInitEnabled": false,
18
+    "facebookAutoLogAppEventsEnabled": false,
19
+    "facebookAdvertiserIDCollectionEnabled": false,
20
+    "androidStatusBar": {
21
+      "barStyle": "light-content",
22
+      "hidden": false,
23
+      "translucent": true,
24
+      "backgroundColor": "#00000000"
25
+    },
26
+    "androidNavigationBar": {
27
+      "visible": true,
28
+      "barStyle": "light-content"
29
+    },
18 30
     "splash": {
19 31
       "backgroundColor": "#be1522",
20 32
       "resizeMode": "contain",
@@ -28,12 +40,13 @@
28 40
     "updates": {
29 41
       "enabled": false
30 42
     },
31
-    "assetBundlePatterns": [
32
-      "**/*"
33
-    ],
34 43
     "ios": {
35 44
       "bundleIdentifier": "fr.amicaleinsat.application",
36
-      "icon": "./assets/ios.icon.png"
45
+      "icon": "./assets/ios.icon.png",
46
+      "appStoreUrl": "https://apps.apple.com/us/app/campus-amicale-insat/id1477722148?ls=1",
47
+      "usesIcloudStorage": false,
48
+      "usesAppleSignIn":  false,
49
+      "accessesContactNotes": false
37 50
     },
38 51
     "android": {
39 52
       "package": "fr.amicaleinsat.application",
@@ -43,10 +56,17 @@
43 56
         "foregroundImage": "./assets/android.adaptive-icon.png",
44 57
         "backgroundColor": "#be1522"
45 58
       },
59
+      "playStoreUrl": "https://play.google.com/store/apps/details?id=fr.amicaleinsat.application",
46 60
       "permissions": [
47 61
         "VIBRATE",
48 62
         "CAMERA"
49 63
       ]
50
-    }
64
+    },
65
+    "userInterfaceStyle": "automatic",
66
+    "assetBundlePatterns": [
67
+      "**/*"
68
+    ],
69
+
70
+
51 71
   }
52 72
 }

Loading…
Cancel
Save