Browse Source

Merge branch 'dev'

Arnaud Vergnet 3 years ago
parent
commit
c1d02de5d2
100 changed files with 2985 additions and 1234 deletions
  1. 73
    0
      .gitignore
  2. 11
    0
      .idea/runConfigurations/All_Tests.xml
  3. 16
    0
      .idea/runConfigurations/Expo.xml
  4. 126
    55
      App.js
  5. 26
    0
      Changelog.md
  6. 123
    0
      INSTALL.md
  7. 14
    70
      README.md
  8. 7
    0
      __mocks__/react-native-keychain/index.js
  9. 210
    0
      __tests__/managers/ConnectionManager.test.js
  10. 210
    0
      __tests__/utils/PlanningEventManager.test.js
  11. 142
    0
      __tests__/utils/Proxiwash.test.js
  12. 45
    0
      __tests__/utils/WebData.js
  13. 55
    0
      android/app/BUCK
  14. 215
    0
      android/app/build.gradle
  15. 19
    0
      android/app/build_defs.bzl
  16. 13
    0
      android/app/proguard-rules.pro
  17. 7
    0
      android/app/src/debug/AndroidManifest.xml
  18. 66
    0
      android/app/src/main/AndroidManifest.xml
  19. 0
    0
      android/app/src/main/assets/app.bundle
  20. 1
    0
      android/app/src/main/assets/app.manifest
  21. 48
    0
      android/app/src/main/java/fr/amicaleinsat/application/MainActivity.java
  22. 75
    0
      android/app/src/main/java/fr/amicaleinsat/application/MainApplication.java
  23. BIN
      android/app/src/main/res/drawable-xxhdpi/launch_screen.png
  24. 12
    0
      android/app/src/main/res/layout/launch_screen.xml
  25. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  26. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  27. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  28. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  29. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  30. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  31. BIN
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  32. BIN
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  33. BIN
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  34. BIN
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  35. 8
    0
      android/app/src/main/res/values/colors.xml
  36. 3
    0
      android/app/src/main/res/values/strings.xml
  37. 10
    0
      android/app/src/main/res/values/styles.xml
  38. 27
    0
      android/app/src/release/AndroidManifest.xml
  39. 41
    0
      android/build.gradle
  40. BIN
      android/gradle/wrapper/gradle-wrapper.jar
  41. 5
    0
      android/gradle/wrapper/gradle-wrapper.properties
  42. 188
    0
      android/gradlew
  43. 100
    0
      android/gradlew.bat
  44. 6
    0
      android/settings.gradle
  45. 3
    50
      app.json
  46. BIN
      assets/amicale.png
  47. BIN
      assets/android.adaptive-icon.png
  48. BIN
      assets/drawer-cover.png
  49. BIN
      assets/ios.icon.png
  50. BIN
      assets/proximo-logo.png
  51. BIN
      assets/proxiwash-logo.png
  52. BIN
      assets/splash.png
  53. BIN
      assets/tab-icon-outline.png
  54. BIN
      assets/tab-icon.png
  55. 2
    10
      babel.config.js
  56. 18
    1
      clear-node-cache.sh
  57. 0
    40
      components/CustomAgenda.js
  58. 0
    41
      components/EmptyWebSectionListItem.js
  59. 0
    44
      components/EventDashboardItem.js
  60. 0
    48
      components/FeedItem.js
  61. 0
    16
      components/HeaderButton.js
  62. 0
    66
      components/PreviewEventDashboardItem.js
  63. 0
    89
      components/ProxiwashListItem.js
  64. 0
    31
      components/PureFlatList.js
  65. 0
    190
      components/Sidebar.js
  66. 0
    23
      components/SidebarDivider.js
  67. 0
    28
      components/SidebarItem.js
  68. 0
    33
      components/SquareDashboardItem.js
  69. 0
    228
      components/WebSectionList.js
  70. 0
    136
      components/WebViewScreen.js
  71. 0
    10
      constants/ProxiwashConstants.js
  72. 0
    25
      constants/Update.js
  73. 37
    0
      eject.txt
  74. 4
    0
      index.js
  75. 498
    0
      ios/Campus.xcodeproj/project.pbxproj
  76. 125
    0
      ios/Campus.xcodeproj/xcshareddata/xcschemes/Campus.xcscheme
  77. 16
    0
      ios/Campus/AppDelegate.h
  78. 89
    0
      ios/Campus/AppDelegate.m
  79. 35
    0
      ios/Campus/Base.lproj/LaunchScreen.xib
  80. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/1024.png
  81. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/120-1.png
  82. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/120.png
  83. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/180.png
  84. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/40.png
  85. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/58.png
  86. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/60.png
  87. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/80.png
  88. BIN
      ios/Campus/Images.xcassets/AppIcon.appiconset/87.png
  89. 62
    0
      ios/Campus/Images.xcassets/AppIcon.appiconset/Contents.json
  90. 6
    0
      ios/Campus/Images.xcassets/Contents.json
  91. 21
    0
      ios/Campus/Images.xcassets/LaunchScreen.imageset/Contents.json
  92. BIN
      ios/Campus/Images.xcassets/LaunchScreen.imageset/splash.png
  93. 79
    0
      ios/Campus/Info.plist
  94. 0
    0
      ios/Campus/Supporting/app.bundle
  95. 1
    0
      ios/Campus/Supporting/app.manifest
  96. 5
    0
      ios/Campus/application.entitlements
  97. 16
    0
      ios/Campus/main.m
  98. 49
    0
      ios/Podfile
  99. 17
    0
      metro.config.js
  100. 0
    0
      navigation/DrawerNavigator.js

+ 73
- 0
.gitignore View File

@@ -8,3 +8,76 @@ npm-debug.*
8 8
 *.orig.*
9 9
 web-build/
10 10
 web-report/
11
+/.expo-shared/
12
+/package-lock.json
13
+
14
+!/.idea/
15
+/.idea/*
16
+!/.idea/runConfigurations
17
+
18
+# The following contents were automatically generated by expo-cli during eject
19
+# ----------------------------------------------------------------------------
20
+
21
+# OSX
22
+#
23
+.DS_Store
24
+
25
+# Xcode
26
+#
27
+build/
28
+*.pbxuser
29
+!default.pbxuser
30
+*.mode1v3
31
+!default.mode1v3
32
+*.mode2v3
33
+!default.mode2v3
34
+*.perspectivev3
35
+!default.perspectivev3
36
+xcuserdata
37
+*.xccheckout
38
+*.moved-aside
39
+DerivedData
40
+*.hmap
41
+*.ipa
42
+*.xcuserstate
43
+project.xcworkspace
44
+
45
+# Android/IntelliJ
46
+#
47
+build/
48
+.idea
49
+.gradle
50
+local.properties
51
+*.iml
52
+
53
+# node.js
54
+#
55
+node_modules/
56
+npm-debug.log
57
+yarn-error.log
58
+
59
+# BUCK
60
+buck-out/
61
+\.buckd/
62
+*.keystore
63
+
64
+# fastlane
65
+#
66
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
67
+# screenshots whenever they are needed.
68
+# For more information about the recommended setup visit:
69
+# https://docs.fastlane.tools/best-practices/source-control/
70
+
71
+*/fastlane/report.xml
72
+*/fastlane/Preview.html
73
+*/fastlane/screenshots
74
+
75
+# Bundle artifacts
76
+*.jsbundle
77
+
78
+# CocoaPods
79
+/ios/Pods/
80
+
81
+# Expo
82
+.expo/*
83
+/android/gradle.properties

+ 11
- 0
.idea/runConfigurations/All_Tests.xml View File

@@ -0,0 +1,11 @@
1
+<component name="ProjectRunConfigurationManager">
2
+  <configuration default="false" name="All Tests" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
3
+    <node-interpreter value="project" />
4
+    <node-options value="" />
5
+    <jest-package value="$PROJECT_DIR$/node_modules/jest" />
6
+    <working-dir value="$PROJECT_DIR$" />
7
+    <envs />
8
+    <scope-kind value="ALL" />
9
+    <method v="2" />
10
+  </configuration>
11
+</component>

+ 16
- 0
.idea/runConfigurations/Expo.xml View File

@@ -0,0 +1,16 @@
1
+<component name="ProjectRunConfigurationManager">
2
+  <configuration default="false" name="Expo" type="ReactNative" factoryName="React Native">
3
+    <node-interpreter value="project" />
4
+    <react-native value="$USER_HOME$/.nvm/versions/node/v12.4.0/lib/node_modules/react-native-cli" />
5
+    <platform value="ANDROID" />
6
+    <envs />
7
+    <only-packager />
8
+    <build-and-launch value="false" />
9
+    <browser value="98ca6316-2f89-46d9-a9e5-fa9e2b0625b3" />
10
+    <debug-host value="127.0.0.1" />
11
+    <debug-port value="19001" />
12
+    <method v="2">
13
+      <option name="ReactNativePackager" enabled="true" />
14
+    </method>
15
+  </configuration>
16
+</component>

+ 126
- 55
App.js View File

@@ -1,19 +1,31 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import {Platform, StatusBar} from 'react-native';
5
-import LocaleManager from './utils/LocaleManager';
6
-import AsyncStorageManager from "./utils/AsyncStorageManager";
7
-import CustomIntroSlider from "./components/CustomIntroSlider";
8
-import {SplashScreen} from 'expo';
9
-import ThemeManager from './utils/ThemeManager';
4
+import {Platform, StatusBar, View, YellowBox} from 'react-native';
5
+import LocaleManager from './src/managers/LocaleManager';
6
+import AsyncStorageManager from "./src/managers/AsyncStorageManager";
7
+import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider";
8
+import type {CustomTheme} from "./src/managers/ThemeManager";
9
+import ThemeManager from './src/managers/ThemeManager';
10 10
 import {NavigationContainer} from '@react-navigation/native';
11
-import {createStackNavigator} from '@react-navigation/stack';
12
-import DrawerNavigator from './navigation/DrawerNavigator';
13
-import NotificationsManager from "./utils/NotificationsManager";
11
+import MainNavigator from './src/navigation/MainNavigator';
14 12
 import {Provider as PaperProvider} from 'react-native-paper';
15
-import AprilFoolsManager from "./utils/AprilFoolsManager";
16
-import Update from "./constants/Update";
13
+import AprilFoolsManager from "./src/managers/AprilFoolsManager";
14
+import Update from "./src/constants/Update";
15
+import ConnectionManager from "./src/managers/ConnectionManager";
16
+import URLHandler from "./src/utils/URLHandler";
17
+import {setSafeBounceHeight} from "react-navigation-collapsible";
18
+import SplashScreen from 'react-native-splash-screen'
19
+import {OverflowMenuProvider} from "react-navigation-header-buttons";
20
+
21
+// Native optimizations https://reactnavigation.org/docs/react-native-screens
22
+// Crashes app when navigating away from webview on android 9+
23
+// enableScreens(true);
24
+
25
+
26
+YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
27
+    'Non-serializable values were found in the navigation state',
28
+]);
17 29
 
18 30
 type Props = {};
19 31
 
@@ -22,11 +34,9 @@ type State = {
22 34
     showIntro: boolean,
23 35
     showUpdate: boolean,
24 36
     showAprilFools: boolean,
25
-    currentTheme: ?Object,
37
+    currentTheme: CustomTheme | null,
26 38
 };
27 39
 
28
-const Stack = createStackNavigator();
29
-
30 40
 export default class App extends React.Component<Props, State> {
31 41
 
32 42
     state = {
@@ -37,75 +47,131 @@ export default class App extends React.Component<Props, State> {
37 47
         currentTheme: null,
38 48
     };
39 49
 
40
-    onIntroDone: Function;
41
-    onUpdateTheme: Function;
50
+    navigatorRef: { current: null | NavigationContainer };
51
+
52
+    defaultHomeRoute: string | null;
53
+    defaultHomeData: { [key: string]: any }
54
+
55
+    createDrawerNavigator: () => React.Node;
56
+
57
+    urlHandler: URLHandler;
58
+    storageManager: AsyncStorageManager;
42 59
 
43 60
     constructor() {
44 61
         super();
45 62
         LocaleManager.initTranslations();
46
-        this.onIntroDone = this.onIntroDone.bind(this);
47
-        this.onUpdateTheme = this.onUpdateTheme.bind(this);
48
-        SplashScreen.preventAutoHide();
63
+        this.navigatorRef = React.createRef();
64
+        this.defaultHomeRoute = null;
65
+        this.defaultHomeData = {};
66
+        this.storageManager = AsyncStorageManager.getInstance();
67
+        this.urlHandler = new URLHandler(this.onInitialURLParsed, this.onDetectURL);
68
+        this.urlHandler.listen();
69
+        setSafeBounceHeight(Platform.OS === 'ios' ? 100 : 20);
70
+        this.loadAssetsAsync().then(() => {
71
+            this.onLoadFinished();
72
+        });
49 73
     }
50 74
 
51 75
     /**
52
-     * Updates the theme
76
+     * THe app has been started by an url, and it has been parsed.
77
+     * Set a new default start route based on the data parsed.
78
+     *
79
+     * @param parsedData The data parsed from the url
80
+     */
81
+    onInitialURLParsed = (parsedData: { route: string, data: { [key: string]: any } }) => {
82
+        this.defaultHomeRoute = parsedData.route;
83
+        this.defaultHomeData = parsedData.data;
84
+    };
85
+
86
+    /**
87
+     * An url has been opened and parsed while the app was active.
88
+     * Redirect the user to the screen according to parsed data.
89
+     *
90
+     * @param parsedData The data parsed from the url
91
+     */
92
+    onDetectURL = (parsedData: { route: string, data: { [key: string]: any } }) => {
93
+        // Navigate to nested navigator and pass data to the index screen
94
+        if (this.navigatorRef.current != null) {
95
+            this.navigatorRef.current.navigate('home', {
96
+                screen: 'index',
97
+                params: {nextScreen: parsedData.route, data: parsedData.data}
98
+            });
99
+        }
100
+    };
101
+
102
+    /**
103
+     * Updates the current theme
53 104
      */
54
-    onUpdateTheme() {
105
+    onUpdateTheme = () => {
55 106
         this.setState({
56 107
             currentTheme: ThemeManager.getCurrentTheme()
57 108
         });
58 109
         this.setupStatusBar();
59
-    }
110
+    };
60 111
 
112
+    /**
113
+     * Updates status bar content color if on iOS only,
114
+     * as the android status bar is always set to black.
115
+     */
61 116
     setupStatusBar() {
62
-        if (Platform.OS === 'ios') {
63
-            if (ThemeManager.getNightMode()) {
64
-                StatusBar.setBarStyle('light-content', true);
65
-            } else {
66
-                StatusBar.setBarStyle('dark-content', true);
67
-            }
117
+        if (ThemeManager.getNightMode()) {
118
+            StatusBar.setBarStyle('light-content', true);
119
+        } else {
120
+            StatusBar.setBarStyle('dark-content', true);
68 121
         }
122
+        if (Platform.OS === "android")
123
+            StatusBar.setBackgroundColor(ThemeManager.getCurrentTheme().colors.surface, true);
69 124
     }
70 125
 
71 126
     /**
72
-     * Callback when user ends the intro. Save in preferences to avaoid showing back the introSlides
127
+     * Callback when user ends the intro. Save in preferences to avoid showing back the introSlides
73 128
      */
74
-    onIntroDone() {
129
+    onIntroDone = () => {
75 130
         this.setState({
76 131
             showIntro: false,
77 132
             showUpdate: false,
78 133
             showAprilFools: false,
79 134
         });
80
-        AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.showIntro.key, '0');
81
-        AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.updateNumber.key, Update.number.toString());
82
-        AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.showAprilFoolsStart.key, '0');
83
-    }
84
-
85
-    async componentDidMount() {
86
-        await this.loadAssetsAsync();
87
-    }
135
+        this.storageManager.savePref(this.storageManager.preferences.showIntro.key, '0');
136
+        this.storageManager.savePref(this.storageManager.preferences.updateNumber.key, Update.number.toString());
137
+        this.storageManager.savePref(this.storageManager.preferences.showAprilFoolsStart.key, '0');
138
+    };
88 139
 
89
-    async loadAssetsAsync() {
90
-        // Wait for custom fonts to be loaded before showing the app
91
-        await AsyncStorageManager.getInstance().loadPreferences();
92
-        ThemeManager.getInstance().setUpdateThemeCallback(this.onUpdateTheme);
93
-        await NotificationsManager.initExpoToken();
94
-        this.onLoadFinished();
140
+    /**
141
+     * Loads every async data
142
+     *
143
+     * @returns {Promise<void>}
144
+     */
145
+    loadAssetsAsync = async () => {
146
+        await this.storageManager.loadPreferences();
147
+        try {
148
+            await ConnectionManager.getInstance().recoverLogin();
149
+        } catch (e) {
150
+        }
95 151
     }
96 152
 
153
+    /**
154
+     * Async loading is done, finish processing startup data
155
+     */
97 156
     onLoadFinished() {
98
-        // console.log("finished");
99 157
         // Only show intro if this is the first time starting the app
158
+        this.createDrawerNavigator = () => <MainNavigator
159
+            defaultHomeRoute={this.defaultHomeRoute}
160
+            defaultHomeData={this.defaultHomeData}
161
+        />;
162
+        ThemeManager.getInstance().setUpdateThemeCallback(this.onUpdateTheme);
163
+        // Status bar goes dark if set too fast on ios
164
+        if (Platform.OS === 'ios')
165
+            setTimeout(this.setupStatusBar, 1000);
166
+        else
167
+            this.setupStatusBar();
100 168
         this.setState({
101 169
             isLoading: false,
102 170
             currentTheme: ThemeManager.getCurrentTheme(),
103
-            showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1',
104
-            showUpdate: AsyncStorageManager.getInstance().preferences.updateNumber.current !== Update.number.toString(),
105
-            showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && AsyncStorageManager.getInstance().preferences.showAprilFoolsStart.current === '1',
171
+            showIntro: this.storageManager.preferences.showIntro.current === '1',
172
+            showUpdate: this.storageManager.preferences.updateNumber.current !== Update.number.toString(),
173
+            showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && this.storageManager.preferences.showAprilFoolsStart.current === '1',
106 174
         });
107
-        // Status bar goes dark if set too fast
108
-        setTimeout(this.setupStatusBar, 1000);
109 175
         SplashScreen.hide();
110 176
     }
111 177
 
@@ -124,11 +190,16 @@ export default class App extends React.Component<Props, State> {
124 190
         } else {
125 191
             return (
126 192
                 <PaperProvider theme={this.state.currentTheme}>
127
-                    <NavigationContainer theme={this.state.currentTheme}>
128
-                        <Stack.Navigator headerMode="none">
129
-                            <Stack.Screen name="Root" component={DrawerNavigator}/>
130
-                        </Stack.Navigator>
131
-                    </NavigationContainer>
193
+                    <OverflowMenuProvider>
194
+                        <View style={{backgroundColor: ThemeManager.getCurrentTheme().colors.background, flex: 1}}>
195
+                            <NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
196
+                                <MainNavigator
197
+                                    defaultHomeRoute={this.defaultHomeRoute}
198
+                                    defaultHomeData={this.defaultHomeData}
199
+                                />
200
+                            </NavigationContainer>
201
+                        </View>
202
+                    </OverflowMenuProvider>
132 203
                 </PaperProvider>
133 204
             );
134 205
         }

+ 26
- 0
Changelog.md View File

@@ -2,6 +2,32 @@
2 2
 
3 3
 Pensez à garder l'appli à jour pour profiter des dernières fonctionnalités !
4 4
 
5
+ - **v3.0.0** - _TBA_
6
+    - Nouvelle barre de navigation !
7
+    - Suppression du menu déroulant gauche
8
+    - Création d'une nouvelle catégorie dans la barre de navigation pour regrouper tous les services
9
+    - Ajout d'animations un peu partout parce que c'est joli et j'ai compris comment faire :D
10
+    - Ajout de la connexion au compte Amicale
11
+    - Ajout de la liste des clubs, des élections et du profil utilisateur à travers son compte Amicale
12
+    - Amélioration importante de la vitesse de démarrage et des performances sur Android
13
+    - Réduction importante de la taille de l'application à télécharger et une fois installée
14
+    - _Notes de développement :_
15
+        - Migration de Expo Managed Workflow à React Native Bare Workflow     
16
+
17
+ - **v2.0.0** - _12/03/2020_
18
+    - Nouvelle interface !
19
+    - Amélioration des performances
20
+    - Amélioration de la vitesse de démarrage
21
+    - _Notes de développement :_
22
+        - Utilisation de react-native-paper à la place de native base
23
+
24
+ - **v1.5.2** - _25/02/2020_
25
+    - Correction d'un problème d'affichage des détail du Proximo
26
+
27
+ - **v1.5.1** - _24/02/2020_
28
+    - Amélioration des performances
29
+    - Utilisation d'un tri des catégories du Proximo plus cohérent
30
+
5 31
  - **v1.5.0** - _05/02/2020_
6 32
     - Amélioration des performances de l'application
7 33
     - Amélioration du menu gauche

+ 123
- 0
INSTALL.md View File

@@ -0,0 +1,123 @@
1
+# Installer l'application depuis ce dépot
2
+
3
+**Vous allez devoir installer git, node et npm sur votre machine, puis cloner ce dépôt.**
4
+
5
+Tout est expliqué dans ce guide, si vous avez un problème ou une question, merci de me contacter par mail : app@amicale-insat.fr
6
+
7
+## Table des matières
8
+* [Installation de Git](#installation-de-git)
9
+* [Installation de node](#installation-de-node)
10
+* [Installation de  React Native](#installation-de-react-native)
11
+    * [Configuration de NPM](#configuration-de-npm)
12
+    * [Installation](#installation)
13
+* [Téléchargement du dépot](#téléchargement-du-dépot)
14
+* [Téléchargement des dépendances](#téléchargement-des-dépendances)
15
+* [Lancement de l'appli](#lancement-de-lappli)
16
+* [Tester sur un appareil](#tester-sur-un-appareil)
17
+
18
+## Installation de Git
19
+
20
+Entrez la commande suivante pour l'installer :
21
+```shell script
22
+sudo apt install git
23
+```
24
+
25
+## Installation de node
26
+
27
+Vous devez avoir une version de node > 12.0.
28
+Pour cela, vérifiez avec la commande :
29
+```shell script
30
+nodejs -v
31
+```
32
+
33
+Si ce n'est pas le cas, entrez les commandes suivantes pour installer la version 12 ([plus d'informations sur ce lien](https://github.com/nodesource/distributions/blob/master/README.md#debinstall)):
34
+
35
+```shell script
36
+curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
37
+sudo apt-get install -y nodejs
38
+```
39
+
40
+## Installation de React Native
41
+
42
+Merci de suivre les [instructions d'installation](https://reactnative.dev/docs/environment-setup) sur le site officiel.
43
+
44
+## Téléchargement du dépôt
45
+
46
+Clonez ce dépôt à l'aide de la commande suivante :
47
+````shell script
48
+git clone https://git.etud.insa-toulouse.fr/vergnet/application-amicale.git
49
+````
50
+
51
+## Téléchargement des dépendances
52
+
53
+Une fois le dépôt sur votre machine, ouvrez le terminal dans le dossier du dépôt cloné et tapez : 
54
+````shell script
55
+npm install
56
+````
57
+Ceci installera toutes les dépendances listées dans le fichier _package.json_. Cette opération peut prendre quelques minutes et utilisera beaucoup d'espace disque (plus de 300Mo).
58
+
59
+### Instructions pour iOS
60
+
61
+Pour iOS, en plus de la commande précédente, il faut aussi installer les dépendances iOS. Pour cela, allez dans le dossier `ios` et installez les pods :
62
+```shell script
63
+cd ios && pod install
64
+```
65
+
66
+## Lancement de l'appli
67
+
68
+Il est conseillé d'utiliser un logiciel comme **WebStorm** (logiciel pro gratuit pour les étudiants) pour éditer l'application car ce logiciel est compatible avec les technologies utilisées.
69
+
70
+Vous aurez besoin de 2 consoles :
71
+* Une pour lancer le *Bundler*, qui permet de mettre à jour l'application en temps réel (vous pouvez le laisser tout le temps ouvert).
72
+* Une autre pour installer l'application sur votre appareil/simulateur.
73
+
74
+Pour lancer le *Bundler*, assurez vous d'être dans le dossier de l'application, et lancez cette commande :
75
+````shell script
76
+npx react-native start
77
+````
78
+
79
+### Android
80
+Dans la deuxième console, lancez la commande suivante :
81
+````shell script
82
+npx react-native run-android
83
+````
84
+
85
+### iOS
86
+Dans la deuxième console, lancez la commande suivante (valable que sur Mac) :
87
+````shell script
88
+npx react-native run-ios
89
+````
90
+
91
+**Ne stoppez pas le Metro Bundler dans la console à chaque changement !** Toutes les modifications sont appliquées automatiquement, pas besoin de stopper et de redémarrer pour des petits changements ! Il est seulement nécessaire de redémarrer le Metro Bundler quand vous changez des librairies ou des fichiers.
92
+
93
+## Tester sur un appareil
94
+
95
+Assurez vous d'avoir installé et lancé le projet comme expliqué plus haut.
96
+
97
+### Android
98
+
99
+#### Émulateur
100
+
101
+[Suivez la procédure sur ce lien pour installer un émulateur](https://docs.expo.io/versions/latest/workflow/android-studio-emulator/).
102
+
103
+Une fois l'emulateur installé et démarré, lancez l'application comme expliqué plus haut.
104
+
105
+#### Appareil Physique
106
+
107
+Branchez votre appareil, allez dans les options développeurs et activer le *USB Debugging*. Une fois qu'il est activé et branché, lancez l'appli comme expliqué plus haut. 
108
+
109
+### iOS
110
+
111
+#### Émulateur
112
+
113
+Installez le logiciel Xcode et téléchargez l'émulateur de votre choix. Ensuite, lancez la commande suivante pour lancer l'application sur votre émulateur.
114
+````shell script
115
+npx react-native run-ios --simulator="NOM DU SIMULATEUR"
116
+````
117
+En remplaçant `NOM DU SIMULATEUR` par le simulateur que vous voulez.
118
+
119
+#### Appareil Physique
120
+
121
+Aucune idée je suis pauvre je n'ai pas de Mac.
122
+
123
+[reference]: ##Installation de Git

+ 14
- 70
README.md View File

@@ -10,85 +10,29 @@ Créée pendant l'été 2019, cette application compatible Android et iOS permet
10 10
  - Disponibilité des salles libre accès
11 11
  - Réservation des Bib'Box
12 12
  
13
-Ce dépot contient la source de cette application, modifiable par les étudiants de l'INSA Toulouse, sous licence GPLv3.
13
+Ce dépot contient la source de cette application, sous licence GPLv3.
14 14
 
15 15
 ## Contribuer
16 16
 
17 17
 Vous voulez influencer le développement ? C'est très simple !
18 18
 
19
-Pas besoin de connaissance, il est possible d'aider simplement en proposant des améliorations ou en rapportant des bugs par mail (vergnet@etud.insa-toulouse.fr) ou sur [cette page](https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues), en vous connectant avec vos login INSA.
19
+Pas besoin de connaissance, il est possible d'aider simplement en proposant des améliorations ou en rapportant des bugs par mail ([app@amicale-insat.fr](mailto:app@amicale-insat.fr)) ou sur [cette page](https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues), en vous connectant avec vos login INSA.
20 20
 
21
-Si vous avez assez de connaissances et vous souhaitez proposer des modification dans le code, installez l'application sur votre machine, réalisez votre modification et créez une 'pull request'.
21
+Si vous avez assez de connaissances et vous souhaitez proposer des modifications dans le code, [installez l'application](INSTALL.md) sur votre machine, réalisez votre modification et créez une 'pull request'. Si vous avez des problèmes ou des questions, n'hésitez pas à me contacter par mail ([app@amicale-insat.fr](mailto:app@amicale-insat.fr)).
22 22
 
23 23
 ## Technologies Utilisées
24
-Cette application est faite en JavaScript avec React Native (framework Open Source créé par Facebook), combinée avec Expo.
24
+Cette application est faite en JavaScript avec React Native (framework Open Source créé par Facebook).
25 25
 
26
-Cette combinaison permet de n'avoir qu'un seul code JavaScript à écrire pour Android et iOS. Pour compiler pour la plateforme souhaitée, il suffit d'effectuer une commande, qui envoie le code sur les serveurs d'Expo pour compilation (voir section Installer). Plus besoin de Mac pour développer une application iOS ! (Mais toujours besoin d'un pour publier sur l'App store...)
26
+React Native permet de n'avoir qu'un seul code JavaScript à écrire pour Android et iOS. Pour compiler pour la plateforme souhaitée, il suffit d'effectuer une simple commande. Plus besoin de Mac pour développer une application iOS ! (Mais toujours besoin d'un pour compiler et publier sur l'App store...)
27 27
 
28
+Cette application utilisait initialement Expo, permettant de simplifier grandement le développement et le déploiement, mais il a été abandonné à cause de ses limitations et de son impact sur les performances. Revenir sur Expo n'est pas possible sans un gros travail et une suppression de fonctionnalités non compatibles.
28 29
 
29
-## Installer l'application depuis ce dépot
30
+## [Installer l'application depuis ce dépot](INSTALL.md)
30 31
 
31
-**Avant de commencer, installez git, node et npm sur votre machine, puis clonez ce dépot.**
32
-
33
-### Téléchargement du dépot et des dépendances
34
-
35
-Il est conseillé d'utiliser un logiciel comme **PHPStorm** (logiciel pro gratuit pour les étudiants) pour éditer l'application car ce logiciel est compatible avec les technologies utilisées.
36
-
37
-Une fois le dépot sur votre machine, ouvrez le projet dans PHPStorm, ouvrez le terminal et tapez `npm install`. Ceci installera toutes les dépendances listées dans le fichier _package.json_. Cette opération peut prendre quelques minutes et utilisera beaucoup d'espace disque (plus de 300Mo).
38
-
39
-### Lancement de l'appli
40
-
41
-#### En console
42
-
43
-Ouvrez simplement une console dans le répertoire du projet et tapez :
44
-
45
-`expo start`
46
-
47
-Cette commande va démarrer le Metro Bundler permettant de lancer l'appli. Attendez quelques instants, quand un QR code apparait, l'application est prête à être lancée sur votre téléphone.
48
-
49
-**Ne stoppez pas le Metro Bundler dans la console a chaque changement !** Toutes les modifications sont appliquées automatiquement, pas besoin de stopper et de redémarrer pour des petits changements ! Il est seulement nécessaire de redémarrer le Metro Bundler quand vous changez des librairies ou des fichiers.
50
-
51
-#### Directement avec PHPStorm
52
-
53
-Si vous n'aimez pas la console et voulez utiliser le merveilleux bouton play de PHPStorm, il faut le paramétrer. Nous utilisons ici expo, il faut donc dire à PHPStorm de lancer une commande expo quand nous cliquons sur le bouton play.
54
-
55
-Pour cela, cliquez sur **Edit Configurations** en haut à droite, dans la nouvelle fenêtre, cliquez sur **+**, et choisissez **React Native**.
56
-
57
-Donnez un petit nom à cette configuration, décochez **Build and launch application** (nous utilisons expo pour ça, pas react native), mettez `127.0.0.1` dans le champ **Bundler Host**, et `19001` dans **Bundler Port**.
58
-
59
-Ensuite, dans **Before Launch**; cliquez sur **+** pour ajouter une nouvelle configuration, et choisissez **Start React Native Bundler** si il n'est pas déjà présent. Une fois ajouté, cliquez dessus, puis sur le bouton éditer (une icone de crayon). Dans la nouvelle fenetre, choisissez **npm script** dans le champ **Command** et **start** dans **Script**. Vérifiez que vous utilisez bien l'interpreteur Node associé au projet (pour utiliser les bonnes dépendances installées précédement), et cliquez sur OK.
60
-
61
-[Plus d'informations ici](https://www.jetbrains.com/help/phpstorm/react-native.html)
62
-
63
-Le projet est maintenant pret, quand vous cliquez sur run (ou shift+F10), le projet sera lancé (cela peut prendre plusieurs minutes).
64
-Quand un QR code apparait, vous pouvez tester sur un appareil.
65
-
66
-**Ne stoppez pas le Metro Bundler dans la console a chaque changement !** Toutes les modifications sont appliquées automatiquement, pas besoin de stopper et de redémarrer pour des petits changements ! Il est seulement nécessaire de redémarrer le Metro Bundler quand vous changez des librairies ou des fichiers.
67
-
68
-### Tester sur un appareil
69
-
70
-Assurez vous d'avoir installé et lancé le projet comme expliqué plus haut.
71
-
72
-#### Émulateur android
73
-
74
-[Suivez la procédure sur ce lien pour installer un émulateur](https://docs.expo.io/versions/latest/workflow/android-studio-emulator/).
75
-
76
-Une fois l'emulateur installé et démarré, lancez le projet, puis appuyez sur la touche **a** dans la console, cela lancera l'aplication dans l'émulateur.
77
-
78
-#### Appareil Physique
79
-
80
-Installez l'application **Expo** sur votre appareil (android ou iOS), assurez vous d'avoir démarré le projet et d'avoir votre machine de développement et le téléphone sur le même réseau wifi (non publique). Ouvrez l'application expo, Votre projet devrait apparaitre dans la liste. Cliquez dessus et c'est bon !
81
-
82
-Si vous utilisez le réseau Wifirst des résidences INSA (ou tout autre wifi publique), il y a une méthode très simple pour créer un réseau privé entre votre PC et votre téléphone (en tout cas avec un téléphone android). Connectez votre téléphone en Wifi au réseau, puis connectez le en USB à votre PC. Une fois connecté, allez dans les paramètres et activez le "USB Tethering". Votre PC est maintenant connecté en réseau filaire à votre téléphone, qui lui est connecté à Internet par la wifi. Si vous voulez connecter d'autres appareils, il suffit de créer un Hotspot sur votre PC et de connecter vos autres appareils à ce Hotspot. Profitez de votre réseau privé dans votre Promolo !
83
-
84
-## Compilation
85
-
86
-Avant de compiler, créez vous un compte Expo. Ensuite, lancez le Metro Bundler et connectez vous a votre compte dans la console (les touches sont indiquées).
87
-
88
-Pour compiler sur android, vous avez deux solutions:
89
- - Vous voulez générer un `.apk` pour pour l'installer sur votre téléphone, lancez cette commande dans un terminal dans le projet : `expo build:android`. Cette commande va générer les paquets nécessaires à Expo et les envoyer sur leurs serveurs. Ne touchez à rien pendant la création des paquets (cela peut prendre une à deux minutes). Une fois que vous voyez écrit `Build in progress...`, vous pouvez fermer votre console : les serveurs ont pris la main et vous avez un lien pour analyser la progression. Ce processus dure en général 8 minutes. Si vous ne fermez pas la console, vous aurez un lien direct pour télécharger le fichier `.apk`, sinon connectez vous sur votre compte Expo, rubrique Builds pour le télécharger.
90
- 
91
- - Vous voulez compiler pour ensuite publier sur le Play Store, lancez cette commande dans un terminal dans le projet : `expo build:android -t app-bundle`. Cette commande fait exactement la même chose que la précédente à une chose près. Vous obtiendre un fichier `.aab`, qui est un format optimisé pour le Play Store. Ce fichier est plus volumineux mais permet au Play Store de générer les apk les plus optimisés possible pour différentes architectures de téléphone.
92
- 
93
-
94
-Pou compiler sur iOS, vous aurez besoin du compte développeur de l'amicale car un tel compte est payant.
32
+## Liens utiles
33
+* [Documentation React Native](https://reactnative.dev/docs/getting-started)
34
+* [Documentation Expo](https://docs.expo.io/versions/latest/)
35
+* [Documentation React Native Paper](https://callstack.github.io/react-native-paper/)
36
+* [Documentation React navigation](https://reactnavigation.org/docs/getting-started)
37
+* [Documentation Jest](https://jestjs.io/docs/en/getting-started)
38
+* [Documentation Flow](https://flow.org/en/docs/react/)

+ 7
- 0
__mocks__/react-native-keychain/index.js View File

@@ -0,0 +1,7 @@
1
+const keychainMock = {
2
+    SECURITY_LEVEL_ANY: "MOCK_SECURITY_LEVEL_ANY",
3
+    SECURITY_LEVEL_SECURE_SOFTWARE: "MOCK_SECURITY_LEVEL_SECURE_SOFTWARE",
4
+    SECURITY_LEVEL_SECURE_HARDWARE: "MOCK_SECURITY_LEVEL_SECURE_HARDWARE",
5
+}
6
+
7
+export default keychainMock;

+ 210
- 0
__tests__/managers/ConnectionManager.test.js View File

@@ -0,0 +1,210 @@
1
+jest.mock('react-native-keychain');
2
+
3
+import React from 'react';
4
+import ConnectionManager from "../../src/managers/ConnectionManager";
5
+import {ERROR_TYPE} from "../../src/utils/WebData";
6
+
7
+let fetch = require('isomorphic-fetch'); // fetch is not implemented in nodeJS but in react-native
8
+
9
+const c = ConnectionManager.getInstance();
10
+
11
+afterEach(() => {
12
+    jest.restoreAllMocks();
13
+});
14
+
15
+test('isLoggedIn yes', () => {
16
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
17
+        return 'token';
18
+    });
19
+    return expect(c.isLoggedIn()).toBe(true);
20
+});
21
+
22
+test('isLoggedIn no', () => {
23
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
24
+        return null;
25
+    });
26
+    return expect(c.isLoggedIn()).toBe(false);
27
+});
28
+
29
+test("isConnectionResponseValid", () => {
30
+    let json = {
31
+        error: 0,
32
+        data: {token: 'token'}
33
+    };
34
+    expect(c.isConnectionResponseValid(json)).toBeTrue();
35
+    json = {
36
+        error: 2,
37
+        data: {}
38
+    };
39
+    expect(c.isConnectionResponseValid(json)).toBeTrue();
40
+    json = {
41
+        error: 0,
42
+        data: {token: ''}
43
+    };
44
+    expect(c.isConnectionResponseValid(json)).toBeFalse();
45
+    json = {
46
+        error: 'prout',
47
+        data: {token: ''}
48
+    };
49
+    expect(c.isConnectionResponseValid(json)).toBeFalse();
50
+});
51
+
52
+test("connect bad credentials", () => {
53
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
54
+        return Promise.resolve({
55
+            json: () => {
56
+                return {
57
+                    error: ERROR_TYPE.BAD_CREDENTIALS,
58
+                    data: {}
59
+                };
60
+            },
61
+        })
62
+    });
63
+    return expect(c.connect('email', 'password'))
64
+        .rejects.toBe(ERROR_TYPE.BAD_CREDENTIALS);
65
+});
66
+
67
+test("connect good credentials", () => {
68
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
69
+        return Promise.resolve({
70
+            json: () => {
71
+                return {
72
+                    error: ERROR_TYPE.SUCCESS,
73
+                    data: {token: 'token'}
74
+                };
75
+            },
76
+        })
77
+    });
78
+    jest.spyOn(ConnectionManager.prototype, 'saveLogin').mockImplementationOnce(() => {
79
+        return Promise.resolve(true);
80
+    });
81
+    return expect(c.connect('email', 'password')).resolves.toBeTruthy();
82
+});
83
+
84
+test("connect good credentials no consent", () => {
85
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
86
+        return Promise.resolve({
87
+            json: () => {
88
+                return {
89
+                    error: ERROR_TYPE.NO_CONSENT,
90
+                    data: {}
91
+                };
92
+            },
93
+        })
94
+    });
95
+    return expect(c.connect('email', 'password'))
96
+        .rejects.toBe(ERROR_TYPE.NO_CONSENT);
97
+});
98
+
99
+test("connect good credentials, fail save token", () => {
100
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
101
+        return Promise.resolve({
102
+            json: () => {
103
+                return {
104
+                    error: ERROR_TYPE.SUCCESS,
105
+                    data: {token: 'token'}
106
+                };
107
+            },
108
+        })
109
+    });
110
+    jest.spyOn(ConnectionManager.prototype, 'saveLogin').mockImplementationOnce(() => {
111
+        return Promise.reject(false);
112
+    });
113
+    return expect(c.connect('email', 'password')).rejects.toBe(ERROR_TYPE.UNKNOWN);
114
+});
115
+
116
+test("connect connection error", () => {
117
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
118
+        return Promise.reject();
119
+    });
120
+    return expect(c.connect('email', 'password'))
121
+        .rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
122
+});
123
+
124
+test("connect bogus response 1", () => {
125
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
126
+        return Promise.resolve({
127
+            json: () => {
128
+                return {
129
+                    thing: true,
130
+                    wrong: '',
131
+                }
132
+            },
133
+        })
134
+    });
135
+    return expect(c.connect('email', 'password'))
136
+        .rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
137
+});
138
+
139
+
140
+test("authenticatedRequest success", () => {
141
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
142
+        return 'token';
143
+    });
144
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
145
+        return Promise.resolve({
146
+            json: () => {
147
+                return {
148
+                    error: ERROR_TYPE.SUCCESS,
149
+                    data: {coucou: 'toi'}
150
+                };
151
+            },
152
+        })
153
+    });
154
+    return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
155
+        .resolves.toStrictEqual({coucou: 'toi'});
156
+});
157
+
158
+test("authenticatedRequest error wrong token", () => {
159
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
160
+        return 'token';
161
+    });
162
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
163
+        return Promise.resolve({
164
+            json: () => {
165
+                return {
166
+                    error: ERROR_TYPE.BAD_TOKEN,
167
+                    data: {}
168
+                };
169
+            },
170
+        })
171
+    });
172
+    return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
173
+        .rejects.toBe(ERROR_TYPE.BAD_TOKEN);
174
+});
175
+
176
+test("authenticatedRequest error bogus response", () => {
177
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
178
+        return 'token';
179
+    });
180
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
181
+        return Promise.resolve({
182
+            json: () => {
183
+                return {
184
+                    error: ERROR_TYPE.SUCCESS,
185
+                };
186
+            },
187
+        })
188
+    });
189
+    return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
190
+        .rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
191
+});
192
+
193
+test("authenticatedRequest connection error", () => {
194
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
195
+        return 'token';
196
+    });
197
+    jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
198
+        return Promise.reject()
199
+    });
200
+    return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
201
+        .rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
202
+});
203
+
204
+test("authenticatedRequest error no token", () => {
205
+    jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
206
+        return null;
207
+    });
208
+    return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
209
+        .rejects.toBe(ERROR_TYPE.UNKNOWN);
210
+});

+ 210
- 0
__tests__/utils/PlanningEventManager.test.js View File

@@ -0,0 +1,210 @@
1
+import React from 'react';
2
+import * as Planning from "../../src/utils/Planning";
3
+
4
+test('isDescriptionEmpty', () => {
5
+    expect(Planning.isDescriptionEmpty("")).toBeTrue();
6
+    expect(Planning.isDescriptionEmpty("   ")).toBeTrue();
7
+    // noinspection CheckTagEmptyBody
8
+    expect(Planning.isDescriptionEmpty("<p></p>")).toBeTrue();
9
+    expect(Planning.isDescriptionEmpty("<p>   </p>")).toBeTrue();
10
+    expect(Planning.isDescriptionEmpty("<p><br></p>")).toBeTrue();
11
+    expect(Planning.isDescriptionEmpty("<p><br></p><p><br></p>")).toBeTrue();
12
+    expect(Planning.isDescriptionEmpty("<p><br><br><br></p>")).toBeTrue();
13
+    expect(Planning.isDescriptionEmpty("<p><br>")).toBeTrue();
14
+    expect(Planning.isDescriptionEmpty(null)).toBeTrue();
15
+    expect(Planning.isDescriptionEmpty(undefined)).toBeTrue();
16
+    expect(Planning.isDescriptionEmpty("coucou")).toBeFalse();
17
+    expect(Planning.isDescriptionEmpty("<p>coucou</p>")).toBeFalse();
18
+});
19
+
20
+test('isEventDateStringFormatValid', () => {
21
+    expect(Planning.isEventDateStringFormatValid("2020-03-21 09:00")).toBeTrue();
22
+    expect(Planning.isEventDateStringFormatValid("3214-64-12 01:16")).toBeTrue();
23
+
24
+    expect(Planning.isEventDateStringFormatValid("3214-64-12 01:16:00")).toBeFalse();
25
+    expect(Planning.isEventDateStringFormatValid("3214-64-12 1:16")).toBeFalse();
26
+    expect(Planning.isEventDateStringFormatValid("3214-f4-12 01:16")).toBeFalse();
27
+    expect(Planning.isEventDateStringFormatValid("sqdd 09:00")).toBeFalse();
28
+    expect(Planning.isEventDateStringFormatValid("2020-03-21")).toBeFalse();
29
+    expect(Planning.isEventDateStringFormatValid("2020-03-21 truc")).toBeFalse();
30
+    expect(Planning.isEventDateStringFormatValid("3214-64-12 1:16:65")).toBeFalse();
31
+    expect(Planning.isEventDateStringFormatValid("garbage")).toBeFalse();
32
+    expect(Planning.isEventDateStringFormatValid("")).toBeFalse();
33
+    expect(Planning.isEventDateStringFormatValid(undefined)).toBeFalse();
34
+    expect(Planning.isEventDateStringFormatValid(null)).toBeFalse();
35
+});
36
+
37
+test('stringToDate', () => {
38
+    let testDate = new Date();
39
+    expect(Planning.stringToDate(undefined)).toBeNull();
40
+    expect(Planning.stringToDate("")).toBeNull();
41
+    expect(Planning.stringToDate("garbage")).toBeNull();
42
+    expect(Planning.stringToDate("2020-03-21")).toBeNull();
43
+    expect(Planning.stringToDate("09:00:00")).toBeNull();
44
+    expect(Planning.stringToDate("2020-03-21 09:g0")).toBeNull();
45
+    expect(Planning.stringToDate("2020-03-21 09:g0:")).toBeNull();
46
+    testDate.setFullYear(2020, 2, 21);
47
+    testDate.setHours(9, 0, 0, 0);
48
+    expect(Planning.stringToDate("2020-03-21 09:00")).toEqual(testDate);
49
+    testDate.setFullYear(2020, 0, 31);
50
+    testDate.setHours(18, 30, 0, 0);
51
+    expect(Planning.stringToDate("2020-01-31 18:30")).toEqual(testDate);
52
+    testDate.setFullYear(2020, 50, 50);
53
+    testDate.setHours(65, 65, 0, 0);
54
+    expect(Planning.stringToDate("2020-51-50 65:65")).toEqual(testDate);
55
+});
56
+
57
+test('getFormattedEventTime', () => {
58
+    expect(Planning.getFormattedEventTime(null, null))
59
+        .toBe('/ - /');
60
+    expect(Planning.getFormattedEventTime(undefined, undefined))
61
+        .toBe('/ - /');
62
+    expect(Planning.getFormattedEventTime("20:30", "23:00"))
63
+        .toBe('/ - /');
64
+    expect(Planning.getFormattedEventTime("2020-03-30", "2020-03-31"))
65
+        .toBe('/ - /');
66
+
67
+
68
+    expect(Planning.getFormattedEventTime("2020-03-21 09:00", "2020-03-21 09:00"))
69
+        .toBe('09:00');
70
+    expect(Planning.getFormattedEventTime("2020-03-21 09:00", "2020-03-22 17:00"))
71
+        .toBe('09:00 - 23:59');
72
+    expect(Planning.getFormattedEventTime("2020-03-30 20:30", "2020-03-30 23:00"))
73
+        .toBe('20:30 - 23:00');
74
+});
75
+
76
+test('getDateOnlyString', () => {
77
+    expect(Planning.getDateOnlyString("2020-03-21 09:00")).toBe("2020-03-21");
78
+    expect(Planning.getDateOnlyString("2021-12-15 09:00")).toBe("2021-12-15");
79
+    expect(Planning.getDateOnlyString("2021-12-o5 09:00")).toBeNull();
80
+    expect(Planning.getDateOnlyString("2021-12-15 09:")).toBeNull();
81
+    expect(Planning.getDateOnlyString("2021-12-15")).toBeNull();
82
+    expect(Planning.getDateOnlyString("garbage")).toBeNull();
83
+});
84
+
85
+test('isEventBefore', () => {
86
+    expect(Planning.isEventBefore(
87
+        "2020-03-21 09:00", "2020-03-21 10:00")).toBeTrue();
88
+    expect(Planning.isEventBefore(
89
+        "2020-03-21 10:00", "2020-03-21 10:15")).toBeTrue();
90
+    expect(Planning.isEventBefore(
91
+        "2020-03-21 10:15", "2021-03-21 10:15")).toBeTrue();
92
+    expect(Planning.isEventBefore(
93
+        "2020-03-21 10:15", "2020-05-21 10:15")).toBeTrue();
94
+    expect(Planning.isEventBefore(
95
+        "2020-03-21 10:15", "2020-03-30 10:15")).toBeTrue();
96
+
97
+    expect(Planning.isEventBefore(
98
+        "2020-03-21 10:00", "2020-03-21 10:00")).toBeFalse();
99
+    expect(Planning.isEventBefore(
100
+        "2020-03-21 10:00", "2020-03-21 09:00")).toBeFalse();
101
+    expect(Planning.isEventBefore(
102
+        "2020-03-21 10:15", "2020-03-21 10:00")).toBeFalse();
103
+    expect(Planning.isEventBefore(
104
+        "2021-03-21 10:15", "2020-03-21 10:15")).toBeFalse();
105
+    expect(Planning.isEventBefore(
106
+        "2020-05-21 10:15", "2020-03-21 10:15")).toBeFalse();
107
+    expect(Planning.isEventBefore(
108
+        "2020-03-30 10:15", "2020-03-21 10:15")).toBeFalse();
109
+
110
+    expect(Planning.isEventBefore(
111
+        "garbage", "2020-03-21 10:15")).toBeFalse();
112
+    expect(Planning.isEventBefore(
113
+        undefined, undefined)).toBeFalse();
114
+});
115
+
116
+test('dateToString', () => {
117
+    let testDate = new Date();
118
+    testDate.setFullYear(2020, 2, 21);
119
+    testDate.setHours(9, 0, 0, 0);
120
+    expect(Planning.dateToString(testDate)).toBe("2020-03-21 09:00");
121
+    testDate.setFullYear(2021, 0, 12);
122
+    testDate.setHours(9, 10, 0, 0);
123
+    expect(Planning.dateToString(testDate)).toBe("2021-01-12 09:10");
124
+    testDate.setFullYear(2022, 11, 31);
125
+    testDate.setHours(9, 10, 15, 0);
126
+    expect(Planning.dateToString(testDate)).toBe("2022-12-31 09:10");
127
+});
128
+
129
+test('generateEmptyCalendar', () => {
130
+    jest.spyOn(Date, 'now')
131
+        .mockImplementation(() =>
132
+            new Date('2020-01-14T00:00:00.000Z').getTime()
133
+        );
134
+    let calendar = Planning.generateEmptyCalendar(1);
135
+    expect(calendar).toHaveProperty("2020-01-14");
136
+    expect(calendar).toHaveProperty("2020-01-20");
137
+    expect(calendar).toHaveProperty("2020-02-10");
138
+    expect(Object.keys(calendar).length).toBe(32);
139
+    calendar = Planning.generateEmptyCalendar(3);
140
+    expect(calendar).toHaveProperty("2020-01-14");
141
+    expect(calendar).toHaveProperty("2020-01-20");
142
+    expect(calendar).toHaveProperty("2020-02-10");
143
+    expect(calendar).toHaveProperty("2020-02-14");
144
+    expect(calendar).toHaveProperty("2020-03-20");
145
+    expect(calendar).toHaveProperty("2020-04-12");
146
+    expect(Object.keys(calendar).length).toBe(92);
147
+});
148
+
149
+test('pushEventInOrder', () => {
150
+    let eventArray = [];
151
+    let event1 = {date_begin: "2020-01-14 09:15"};
152
+    Planning.pushEventInOrder(eventArray, event1);
153
+    expect(eventArray.length).toBe(1);
154
+    expect(eventArray[0]).toBe(event1);
155
+
156
+    let event2 = {date_begin: "2020-01-14 10:15"};
157
+    Planning.pushEventInOrder(eventArray, event2);
158
+    expect(eventArray.length).toBe(2);
159
+    expect(eventArray[0]).toBe(event1);
160
+    expect(eventArray[1]).toBe(event2);
161
+
162
+    let event3 = {date_begin: "2020-01-14 10:15", title: "garbage"};
163
+    Planning.pushEventInOrder(eventArray, event3);
164
+    expect(eventArray.length).toBe(3);
165
+    expect(eventArray[0]).toBe(event1);
166
+    expect(eventArray[1]).toBe(event2);
167
+    expect(eventArray[2]).toBe(event3);
168
+
169
+    let event4 = {date_begin: "2020-01-13 09:00"};
170
+    Planning.pushEventInOrder(eventArray, event4);
171
+    expect(eventArray.length).toBe(4);
172
+    expect(eventArray[0]).toBe(event4);
173
+    expect(eventArray[1]).toBe(event1);
174
+    expect(eventArray[2]).toBe(event2);
175
+    expect(eventArray[3]).toBe(event3);
176
+});
177
+
178
+test('generateEventAgenda', () => {
179
+    jest.spyOn(Date, 'now')
180
+        .mockImplementation(() =>
181
+            new Date('2020-01-14T00:00:00.000Z').getTime()
182
+        );
183
+    let eventList = [
184
+        {date_begin: "2020-01-14 09:15"},
185
+        {date_begin: "2020-02-01 09:15"},
186
+        {date_begin: "2020-01-15 09:15"},
187
+        {date_begin: "2020-02-01 09:30"},
188
+        {date_begin: "2020-02-01 08:30"},
189
+    ];
190
+    const calendar = Planning.generateEventAgenda(eventList, 2);
191
+    expect(calendar["2020-01-14"].length).toBe(1);
192
+    expect(calendar["2020-01-14"][0]).toBe(eventList[0]);
193
+    expect(calendar["2020-01-15"].length).toBe(1);
194
+    expect(calendar["2020-01-15"][0]).toBe(eventList[2]);
195
+    expect(calendar["2020-02-01"].length).toBe(3);
196
+    expect(calendar["2020-02-01"][0]).toBe(eventList[4]);
197
+    expect(calendar["2020-02-01"][1]).toBe(eventList[1]);
198
+    expect(calendar["2020-02-01"][2]).toBe(eventList[3]);
199
+});
200
+
201
+test('getCurrentDateString', () => {
202
+    jest.spyOn(Date, 'now')
203
+        .mockImplementation(() => {
204
+            let date = new Date();
205
+            date.setFullYear(2020, 0, 14);
206
+            date.setHours(15, 30, 54, 65);
207
+            return date.getTime();
208
+        });
209
+    expect(Planning.getCurrentDateString()).toBe('2020-01-14 15:30');
210
+});

+ 142
- 0
__tests__/utils/Proxiwash.test.js View File

@@ -0,0 +1,142 @@
1
+import React from 'react';
2
+import {getCleanedMachineWatched, getMachineEndDate, getMachineOfId, isMachineWatched} from "../../src/utils/Proxiwash";
3
+
4
+test('getMachineEndDate', () => {
5
+    jest.spyOn(Date, 'now')
6
+        .mockImplementation(() =>
7
+            new Date('2020-01-14T15:00:00.000Z').getTime()
8
+        );
9
+    let expectDate = new Date('2020-01-14T15:00:00.000Z');
10
+    expectDate.setHours(23);
11
+    expectDate.setMinutes(10);
12
+    expect(getMachineEndDate({endTime: "23:10"}).getTime()).toBe(expectDate.getTime());
13
+
14
+    expectDate.setHours(16);
15
+    expectDate.setMinutes(30);
16
+    expect(getMachineEndDate({endTime: "16:30"}).getTime()).toBe(expectDate.getTime());
17
+
18
+    expect(getMachineEndDate({endTime: "15:30"})).toBeNull();
19
+
20
+    expect(getMachineEndDate({endTime: "13:10"})).toBeNull();
21
+
22
+    jest.spyOn(Date, 'now')
23
+        .mockImplementation(() =>
24
+            new Date('2020-01-14T23:00:00.000Z').getTime()
25
+        );
26
+    expectDate = new Date('2020-01-14T23:00:00.000Z');
27
+    expectDate.setHours(0);
28
+    expectDate.setMinutes(30);
29
+    expect(getMachineEndDate({endTime: "00:30"}).getTime()).toBe(expectDate.getTime());
30
+});
31
+
32
+test('isMachineWatched', () => {
33
+    let machineList = [
34
+        {
35
+            number: "0",
36
+            endTime: "23:30",
37
+        },
38
+        {
39
+            number: "1",
40
+            endTime: "20:30",
41
+        },
42
+    ];
43
+    expect(isMachineWatched({number: "0", endTime: "23:30"}, machineList)).toBeTrue();
44
+    expect(isMachineWatched({number: "1", endTime: "20:30"}, machineList)).toBeTrue();
45
+    expect(isMachineWatched({number: "3", endTime: "20:30"}, machineList)).toBeFalse();
46
+    expect(isMachineWatched({number: "1", endTime: "23:30"}, machineList)).toBeFalse();
47
+});
48
+
49
+test('getMachineOfId', () => {
50
+    let machineList = [
51
+        {
52
+            number: "0",
53
+        },
54
+        {
55
+            number: "1",
56
+        },
57
+    ];
58
+    expect(getMachineOfId("0", machineList)).toStrictEqual({number: "0"});
59
+    expect(getMachineOfId("1", machineList)).toStrictEqual({number: "1"});
60
+    expect(getMachineOfId("3", machineList)).toBeNull();
61
+});
62
+
63
+test('getCleanedMachineWatched', () => {
64
+    let machineList = [
65
+        {
66
+            number: "0",
67
+            endTime: "23:30",
68
+        },
69
+        {
70
+            number: "1",
71
+            endTime: "20:30",
72
+        },
73
+        {
74
+            number: "2",
75
+            endTime: "",
76
+        },
77
+    ];
78
+    let watchList = [
79
+        {
80
+            number: "0",
81
+            endTime: "23:30",
82
+        },
83
+        {
84
+            number: "1",
85
+            endTime: "20:30",
86
+        },
87
+        {
88
+            number: "2",
89
+            endTime: "",
90
+        },
91
+    ];
92
+    let cleanedList = watchList;
93
+    expect(getCleanedMachineWatched(watchList, machineList)).toStrictEqual(cleanedList);
94
+
95
+    watchList = [
96
+        {
97
+            number: "0",
98
+            endTime: "23:30",
99
+        },
100
+        {
101
+            number: "1",
102
+            endTime: "20:30",
103
+        },
104
+        {
105
+            number: "2",
106
+            endTime: "15:30",
107
+        },
108
+    ];
109
+    cleanedList = [
110
+        {
111
+            number: "0",
112
+            endTime: "23:30",
113
+        },
114
+        {
115
+            number: "1",
116
+            endTime: "20:30",
117
+        },
118
+    ];
119
+    expect(getCleanedMachineWatched(watchList, machineList)).toStrictEqual(cleanedList);
120
+
121
+    watchList = [
122
+        {
123
+            number: "0",
124
+            endTime: "23:30",
125
+        },
126
+        {
127
+            number: "1",
128
+            endTime: "20:31",
129
+        },
130
+        {
131
+            number: "3",
132
+            endTime: "15:30",
133
+        },
134
+    ];
135
+    cleanedList = [
136
+        {
137
+            number: "0",
138
+            endTime: "23:30",
139
+        },
140
+    ];
141
+    expect(getCleanedMachineWatched(watchList, machineList)).toStrictEqual(cleanedList);
142
+});

+ 45
- 0
__tests__/utils/WebData.js View File

@@ -0,0 +1,45 @@
1
+import React from 'react';
2
+import {isResponseValid} from "../../src/utils/WebData";
3
+
4
+let fetch = require('isomorphic-fetch'); // fetch is not implemented in nodeJS but in react-native
5
+
6
+test('isRequestResponseValid', () => {
7
+    let json = {
8
+        error: 0,
9
+        data: {}
10
+    };
11
+    expect(isResponseValid(json)).toBeTrue();
12
+    json = {
13
+        error: 1,
14
+        data: {}
15
+    };
16
+    expect(isResponseValid(json)).toBeTrue();
17
+    json = {
18
+        error: 50,
19
+        data: {}
20
+    };
21
+    expect(isResponseValid(json)).toBeTrue();
22
+    json = {
23
+        error: 50,
24
+        data: {truc: 'machin'}
25
+    };
26
+    expect(isResponseValid(json)).toBeTrue();
27
+    json = {
28
+        message: 'coucou'
29
+    };
30
+    expect(isResponseValid(json)).toBeFalse();
31
+    json = {
32
+        error: 'coucou',
33
+        data: {truc: 'machin'}
34
+    };
35
+    expect(isResponseValid(json)).toBeFalse();
36
+    json = {
37
+        error: 0,
38
+        data: 'coucou'
39
+    };
40
+    expect(isResponseValid(json)).toBeFalse();
41
+    json = {
42
+        error: 0,
43
+    };
44
+    expect(isResponseValid(json)).toBeFalse();
45
+});

+ 55
- 0
android/app/BUCK View File

@@ -0,0 +1,55 @@
1
+# To learn about Buck see [Docs](https://buckbuild.com/).
2
+# To run your application with Buck:
3
+# - install Buck
4
+# - `npm start` - to start the packager
5
+# - `cd android`
6
+# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7
+# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8
+# - `buck install -r android/app` - compile, install and run application
9
+#
10
+
11
+load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12
+
13
+lib_deps = []
14
+
15
+create_aar_targets(glob(["libs/*.aar"]))
16
+
17
+create_jar_targets(glob(["libs/*.jar"]))
18
+
19
+android_library(
20
+    name = "all-libs",
21
+    exported_deps = lib_deps,
22
+)
23
+
24
+android_library(
25
+    name = "app-code",
26
+    srcs = glob([
27
+        "src/main/java/**/*.java",
28
+    ]),
29
+    deps = [
30
+        ":all-libs",
31
+        ":build_config",
32
+        ":res",
33
+    ],
34
+)
35
+
36
+android_build_config(
37
+    name = "build_config",
38
+    package = "fr.amicaleinsat.application",
39
+)
40
+
41
+android_resource(
42
+    name = "res",
43
+    package = "fr.amicaleinsat.application",
44
+    res = "src/main/res",
45
+)
46
+
47
+android_binary(
48
+    name = "app",
49
+    keystore = "//android/keystores:debug",
50
+    manifest = "src/main/AndroidManifest.xml",
51
+    package_type = "debug",
52
+    deps = [
53
+        ":app-code",
54
+    ],
55
+)

+ 215
- 0
android/app/build.gradle View File

@@ -0,0 +1,215 @@
1
+apply plugin: "com.android.application"
2
+
3
+import com.android.build.OutputFile
4
+
5
+/**
6
+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7
+ * and bundleReleaseJsAndAssets).
8
+ * These basically call `react-native bundle` with the correct arguments during the Android build
9
+ * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10
+ * bundle directly from the development server. Below you can see all the possible configurations
11
+ * and their defaults. If you decide to add a configuration block, make sure to add it before the
12
+ * `apply from: "../../node_modules/react-native/react.gradle"` line.
13
+ *
14
+ * project.ext.react = [
15
+ *   // the name of the generated asset file containing your JS bundle
16
+ *   bundleAssetName: "index.android.bundle",
17
+ *
18
+ *   // the entry file for bundle generation
19
+ *   entryFile: "index.android.js",
20
+ *
21
+ *   // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
22
+ *   bundleCommand: "ram-bundle",
23
+ *
24
+ *   // whether to bundle JS and assets in debug mode
25
+ *   bundleInDebug: false,
26
+ *
27
+ *   // whether to bundle JS and assets in release mode
28
+ *   bundleInRelease: true,
29
+ *
30
+ *   // whether to bundle JS and assets in another build variant (if configured).
31
+ *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32
+ *   // The configuration property can be in the following formats
33
+ *   //         'bundleIn${productFlavor}${buildType}'
34
+ *   //         'bundleIn${buildType}'
35
+ *   // bundleInFreeDebug: true,
36
+ *   // bundleInPaidRelease: true,
37
+ *   // bundleInBeta: true,
38
+ *
39
+ *   // whether to disable dev mode in custom build variants (by default only disabled in release)
40
+ *   // for example: to disable dev mode in the staging build type (if configured)
41
+ *   devDisabledInStaging: true,
42
+ *   // The configuration property can be in the following formats
43
+ *   //         'devDisabledIn${productFlavor}${buildType}'
44
+ *   //         'devDisabledIn${buildType}'
45
+ *
46
+ *   // the root of your project, i.e. where "package.json" lives
47
+ *   root: "../../",
48
+ *
49
+ *   // where to put the JS bundle asset in debug mode
50
+ *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51
+ *
52
+ *   // where to put the JS bundle asset in release mode
53
+ *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54
+ *
55
+ *   // where to put drawable resources / React Native assets, e.g. the ones you use via
56
+ *   // require('./image.png')), in debug mode
57
+ *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58
+ *
59
+ *   // where to put drawable resources / React Native assets, e.g. the ones you use via
60
+ *   // require('./image.png')), in release mode
61
+ *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62
+ *
63
+ *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64
+ *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65
+ *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
66
+ *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67
+ *   // for example, you might want to remove it from here.
68
+ *   inputExcludes: ["android/**", "ios/**"],
69
+ *
70
+ *   // override which node gets called and with what additional arguments
71
+ *   nodeExecutableAndArgs: ["node"],
72
+ *
73
+ *   // supply additional arguments to the packager
74
+ *   extraPackagerArgs: []
75
+ * ]
76
+ */
77
+
78
+project.ext.react = [
79
+    entryFile: "index.js",
80
+    enableHermes: false,
81
+]
82
+
83
+apply from: "../../node_modules/react-native/react.gradle"
84
+
85
+project.ext.vectoricons = [
86
+    iconFontNames: [ 'MaterialCommunityIcons.ttf'] // Name of the font files you want to copy
87
+]
88
+apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
89
+
90
+/**
91
+ * Set this to true to create two separate APKs instead of one:
92
+ *   - An APK that only works on ARM devices
93
+ *   - An APK that only works on x86 devices
94
+ * The advantage is the size of the APK is reduced by about 4MB.
95
+ * Upload all the APKs to the Play Store and people will download
96
+ * the correct one based on the CPU architecture of their device.
97
+ */
98
+def enableSeparateBuildPerCPUArchitecture = false
99
+
100
+/**
101
+ * Run Proguard to shrink the Java bytecode in release builds.
102
+ */
103
+def enableProguardInReleaseBuilds = false
104
+
105
+/**
106
+ * The preferred build flavor of JavaScriptCore.
107
+ *
108
+ * For example, to use the international variant, you can use:
109
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
110
+ *
111
+ * The international variant includes ICU i18n library and necessary data
112
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
113
+ * give correct results when using with locales other than en-US.  Note that
114
+ * this variant is about 6MiB larger per architecture than default.
115
+ */
116
+def jscFlavor = 'org.webkit:android-jsc:+'
117
+
118
+/**
119
+ * Whether to enable the Hermes VM.
120
+ *
121
+ * This should be set on project.ext.react and mirrored here.  If it is not set
122
+ * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
123
+ * and the benefits of using Hermes will therefore be sharply reduced.
124
+ */
125
+def enableHermes = project.ext.react.get("enableHermes", false);
126
+
127
+android {
128
+    compileSdkVersion rootProject.ext.compileSdkVersion
129
+
130
+    compileOptions {
131
+        sourceCompatibility JavaVersion.VERSION_1_8
132
+        targetCompatibility JavaVersion.VERSION_1_8
133
+    }
134
+
135
+    defaultConfig {
136
+        applicationId 'fr.amicaleinsat.application'
137
+        minSdkVersion rootProject.ext.minSdkVersion
138
+        targetSdkVersion rootProject.ext.targetSdkVersion
139
+        versionCode 19
140
+        versionName "3.0.2"
141
+        missingDimensionStrategy 'react-native-camera', 'general'
142
+    }
143
+    splits {
144
+        abi {
145
+            reset()
146
+            enable enableSeparateBuildPerCPUArchitecture
147
+            universalApk false  // If true, also generate a universal APK
148
+            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
149
+        }
150
+    }
151
+    signingConfigs {
152
+        debug {
153
+            storeFile file('debug.keystore')
154
+            storePassword 'android'
155
+            keyAlias 'androiddebugkey'
156
+            keyPassword 'android'
157
+        }
158
+        release {
159
+            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
160
+                storeFile file(MYAPP_UPLOAD_STORE_FILE)
161
+                storePassword MYAPP_UPLOAD_STORE_PASSWORD
162
+                keyAlias MYAPP_UPLOAD_KEY_ALIAS
163
+                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
164
+            }
165
+        }
166
+    }
167
+    buildTypes {
168
+        debug {
169
+            signingConfig signingConfigs.debug
170
+        }
171
+        release {
172
+            // Caution! In production, you need to generate your own keystore file.
173
+            // see https://facebook.github.io/react-native/docs/signed-apk-android.
174
+            signingConfig signingConfigs.release
175
+            minifyEnabled enableProguardInReleaseBuilds
176
+            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
177
+        }
178
+    }
179
+    // applicationVariants are e.g. debug, release
180
+    applicationVariants.all { variant ->
181
+        variant.outputs.each { output ->
182
+            // For each separate APK per architecture, set a unique version code as described here:
183
+            // https://developer.android.com/studio/build/configure-apk-splits.html
184
+            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
185
+            def abi = output.getFilter(OutputFile.ABI)
186
+            if (abi != null) {  // null for the universal-debug, universal-release variants
187
+                output.versionCodeOverride =
188
+                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
189
+            }
190
+
191
+        }
192
+    }
193
+}
194
+
195
+dependencies {
196
+    implementation fileTree(dir: "libs", include: ["*.jar"])
197
+    implementation "com.facebook.react:react-native:+"  // From node_modules
198
+
199
+    if (enableHermes) {
200
+        def hermesPath = "../../node_modules/hermes-engine/android/";
201
+        debugImplementation files(hermesPath + "hermes-debug.aar")
202
+        releaseImplementation files(hermesPath + "hermes-release.aar")
203
+    } else {
204
+        implementation jscFlavor
205
+    }
206
+}
207
+
208
+// Run this once to be able to run the application with BUCK
209
+// puts all compile dependencies into folder libs for BUCK to use
210
+task copyDownloadableDepsToLibs(type: Copy) {
211
+    from configurations.compile
212
+    into 'libs'
213
+}
214
+
215
+apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

+ 19
- 0
android/app/build_defs.bzl View File

@@ -0,0 +1,19 @@
1
+"""Helper definitions to glob .aar and .jar targets"""
2
+
3
+def create_aar_targets(aarfiles):
4
+    for aarfile in aarfiles:
5
+        name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6
+        lib_deps.append(":" + name)
7
+        android_prebuilt_aar(
8
+            name = name,
9
+            aar = aarfile,
10
+        )
11
+
12
+def create_jar_targets(jarfiles):
13
+    for jarfile in jarfiles:
14
+        name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15
+        lib_deps.append(":" + name)
16
+        prebuilt_jar(
17
+            name = name,
18
+            binary_jar = jarfile,
19
+        )

+ 13
- 0
android/app/proguard-rules.pro View File

@@ -0,0 +1,13 @@
1
+# Add project specific ProGuard rules here.
2
+# By default, the flags in this file are appended to flags specified
3
+# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+# You can edit the include path and order by changing the proguardFiles
5
+# directive in build.gradle.
6
+#
7
+# For more details, see
8
+#   http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+# Add any project specific keep options here:
11
+
12
+-keep class com.facebook.hermes.unicode.** { *; }
13
+-keep class com.facebook.jni.** { *; }

+ 7
- 0
android/app/src/debug/AndroidManifest.xml View File

@@ -0,0 +1,7 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:tools="http://schemas.android.com/tools">
3
+
4
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
5
+
6
+    <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7
+</manifest>

+ 66
- 0
android/app/src/main/AndroidManifest.xml View File

@@ -0,0 +1,66 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="fr.amicaleinsat.application">
2
+    <uses-permission android:name="android.permission.INTERNET"/>
3
+    <uses-permission android:name="android.permission.CAMERA"/>
4
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
5
+    <uses-permission android:name="android.permission.VIBRATE" />
6
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
7
+    <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
8
+
9
+    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
10
+    <application
11
+            android:name=".MainApplication"
12
+            android:label="@string/app_name"
13
+            android:icon="@mipmap/ic_launcher"
14
+            android:roundIcon="@mipmap/ic_launcher_round"
15
+            android:allowBackup="false"
16
+            android:theme="@style/AppTheme"
17
+            android:usesCleartextTraffic="true"
18
+    >
19
+<!--        NOTIFICATIONS -->
20
+        <meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_name"
21
+                    android:value="reminders"/>
22
+        <meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_description"
23
+                    android:value="reminders"/>
24
+        <!-- Change the resource name to your App's accent color - or any other color you want -->
25
+        <meta-data  android:name="com.dieam.reactnativepushnotification.notification_color"
26
+                    android:resource="@color/colorPrimary"/> <!-- or @android:color/{name} to use a standard color -->
27
+
28
+        <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
29
+        <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
30
+            <intent-filter>
31
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
32
+            </intent-filter>
33
+        </receiver>
34
+
35
+        <service
36
+                android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
37
+                android:exported="false" >
38
+            <intent-filter>
39
+                <action android:name="com.google.firebase.MESSAGING_EVENT" />
40
+            </intent-filter>
41
+        </service>
42
+
43
+<!--        END NOTIFICATIONS-->
44
+
45
+
46
+        <meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="false"/>
47
+        <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
48
+        <meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/>
49
+        <activity android:name=".MainActivity" android:label="@string/app_name"
50
+                  android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
51
+                  android:launchMode="singleTask" android:windowSoftInputMode="adjustResize"
52
+                  android:screenOrientation="portrait">
53
+            <intent-filter>
54
+                <action android:name="android.intent.action.MAIN"/>
55
+                <category android:name="android.intent.category.LAUNCHER"/>
56
+            </intent-filter>
57
+            <intent-filter>
58
+                <action android:name="android.intent.action.VIEW"/>
59
+                <category android:name="android.intent.category.DEFAULT"/>
60
+                <category android:name="android.intent.category.BROWSABLE"/>
61
+                <data android:scheme="campus-insat"/>
62
+            </intent-filter>
63
+        </activity>
64
+        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
65
+    </application>
66
+</manifest>

+ 0
- 0
android/app/src/main/assets/app.bundle View File


+ 1
- 0
android/app/src/main/assets/app.manifest View File

@@ -0,0 +1 @@
1
+{}

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

@@ -0,0 +1,48 @@
1
+package fr.amicaleinsat.application;
2
+
3
+import android.os.Bundle;
4
+import com.facebook.react.ReactActivity;
5
+import com.facebook.react.ReactActivityDelegate;
6
+import com.facebook.react.ReactRootView;
7
+import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
8
+import android.content.Intent;
9
+import android.content.res.Configuration;
10
+
11
+import org.devio.rn.splashscreen.SplashScreen;
12
+
13
+public class MainActivity extends ReactActivity {
14
+
15
+    // Added automatically by Expo Config
16
+    @Override
17
+    public void onConfigurationChanged(Configuration newConfig) {
18
+        super.onConfigurationChanged(newConfig);
19
+        Intent intent = new Intent("onConfigurationChanged");
20
+        intent.putExtra("newConfig", newConfig);
21
+        sendBroadcast(intent);
22
+    }
23
+
24
+   @Override
25
+    protected void onCreate(Bundle savedInstanceState) {
26
+        SplashScreen.show(this);
27
+        super.onCreate(savedInstanceState);
28
+    }
29
+
30
+    /**
31
+     * Returns the name of the main component registered from JavaScript.
32
+     * This is used to schedule rendering of the component.
33
+     */
34
+    @Override
35
+    protected String getMainComponentName() {
36
+        return "main";
37
+    }
38
+
39
+    @Override
40
+    protected ReactActivityDelegate createReactActivityDelegate() {
41
+        return new ReactActivityDelegate(this, getMainComponentName()) {
42
+            @Override
43
+            protected ReactRootView createRootView() {
44
+                return new RNGestureHandlerEnabledRootView(MainActivity.this);
45
+            }
46
+        };
47
+    }
48
+}

+ 75
- 0
android/app/src/main/java/fr/amicaleinsat/application/MainApplication.java View File

@@ -0,0 +1,75 @@
1
+package fr.amicaleinsat.application;
2
+
3
+import android.app.Application;
4
+import android.content.Context;
5
+
6
+import com.facebook.react.PackageList;
7
+import com.facebook.react.ReactApplication;
8
+import com.facebook.react.ReactNativeHost;
9
+import com.facebook.react.ReactPackage;
10
+import com.facebook.react.shell.MainReactPackage;
11
+import com.facebook.soloader.SoLoader;
12
+
13
+import java.lang.reflect.InvocationTargetException;
14
+import java.util.Arrays;
15
+import java.util.List;
16
+import javax.annotation.Nullable;
17
+
18
+public class MainApplication extends Application implements ReactApplication {
19
+
20
+  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
21
+    @Override
22
+    public boolean getUseDeveloperSupport() {
23
+      return BuildConfig.DEBUG;
24
+    }
25
+
26
+    @Override
27
+    protected List<ReactPackage> getPackages() {
28
+      List<ReactPackage> packages = new PackageList(this).getPackages();
29
+      return packages;
30
+    }
31
+
32
+    @Override
33
+    protected String getJSMainModuleName() {
34
+      return "index";
35
+    }
36
+  };
37
+
38
+  @Override
39
+  public ReactNativeHost getReactNativeHost() {
40
+    return mReactNativeHost;
41
+  }
42
+
43
+  @Override
44
+  public void onCreate() {
45
+    super.onCreate();
46
+    SoLoader.init(this, /* native exopackage */ false);
47
+    initializeFlipper(this); // Remove this line if you don't want Flipper enabled
48
+  }
49
+
50
+  /**
51
+   * Loads Flipper in React Native templates.
52
+   *
53
+   * @param context
54
+   */
55
+  private static void initializeFlipper(Context context) {
56
+    if (BuildConfig.DEBUG) {
57
+      try {
58
+        /*
59
+         We use reflection here to pick up the class that initializes Flipper,
60
+        since Flipper library is not available in release mode
61
+        */
62
+        Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
63
+        aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
64
+      } catch (ClassNotFoundException e) {
65
+        e.printStackTrace();
66
+      } catch (NoSuchMethodException e) {
67
+        e.printStackTrace();
68
+      } catch (IllegalAccessException e) {
69
+        e.printStackTrace();
70
+      } catch (InvocationTargetException e) {
71
+        e.printStackTrace();
72
+      }
73
+    }
74
+  }
75
+}

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>

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png View File


BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png View File


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png View File


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png View File


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png View File


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png View File


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png View File


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png View File


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png View File


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png View File


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

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+<resources>
3
+  <color name="activityBackground">#be1522</color>
4
+  <color name="navigationBarColor">#121212</color>
5
+  <color name="colorPrimaryDark">#be1522</color>
6
+  <color name="colorPrimary">#be1522</color>
7
+  <color name="primary_dark">#be1522</color>
8
+</resources>

+ 3
- 0
android/app/src/main/res/values/strings.xml View File

@@ -0,0 +1,3 @@
1
+<resources>
2
+    <string name="app_name">Campus</string>
3
+</resources>

+ 10
- 0
android/app/src/main/res/values/styles.xml View File

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+<resources>
3
+  <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4
+    <item name="android:textColor">#000000</item>
5
+    <item name="android:windowBackground">@color/activityBackground</item>
6
+    <item name="android:navigationBarColor">@color/navigationBarColor</item>
7
+    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8
+    <item name="colorPrimary">@color/colorPrimary</item>
9
+  </style>
10
+</resources>

+ 27
- 0
android/app/src/release/AndroidManifest.xml View File

@@ -0,0 +1,27 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:tools="http://schemas.android.com/tools">
3
+
4
+    <uses-permission android:name="android.permission.INTERNET"/>
5
+    <uses-permission android:name="android.permission.CAMERA" />
6
+    <uses-permission android:name="android.permission.WAKE_LOCK"/>
7
+    <uses-permission android:name="android.permission.VIBRATE"/>
8
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
9
+    <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
10
+
11
+    <uses-permission tools:node="remove" android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
12
+    <uses-permission tools:node="remove" android:name="android.permission.MANAGE_DOCUMENTS"/>
13
+    <uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE"/>
14
+    <uses-permission tools:node="remove" android:name="android.permission.USE_FINGERPRINT"/>
15
+    <uses-permission tools:node="remove" android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
16
+    <uses-permission tools:node="remove" android:name="android.permission.ACCESS_COARSE_LOCATION"/>
17
+    <uses-permission tools:node="remove" android:name="android.permission.ACCESS_FINE_LOCATION"/>
18
+    <uses-permission tools:node="remove" android:name="android.permission.READ_CONTACTS"/>
19
+    <uses-permission tools:node="remove" android:name="android.permission.READ_CALENDAR"/>
20
+    <uses-permission tools:node="remove" android:name="android.permission.WRITE_CALENDAR"/>
21
+    <uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE"/>
22
+    <uses-permission tools:node="remove" android:name="android.permission.RECORD_AUDIO"/>
23
+    <uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
24
+    <uses-permission tools:node="remove" android:name="android.permission.WRITE_SETTINGS"/>
25
+    <uses-permission tools:node="remove" android:name="android.permission.ACCESS_NETWORK_STATE"/>
26
+
27
+</manifest>

+ 41
- 0
android/build.gradle View File

@@ -0,0 +1,41 @@
1
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
+
3
+buildscript {
4
+    ext {
5
+        buildToolsVersion = "28.0.3"
6
+        minSdkVersion = 21
7
+        compileSdkVersion = 28
8
+        targetSdkVersion = 28
9
+    }
10
+    repositories {
11
+        google()
12
+        jcenter()
13
+    }
14
+    dependencies {
15
+        classpath("com.android.tools.build:gradle:3.5.3")
16
+
17
+        // NOTE: Do not place your application dependencies here; they belong
18
+        // in the individual module build.gradle files
19
+    }
20
+}
21
+
22
+allprojects {
23
+    repositories {
24
+        mavenLocal()
25
+        maven {
26
+            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27
+            url("$rootDir/../node_modules/react-native/android")
28
+        }
29
+        maven {
30
+            // Android JSC is installed from npm
31
+            url("$rootDir/../node_modules/jsc-android/dist")
32
+        }
33
+        maven {
34
+            // expo-camera bundles a custom com.google.android:cameraview
35
+            url "$rootDir/../node_modules/expo-camera/android/maven"
36
+        }
37
+        google()
38
+        jcenter()
39
+        maven { url 'https://jitpack.io' }
40
+    }
41
+}

BIN
android/gradle/wrapper/gradle-wrapper.jar View File


+ 5
- 0
android/gradle/wrapper/gradle-wrapper.properties View File

@@ -0,0 +1,5 @@
1
+distributionBase=GRADLE_USER_HOME
2
+distributionPath=wrapper/dists
3
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip
4
+zipStoreBase=GRADLE_USER_HOME
5
+zipStorePath=wrapper/dists

+ 188
- 0
android/gradlew View File

@@ -0,0 +1,188 @@
1
+#!/usr/bin/env sh
2
+
3
+#
4
+# Copyright 2015 the original author or authors.
5
+#
6
+# Licensed under the Apache License, Version 2.0 (the "License");
7
+# you may not use this file except in compliance with the License.
8
+# You may obtain a copy of the License at
9
+#
10
+#      http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+# Unless required by applicable law or agreed to in writing, software
13
+# distributed under the License is distributed on an "AS IS" BASIS,
14
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+# See the License for the specific language governing permissions and
16
+# limitations under the License.
17
+#
18
+
19
+##############################################################################
20
+##
21
+##  Gradle start up script for UN*X
22
+##
23
+##############################################################################
24
+
25
+# Attempt to set APP_HOME
26
+# Resolve links: $0 may be a link
27
+PRG="$0"
28
+# Need this for relative symlinks.
29
+while [ -h "$PRG" ] ; do
30
+    ls=`ls -ld "$PRG"`
31
+    link=`expr "$ls" : '.*-> \(.*\)$'`
32
+    if expr "$link" : '/.*' > /dev/null; then
33
+        PRG="$link"
34
+    else
35
+        PRG=`dirname "$PRG"`"/$link"
36
+    fi
37
+done
38
+SAVED="`pwd`"
39
+cd "`dirname \"$PRG\"`/" >/dev/null
40
+APP_HOME="`pwd -P`"
41
+cd "$SAVED" >/dev/null
42
+
43
+APP_NAME="Gradle"
44
+APP_BASE_NAME=`basename "$0"`
45
+
46
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48
+
49
+# Use the maximum available, or set MAX_FD != -1 to use that value.
50
+MAX_FD="maximum"
51
+
52
+warn () {
53
+    echo "$*"
54
+}
55
+
56
+die () {
57
+    echo
58
+    echo "$*"
59
+    echo
60
+    exit 1
61
+}
62
+
63
+# OS specific support (must be 'true' or 'false').
64
+cygwin=false
65
+msys=false
66
+darwin=false
67
+nonstop=false
68
+case "`uname`" in
69
+  CYGWIN* )
70
+    cygwin=true
71
+    ;;
72
+  Darwin* )
73
+    darwin=true
74
+    ;;
75
+  MINGW* )
76
+    msys=true
77
+    ;;
78
+  NONSTOP* )
79
+    nonstop=true
80
+    ;;
81
+esac
82
+
83
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84
+
85
+# Determine the Java command to use to start the JVM.
86
+if [ -n "$JAVA_HOME" ] ; then
87
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88
+        # IBM's JDK on AIX uses strange locations for the executables
89
+        JAVACMD="$JAVA_HOME/jre/sh/java"
90
+    else
91
+        JAVACMD="$JAVA_HOME/bin/java"
92
+    fi
93
+    if [ ! -x "$JAVACMD" ] ; then
94
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95
+
96
+Please set the JAVA_HOME variable in your environment to match the
97
+location of your Java installation."
98
+    fi
99
+else
100
+    JAVACMD="java"
101
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102
+
103
+Please set the JAVA_HOME variable in your environment to match the
104
+location of your Java installation."
105
+fi
106
+
107
+# Increase the maximum file descriptors if we can.
108
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109
+    MAX_FD_LIMIT=`ulimit -H -n`
110
+    if [ $? -eq 0 ] ; then
111
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112
+            MAX_FD="$MAX_FD_LIMIT"
113
+        fi
114
+        ulimit -n $MAX_FD
115
+        if [ $? -ne 0 ] ; then
116
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
117
+        fi
118
+    else
119
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120
+    fi
121
+fi
122
+
123
+# For Darwin, add options to specify how the application appears in the dock
124
+if $darwin; then
125
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126
+fi
127
+
128
+# For Cygwin, switch paths to Windows format before running java
129
+if $cygwin ; then
130
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132
+    JAVACMD=`cygpath --unix "$JAVACMD"`
133
+
134
+    # We build the pattern for arguments to be converted via cygpath
135
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136
+    SEP=""
137
+    for dir in $ROOTDIRSRAW ; do
138
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
139
+        SEP="|"
140
+    done
141
+    OURCYGPATTERN="(^($ROOTDIRS))"
142
+    # Add a user-defined pattern to the cygpath arguments
143
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145
+    fi
146
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
147
+    i=0
148
+    for arg in "$@" ; do
149
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
151
+
152
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
153
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154
+        else
155
+            eval `echo args$i`="\"$arg\""
156
+        fi
157
+        i=$((i+1))
158
+    done
159
+    case $i in
160
+        (0) set -- ;;
161
+        (1) set -- "$args0" ;;
162
+        (2) set -- "$args0" "$args1" ;;
163
+        (3) set -- "$args0" "$args1" "$args2" ;;
164
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170
+    esac
171
+fi
172
+
173
+# Escape application args
174
+save () {
175
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176
+    echo " "
177
+}
178
+APP_ARGS=$(save "$@")
179
+
180
+# Collect all arguments for the java command, following the shell quoting and substitution rules
181
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182
+
183
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185
+  cd "$(dirname "$0")"
186
+fi
187
+
188
+exec "$JAVACMD" "$@"

+ 100
- 0
android/gradlew.bat View File

@@ -0,0 +1,100 @@
1
+@rem
2
+@rem Copyright 2015 the original author or authors.
3
+@rem
4
+@rem Licensed under the Apache License, Version 2.0 (the "License");
5
+@rem you may not use this file except in compliance with the License.
6
+@rem You may obtain a copy of the License at
7
+@rem
8
+@rem      http://www.apache.org/licenses/LICENSE-2.0
9
+@rem
10
+@rem Unless required by applicable law or agreed to in writing, software
11
+@rem distributed under the License is distributed on an "AS IS" BASIS,
12
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+@rem See the License for the specific language governing permissions and
14
+@rem limitations under the License.
15
+@rem
16
+
17
+@if "%DEBUG%" == "" @echo off
18
+@rem ##########################################################################
19
+@rem
20
+@rem  Gradle startup script for Windows
21
+@rem
22
+@rem ##########################################################################
23
+
24
+@rem Set local scope for the variables with windows NT shell
25
+if "%OS%"=="Windows_NT" setlocal
26
+
27
+set DIRNAME=%~dp0
28
+if "%DIRNAME%" == "" set DIRNAME=.
29
+set APP_BASE_NAME=%~n0
30
+set APP_HOME=%DIRNAME%
31
+
32
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34
+
35
+@rem Find java.exe
36
+if defined JAVA_HOME goto findJavaFromJavaHome
37
+
38
+set JAVA_EXE=java.exe
39
+%JAVA_EXE% -version >NUL 2>&1
40
+if "%ERRORLEVEL%" == "0" goto init
41
+
42
+echo.
43
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44
+echo.
45
+echo Please set the JAVA_HOME variable in your environment to match the
46
+echo location of your Java installation.
47
+
48
+goto fail
49
+
50
+:findJavaFromJavaHome
51
+set JAVA_HOME=%JAVA_HOME:"=%
52
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53
+
54
+if exist "%JAVA_EXE%" goto init
55
+
56
+echo.
57
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58
+echo.
59
+echo Please set the JAVA_HOME variable in your environment to match the
60
+echo location of your Java installation.
61
+
62
+goto fail
63
+
64
+:init
65
+@rem Get command-line arguments, handling Windows variants
66
+
67
+if not "%OS%" == "Windows_NT" goto win9xME_args
68
+
69
+:win9xME_args
70
+@rem Slurp the command line arguments.
71
+set CMD_LINE_ARGS=
72
+set _SKIP=2
73
+
74
+:win9xME_args_slurp
75
+if "x%~1" == "x" goto execute
76
+
77
+set CMD_LINE_ARGS=%*
78
+
79
+:execute
80
+@rem Setup the command line
81
+
82
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83
+
84
+@rem Execute Gradle
85
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86
+
87
+:end
88
+@rem End local scope for the variables with windows NT shell
89
+if "%ERRORLEVEL%"=="0" goto mainEnd
90
+
91
+:fail
92
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93
+rem the _cmd.exe /c_ return code!
94
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95
+exit /b 1
96
+
97
+:mainEnd
98
+if "%OS%"=="Windows_NT" endlocal
99
+
100
+:omega

+ 6
- 0
android/settings.gradle View File

@@ -0,0 +1,6 @@
1
+rootProject.name = 'Campus'
2
+
3
+apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
4
+applyNativeModulesSettingsGradle(settings)
5
+
6
+include ':app'

+ 3
- 50
app.json View File

@@ -1,51 +1,4 @@
1 1
 {
2
-  "expo": {
3
-    "name": "Campus",
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
-    "slug": "application-amicale",
6
-    "privacy": "public",
7
-    "sdkVersion": "36.0.0",
8
-    "platforms": [
9
-      "ios",
10
-      "android",
11
-      "web"
12
-    ],
13
-    "version": "2.0.0",
14
-    "orientation": "portrait",
15
-    "primaryColor": "#be1522",
16
-    "userInterfaceStyle": "automatic",
17
-    "icon": "./assets/android.icon.png",
18
-    "splash": {
19
-      "backgroundColor": "#be1522",
20
-      "resizeMode": "contain",
21
-      "image": "./assets/splash.png"
22
-    },
23
-    "notification": {
24
-      "icon": "./assets/icon-notification.png",
25
-      "color": "#be1522",
26
-      "androidMode": "default"
27
-    },
28
-    "updates": {
29
-      "enabled": false
30
-    },
31
-    "assetBundlePatterns": [
32
-      "**/*"
33
-    ],
34
-    "ios": {
35
-      "bundleIdentifier": "fr.amicaleinsat.application",
36
-      "icon": "./assets/ios.icon.png"
37
-    },
38
-    "android": {
39
-      "package": "fr.amicaleinsat.application",
40
-      "versionCode": 16,
41
-      "icon": "./assets/android.icon.png",
42
-      "adaptiveIcon": {
43
-        "foregroundImage": "./assets/android.adaptive-icon.png",
44
-        "backgroundColor": "#be1522"
45
-      },
46
-      "permissions": [
47
-        "VIBRATE"
48
-      ]
49
-    }
50
-  }
51
-}
2
+  "name": "Campus",
3
+  "displayName": "Campus"
4
+}

BIN
assets/amicale.png View File


BIN
assets/android.adaptive-icon.png View File


BIN
assets/drawer-cover.png View File


BIN
assets/ios.icon.png View File


BIN
assets/proximo-logo.png View File


BIN
assets/proxiwash-logo.png View File


BIN
assets/splash.png View File


BIN
assets/tab-icon-outline.png View File


BIN
assets/tab-icon.png View File


+ 2
- 10
babel.config.js View File

@@ -1,11 +1,3 @@
1
-module.exports = function(api) {
2
-  api.cache(true);
3
-  return {
4
-    presets: ['babel-preset-expo'],
5
-    env: {
6
-      production: {
7
-        plugins: ['react-native-paper/babel'],
8
-      },
9
-    },
10
-  };
1
+module.exports = {
2
+  presets: ['module:metro-react-native-babel-preset'],
11 3
 };

+ 18
- 1
clear-node-cache.sh View File

@@ -1 +1,18 @@
1
-rm -rf node_modules/ && rm -f package-lock.json && rm -f yarn.lock && npm cache verify && npm install && expo r -c
1
+#!/bin/bash
2
+
3
+echo "Removing node_modules..."
4
+rm -rf node_modules/
5
+echo -e "Done\n"
6
+
7
+echo "Removing locks..."
8
+rm -f package-lock.json && rm -f yarn.lock
9
+echo -e "Done\n"
10
+
11
+#echo "Verifying npm cache..."
12
+#npm cache verify
13
+#echo -e "Done\n"
14
+
15
+echo "Installing dependencies..."
16
+npm install
17
+echo -e "Done\n"
18
+

+ 0
- 40
components/CustomAgenda.js View File

@@ -1,40 +0,0 @@
1
-import * as React from 'react';
2
-import {withTheme} from 'react-native-paper';
3
-import {Agenda} from "react-native-calendars";
4
-
5
-function CustomAgenda(props) {
6
-    const { colors } = props.theme;
7
-    return (
8
-        <Agenda
9
-            {...props}
10
-            ref={props.onRef}
11
-            theme={{
12
-                backgroundColor: colors.agendaBackgroundColor,
13
-                calendarBackground: colors.background,
14
-                textSectionTitleColor: colors.agendaDayTextColor,
15
-                selectedDayBackgroundColor: colors.primary,
16
-                selectedDayTextColor: '#ffffff',
17
-                todayTextColor: colors.primary,
18
-                dayTextColor: colors.text,
19
-                textDisabledColor: colors.agendaDayTextColor,
20
-                dotColor: colors.primary,
21
-                selectedDotColor: '#ffffff',
22
-                arrowColor: 'orange',
23
-                monthTextColor: colors.primary,
24
-                indicatorColor: colors.primary,
25
-                textDayFontWeight: '300',
26
-                textMonthFontWeight: 'bold',
27
-                textDayHeaderFontWeight: '300',
28
-                textDayFontSize: 16,
29
-                textMonthFontSize: 16,
30
-                textDayHeaderFontSize: 16,
31
-                agendaDayTextColor: colors.agendaDayTextColor,
32
-                agendaDayNumColor: colors.agendaDayTextColor,
33
-                agendaTodayColor: colors.primary,
34
-                agendaKnobColor: colors.primary,
35
-            }}
36
-        />
37
-    );
38
-}
39
-
40
-export default withTheme(CustomAgenda);

+ 0
- 41
components/EmptyWebSectionListItem.js View File

@@ -1,41 +0,0 @@
1
-import * as React from 'react';
2
-import {ActivityIndicator, Subheading, withTheme} from 'react-native-paper';
3
-import {View} from "react-native";
4
-import {MaterialCommunityIcons} from "@expo/vector-icons";
5
-
6
-function EmptyWebSectionListItem(props) {
7
-    const { colors } = props.theme;
8
-    return (
9
-        <View>
10
-            <View style={{
11
-                justifyContent: 'center',
12
-                alignItems: 'center',
13
-                width: '100%',
14
-                height: 100,
15
-                marginBottom: 20
16
-            }}>
17
-                {props.refreshing ?
18
-                    <ActivityIndicator
19
-                        animating={true}
20
-                        size={'large'}
21
-                        color={colors.primary}/>
22
-                    :
23
-                    <MaterialCommunityIcons
24
-                        name={props.icon}
25
-                        size={100}
26
-                        color={colors.textDisabled}/>}
27
-            </View>
28
-
29
-            <Subheading style={{
30
-                textAlign: 'center',
31
-                marginRight: 20,
32
-                marginLeft: 20,
33
-                color: colors.textDisabled
34
-            }}>
35
-                {props.text}
36
-            </Subheading>
37
-        </View>
38
-    );
39
-}
40
-
41
-export default withTheme(EmptyWebSectionListItem);

+ 0
- 44
components/EventDashboardItem.js View File

@@ -1,44 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import {Avatar, Card, withTheme} from 'react-native-paper';
5
-
6
-function EventDashBoardItem(props) {
7
-    const {colors} = props.theme;
8
-    const iconColor = props.isAvailable ?
9
-        colors.planningColor :
10
-        colors.textDisabled;
11
-    const textColor = props.isAvailable ?
12
-        colors.text :
13
-        colors.textDisabled;
14
-    return (
15
-        <Card
16
-            style={{
17
-                width: 'auto',
18
-                marginLeft: 10,
19
-                marginRight: 10,
20
-                marginTop: 10,
21
-                overflow: 'hidden',
22
-            }}
23
-            onPress={props.clickAction}>
24
-
25
-            <Card.Title
26
-                title={props.title}
27
-                titleStyle={{color: textColor}}
28
-                subtitle={props.subtitle}
29
-                subtitleStyle={{color: textColor}}
30
-                left={() =>
31
-                    <Avatar.Icon
32
-                        icon={props.icon}
33
-                        color={iconColor}
34
-                        size={60}
35
-                        style={{backgroundColor: 'transparent'}}/>}
36
-            />
37
-            <Card.Content>
38
-                {props.children}
39
-            </Card.Content>
40
-        </Card>
41
-    );
42
-}
43
-
44
-export default withTheme(EventDashBoardItem);

+ 0
- 48
components/FeedItem.js View File

@@ -1,48 +0,0 @@
1
-import * as React from 'react';
2
-import {Avatar, Button, Card, withTheme} from 'react-native-paper';
3
-import {TouchableOpacity, View} from "react-native";
4
-import Autolink from "react-native-autolink";
5
-import i18n from "i18n-js";
6
-
7
-const ICON_AMICALE = require('../assets/amicale.png');
8
-
9
-function getAvatar() {
10
-    return (
11
-        <Avatar.Image size={48} source={ICON_AMICALE}
12
-                      style={{backgroundColor: 'transparent'}}/>
13
-    );
14
-}
15
-
16
-function FeedItem(props) {
17
-    const {colors} = props.theme;
18
-    return (
19
-        <Card style={{margin: 10}}>
20
-            <Card.Title
21
-                title={props.title}
22
-                subtitle={props.subtitle}
23
-                left={getAvatar}
24
-            />
25
-            {props.full_picture !== '' && props.full_picture !== undefined ?
26
-                <TouchableOpacity onPress={props.onImagePress}>
27
-                    <Card.Cover source={{uri: props.full_picture}}/>
28
-                </TouchableOpacity> : <View/>}
29
-            <Card.Content>
30
-                {props.message !== undefined ?
31
-                    <Autolink
32
-                        text={props.message}
33
-                        hashtag="facebook"
34
-                        style={{color: colors.text}}
35
-                    /> : <View/>
36
-                }
37
-            </Card.Content>
38
-            <Card.Actions>
39
-                <Button
40
-                    color={'#57aeff'}
41
-                    onPress={props.onOutLinkPress}
42
-                    icon={'facebook'}>{i18n.t('homeScreen.dashboard.seeMore')}</Button>
43
-            </Card.Actions>
44
-        </Card>
45
-    );
46
-}
47
-
48
-export default withTheme(FeedItem);

+ 0
- 16
components/HeaderButton.js View File

@@ -1,16 +0,0 @@
1
-import * as React from 'react';
2
-import {IconButton, withTheme} from 'react-native-paper';
3
-
4
-function HeaderButton(props) {
5
-    const { colors } = props.theme;
6
-    return (
7
-        <IconButton
8
-            icon={props.icon}
9
-            size={26}
10
-            color={colors.text}
11
-            onPress={props.onPress}
12
-        />
13
-    );
14
-}
15
-
16
-export default withTheme(HeaderButton);

+ 0
- 66
components/PreviewEventDashboardItem.js View File

@@ -1,66 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import {View} from "react-native";
5
-import HTML from "react-native-render-html";
6
-import i18n from "i18n-js";
7
-import {Avatar, Button, Card, withTheme} from 'react-native-paper';
8
-import PlanningEventManager from "../utils/PlanningEventManager";
9
-
10
-
11
-function PreviewEventDashboardItem(props) {
12
-    const {colors} = props.theme;
13
-    const isEmpty = props.event === undefined ? true : PlanningEventManager.isDescriptionEmpty(props.event['description']);
14
-    if (props.event !== undefined && props.event !== null) {
15
-        const hasImage = props.event['logo'] !== '' && props.event['logo'] !== null;
16
-        const getImage = () => <Avatar.Image
17
-            source={{uri: props.event['logo']}}
18
-            size={50}
19
-            style={{backgroundColor: 'transparent'}}/>;
20
-        return (
21
-            <Card
22
-                style={{marginBottom: 10}}
23
-                onPress={props.clickAction}
24
-                elevation={3}
25
-            >
26
-                {hasImage ?
27
-                    <Card.Title
28
-                        title={props.event['title']}
29
-                        subtitle={PlanningEventManager.getFormattedEventTime(props.event)}
30
-                        left={getImage}
31
-                    /> :
32
-                    <Card.Title
33
-                        title={props.event['title']}
34
-                        subtitle={PlanningEventManager.getFormattedEventTime(props.event)}
35
-                    />}
36
-                {!isEmpty ?
37
-                    <Card.Content style={{
38
-                        maxHeight: 150,
39
-                        overflow: 'hidden',
40
-                    }}>
41
-                        <HTML html={"<div>" + props.event['description'] + "</div>"}
42
-                              tagsStyles={{
43
-                                  p: {color: colors.text,},
44
-                                  div: {color: colors.text},
45
-                              }}/>
46
-
47
-                    </Card.Content> : null}
48
-
49
-                <Card.Actions style={{
50
-                    marginLeft: 'auto',
51
-                    marginTop: 'auto',
52
-                    flexDirection: 'row'
53
-                }}>
54
-                    <Button
55
-                        icon={'chevron-right'}
56
-                    >
57
-                        {i18n.t("homeScreen.dashboard.seeMore")}
58
-                    </Button>
59
-                </Card.Actions>
60
-            </Card>
61
-        );
62
-    } else
63
-        return <View/>
64
-}
65
-
66
-export default withTheme(PreviewEventDashboardItem);

+ 0
- 89
components/ProxiwashListItem.js View File

@@ -1,89 +0,0 @@
1
-import * as React from 'react';
2
-import {Avatar, Card, Text, withTheme} from 'react-native-paper';
3
-import {View} from "react-native";
4
-import ProxiwashConstants from "../constants/ProxiwashConstants";
5
-
6
-function ProxiwashListItem(props) {
7
-    const {colors} = props.theme;
8
-    let stateColors = {};
9
-    stateColors[ProxiwashConstants.machineStates.TERMINE] = colors.proxiwashFinishedColor;
10
-    stateColors[ProxiwashConstants.machineStates.DISPONIBLE] = colors.proxiwashReadyColor;
11
-    stateColors[ProxiwashConstants.machineStates["EN COURS"]] = colors.proxiwashRunningColor;
12
-    stateColors[ProxiwashConstants.machineStates.HS] = colors.proxiwashBrokenColor;
13
-    stateColors[ProxiwashConstants.machineStates.ERREUR] = colors.proxiwashErrorColor;
14
-    const icon = (
15
-        props.isWatched ?
16
-            <Avatar.Icon
17
-                icon={'bell-ring'}
18
-                size={45}
19
-                color={colors.primary}
20
-                style={{backgroundColor: 'transparent'}}
21
-            /> :
22
-            <Avatar.Icon
23
-                icon={props.isDryer ? 'tumble-dryer' : 'washing-machine'}
24
-                color={colors.text}
25
-                size={40}
26
-                style={{backgroundColor: 'transparent'}}
27
-            />
28
-    );
29
-    return (
30
-        <Card
31
-            style={{
32
-                margin: 5,
33
-            }}
34
-            onPress={props.onPress}
35
-        >
36
-            {ProxiwashConstants.machineStates[props.state] === ProxiwashConstants.machineStates["EN COURS"] ?
37
-                <Card style={{
38
-                    height: '100%',
39
-                    position: 'absolute',
40
-                    left: 0,
41
-                    width: '100%',
42
-                    backgroundColor: colors.proxiwashRunningBgColor,
43
-                    elevation: 0
44
-                }}/> : null
45
-            }
46
-
47
-            <Card style={{
48
-                height: '100%',
49
-                position: 'absolute',
50
-                left: 0,
51
-                width: props.progress,
52
-                backgroundColor: stateColors[ProxiwashConstants.machineStates[props.state]],
53
-                elevation: 0
54
-            }}/>
55
-            <Card.Title
56
-                title={props.title}
57
-                titleStyle={{fontSize: 17}}
58
-                subtitle={props.description}
59
-                style={{
60
-                    backgroundColor: 'transparent',
61
-                    height: 64
62
-                }}
63
-                left={() => icon}
64
-                right={() => (
65
-                    <View style={{flexDirection: 'row'}}>
66
-                        <View style={{
67
-                            justifyContent: 'center',
68
-                        }}>
69
-                            <Text style={
70
-                                ProxiwashConstants.machineStates[props.state] === ProxiwashConstants.machineStates.TERMINE ?
71
-                                    {fontWeight: 'bold',} : {}}
72
-                            >
73
-                                {props.statusText}
74
-                            </Text>
75
-                        </View>
76
-
77
-                        <Avatar.Icon
78
-                            icon={props.statusIcon}
79
-                            color={colors.text}
80
-                            size={30}
81
-                            style={{backgroundColor: 'transparent'}}
82
-                        />
83
-                    </View>)}
84
-            />
85
-        </Card>
86
-    );
87
-}
88
-
89
-export default withTheme(ProxiwashListItem);

+ 0
- 31
components/PureFlatList.js View File

@@ -1,31 +0,0 @@
1
-import * as React from 'react';
2
-import {FlatList} from "react-native";
3
-
4
-type Props = {
5
-    data: Array<Object>,
6
-    keyExtractor: Function,
7
-    renderItem: Function,
8
-    updateData: number,
9
-}
10
-
11
-/**
12
- * This is a pure component, meaning it will only update if a shallow comparison of state and props is different.
13
- * To force the component to update, change the value of updateData.
14
- */
15
-export default class PureFlatList extends React.PureComponent<Props>{
16
-
17
-    static defaultProps = {
18
-        updateData: null,
19
-    };
20
-
21
-    render() {
22
-        return (
23
-            <FlatList
24
-                data={this.props.data}
25
-                keyExtractor={this.props.keyExtractor}
26
-                style={{minHeight: 300, width: '100%'}}
27
-                renderItem={this.props.renderItem}
28
-            />
29
-        );
30
-    }
31
-}

+ 0
- 190
components/Sidebar.js View File

@@ -1,190 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import {Dimensions, FlatList, Image, Platform, StyleSheet, View} from 'react-native';
5
-import i18n from "i18n-js";
6
-import * as WebBrowser from 'expo-web-browser';
7
-import SidebarDivider from "./SidebarDivider";
8
-import SidebarItem from "./SidebarItem";
9
-
10
-const deviceWidth = Dimensions.get("window").width;
11
-
12
-type Props = {
13
-    navigation: Object,
14
-    state: Object,
15
-};
16
-
17
-type State = {
18
-    active: string,
19
-};
20
-
21
-/**
22
- * Class used to define a navigation drawer
23
- */
24
-export default class SideBar extends React.PureComponent<Props, State> {
25
-
26
-    dataSet: Array<Object>;
27
-
28
-    state = {
29
-        active: 'Home',
30
-    };
31
-
32
-    getRenderItem: Function;
33
-
34
-    /**
35
-     * Generate the datasets
36
-     *
37
-     * @param props
38
-     */
39
-    constructor(props: Props) {
40
-        super(props);
41
-        // Dataset used to render the drawer
42
-        this.dataSet = [
43
-            {
44
-                name: i18n.t('screens.home'),
45
-                route: "Main",
46
-                icon: "home",
47
-            },
48
-            {
49
-                name: i18n.t('sidenav.divider2'),
50
-                route: "Divider2"
51
-            },
52
-            {
53
-                name: i18n.t('screens.menuSelf'),
54
-                route: "SelfMenuScreen",
55
-                icon: "silverware-fork-knife",
56
-            },
57
-            {
58
-                name: i18n.t('screens.availableRooms'),
59
-                route: "AvailableRoomScreen",
60
-                icon: "calendar-check",
61
-            },
62
-            {
63
-                name: i18n.t('screens.bib'),
64
-                route: "BibScreen",
65
-                icon: "book",
66
-            },
67
-            {
68
-                name: i18n.t('screens.bluemind'),
69
-                route: "BlueMindScreen",
70
-                link: "https://etud-mel.insa-toulouse.fr/webmail/",
71
-                icon: "email",
72
-            },
73
-            {
74
-                name: i18n.t('screens.ent'),
75
-                route: "EntScreen",
76
-                link: "https://ent.insa-toulouse.fr/",
77
-                icon: "notebook",
78
-            },
79
-            {
80
-                name: i18n.t('sidenav.divider1'),
81
-                route: "Divider1"
82
-            },
83
-            {
84
-                name: "Amicale",
85
-                route: "AmicaleScreen",
86
-                link: "https://amicale-insat.fr/",
87
-                icon: "alpha-a-box",
88
-            },
89
-            {
90
-                name: "Élus Étudiants",
91
-                route: "ElusEtudScreen",
92
-                link: "https://etud.insa-toulouse.fr/~eeinsat/",
93
-                icon: "alpha-e-box",
94
-            },
95
-            {
96
-                name: "Wiketud",
97
-                route: "WiketudScreen",
98
-                link: "https://wiki.etud.insa-toulouse.fr",
99
-                icon: "wikipedia",
100
-            },
101
-            {
102
-                name: "Tutor'INSA",
103
-                route: "TutorInsaScreen",
104
-                link: "https://www.etud.insa-toulouse.fr/~tutorinsa/",
105
-                icon: "school",
106
-            },
107
-            {
108
-                name: i18n.t('sidenav.divider3'),
109
-                route: "Divider3"
110
-            },
111
-            {
112
-                name: i18n.t('screens.settings'),
113
-                route: "SettingsScreen",
114
-                icon: "settings",
115
-            },
116
-            {
117
-                name: i18n.t('screens.about'),
118
-                route: "AboutScreen",
119
-                icon: "information",
120
-            },
121
-        ];
122
-        this.getRenderItem = this.getRenderItem.bind(this);
123
-    }
124
-
125
-    onListItemPress(item: Object) {
126
-        if (item.link === undefined)
127
-            this.props.navigation.navigate(item.route);
128
-        else
129
-            WebBrowser.openBrowserAsync(item.link);
130
-    }
131
-
132
-
133
-    listKeyExtractor(item: Object) {
134
-        return item.route;
135
-    }
136
-
137
-
138
-    getRenderItem({item}: Object) {
139
-        const onListItemPress = this.onListItemPress.bind(this, item);
140
-        if (item.icon !== undefined) {
141
-            return (
142
-                <SidebarItem
143
-                    title={item.name}
144
-                    icon={item.icon}
145
-                    onPress={onListItemPress}
146
-                />
147
-            );
148
-        } else {
149
-            return (
150
-                <SidebarDivider title={item.name}/>
151
-            );
152
-        }
153
-
154
-    }
155
-
156
-    render() {
157
-        return (
158
-            <View style={{height: '100%'}}>
159
-                <Image source={require("../assets/drawer-cover.png")} style={styles.drawerCover}/>
160
-                <FlatList
161
-                    data={this.dataSet}
162
-                    extraData={this.state}
163
-                    keyExtractor={this.listKeyExtractor}
164
-                    renderItem={this.getRenderItem}
165
-                />
166
-            </View>
167
-        );
168
-    }
169
-}
170
-
171
-const styles = StyleSheet.create({
172
-    drawerCover: {
173
-        height: deviceWidth / 3,
174
-        width: 2 * deviceWidth / 3,
175
-        position: "relative",
176
-        marginBottom: 10,
177
-        marginTop: 20
178
-    },
179
-    text: {
180
-        fontWeight: Platform.OS === "ios" ? "500" : "400",
181
-        fontSize: 16,
182
-        marginLeft: 20
183
-    },
184
-    badgeText: {
185
-        fontSize: Platform.OS === "ios" ? 13 : 11,
186
-        fontWeight: "400",
187
-        textAlign: "center",
188
-        marginTop: Platform.OS === "android" ? -3 : undefined
189
-    }
190
-});

+ 0
- 23
components/SidebarDivider.js View File

@@ -1,23 +0,0 @@
1
-import * as React from 'react';
2
-import { withTheme } from 'react-native-paper';
3
-import {DrawerItem} from "@react-navigation/drawer";
4
-
5
-function SidebarDivider(props) {
6
-    const { colors } = props.theme;
7
-    return (
8
-        <DrawerItem
9
-            label={props.title}
10
-            focused={false}
11
-            onPress={undefined}
12
-            style={{
13
-                marginLeft: 0,
14
-                marginRight: 0,
15
-                padding: 0,
16
-                borderRadius: 0,
17
-                backgroundColor: colors.dividerBackground
18
-            }}
19
-        />
20
-    );
21
-}
22
-
23
-export default withTheme(SidebarDivider);

+ 0
- 28
components/SidebarItem.js View File

@@ -1,28 +0,0 @@
1
-import * as React from 'react';
2
-import {withTheme} from 'react-native-paper';
3
-import {DrawerItem} from "@react-navigation/drawer";
4
-import {MaterialCommunityIcons} from "@expo/vector-icons";
5
-
6
-function SidebarItem(props) {
7
-    const {colors} = props.theme;
8
-    return (
9
-        <DrawerItem
10
-            label={props.title}
11
-            focused={false}
12
-            onPress={props.onPress}
13
-            icon={({color, size}) =>
14
-                <MaterialCommunityIcons color={color} size={size} name={props.icon}/>}
15
-            style={{
16
-                marginLeft: 0,
17
-                marginRight: 0,
18
-                padding: 0,
19
-                borderRadius: 0,
20
-            }}
21
-            labelStyle={{
22
-                color: colors.text,
23
-            }}
24
-        />
25
-    );
26
-}
27
-
28
-export default withTheme(SidebarItem);

+ 0
- 33
components/SquareDashboardItem.js View File

@@ -1,33 +0,0 @@
1
-import * as React from 'react';
2
-import {Badge, IconButton, withTheme} from 'react-native-paper';
3
-import {View} from "react-native";
4
-
5
-function SquareDashboardItem(props) {
6
-    const {colors} = props.theme;
7
-    return (
8
-        <View>
9
-            <IconButton
10
-                icon={props.icon}
11
-                color={
12
-                    props.isAvailable ?
13
-                        props.color :
14
-                        colors.textDisabled
15
-                }
16
-                size={35}
17
-                onPress={props.clickAction}
18
-            />
19
-            {
20
-                props.badgeNumber > 0 ?
21
-                    <Badge
22
-                        style={{
23
-                            position: 'absolute',
24
-                            top: 5,
25
-                            right: 5
26
-                        }}>{props.badgeNumber}</Badge> : null
27
-            }
28
-
29
-        </View>
30
-    );
31
-}
32
-
33
-export default withTheme(SquareDashboardItem);

+ 0
- 228
components/WebSectionList.js View File

@@ -1,228 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import WebDataManager from "../utils/WebDataManager";
5
-import i18n from "i18n-js";
6
-import {Snackbar} from 'react-native-paper';
7
-import {RefreshControl, SectionList, View} from "react-native";
8
-import EmptyWebSectionListItem from "./EmptyWebSectionListItem";
9
-
10
-type Props = {
11
-    navigation: Object,
12
-    fetchUrl: string,
13
-    autoRefreshTime: number,
14
-    refreshOnFocus: boolean,
15
-    renderItem: React.Node,
16
-    renderSectionHeader: React.Node,
17
-    stickyHeader: boolean,
18
-    createDataset: Function,
19
-    updateData: number,
20
-}
21
-
22
-type State = {
23
-    refreshing: boolean,
24
-    firstLoading: boolean,
25
-    fetchedData: Object,
26
-    snackbarVisible: boolean
27
-};
28
-
29
-
30
-const MIN_REFRESH_TIME = 5  * 1000;
31
-/**
32
- * This is a pure component, meaning it will only update if a shallow comparison of state and props is different.
33
- * To force the component to update, change the value of updateData.
34
- */
35
-export default class WebSectionList extends React.PureComponent<Props, State> {
36
-
37
-    static defaultProps = {
38
-        renderSectionHeader: null,
39
-        stickyHeader: false,
40
-        updateData: null,
41
-    };
42
-
43
-    webDataManager: WebDataManager;
44
-
45
-    refreshInterval: IntervalID;
46
-    lastRefresh: Date;
47
-
48
-    state = {
49
-        refreshing: false,
50
-        firstLoading: true,
51
-        fetchedData: {},
52
-        snackbarVisible: false
53
-    };
54
-
55
-    onRefresh: Function;
56
-    onFetchSuccess: Function;
57
-    onFetchError: Function;
58
-    getEmptyRenderItem: Function;
59
-    getEmptySectionHeader: Function;
60
-    showSnackBar: Function;
61
-    hideSnackBar: Function;
62
-
63
-    constructor() {
64
-        super();
65
-        // creating references to functions used in render()
66
-        this.onRefresh = this.onRefresh.bind(this);
67
-        this.onFetchSuccess = this.onFetchSuccess.bind(this);
68
-        this.onFetchError = this.onFetchError.bind(this);
69
-        this.getEmptyRenderItem = this.getEmptyRenderItem.bind(this);
70
-        this.getEmptySectionHeader = this.getEmptySectionHeader.bind(this);
71
-        this.showSnackBar = this.showSnackBar.bind(this);
72
-        this.hideSnackBar = this.hideSnackBar.bind(this);
73
-    }
74
-
75
-    /**
76
-     * Register react navigation events on first screen load.
77
-     * Allows to detect when the screen is focused
78
-     */
79
-    componentDidMount() {
80
-        this.webDataManager = new WebDataManager(this.props.fetchUrl);
81
-        const onScreenFocus = this.onScreenFocus.bind(this);
82
-        const onScreenBlur = this.onScreenBlur.bind(this);
83
-        this.props.navigation.addListener('focus', onScreenFocus);
84
-        this.props.navigation.addListener('blur', onScreenBlur);
85
-        this.onRefresh();
86
-    }
87
-
88
-    /**
89
-     * Refresh data when focusing the screen and setup a refresh interval if asked to
90
-     */
91
-    onScreenFocus() {
92
-        if (this.props.refreshOnFocus && this.lastRefresh !== undefined)
93
-            this.onRefresh();
94
-        if (this.props.autoRefreshTime > 0)
95
-            this.refreshInterval = setInterval(this.onRefresh, this.props.autoRefreshTime)
96
-    }
97
-
98
-    /**
99
-     * Remove any interval on un-focus
100
-     */
101
-    onScreenBlur() {
102
-        clearInterval(this.refreshInterval);
103
-    }
104
-
105
-
106
-    onFetchSuccess(fetchedData: Object) {
107
-        this.setState({
108
-            fetchedData: fetchedData,
109
-            refreshing: false,
110
-            firstLoading: false
111
-        });
112
-        this.lastRefresh = new Date();
113
-    }
114
-
115
-    onFetchError() {
116
-        this.setState({
117
-            fetchedData: {},
118
-            refreshing: false,
119
-            firstLoading: false
120
-        });
121
-        this.showSnackBar();
122
-        // this.webDataManager.showUpdateToast(this.props.updateErrorText);
123
-    }
124
-
125
-    /**
126
-     * Refresh data and show a toast if any error occurred
127
-     * @private
128
-     */
129
-    onRefresh() {
130
-        let canRefresh;
131
-        if (this.lastRefresh !== undefined)
132
-            canRefresh = (new Date().getTime() - this.lastRefresh.getTime()) > MIN_REFRESH_TIME;
133
-        else
134
-            canRefresh = true;
135
-        if (canRefresh) {
136
-            this.setState({refreshing: true});
137
-            this.webDataManager.readData()
138
-                .then(this.onFetchSuccess)
139
-                .catch(this.onFetchError);
140
-        }
141
-    }
142
-
143
-    getEmptySectionHeader({section}: Object) {
144
-        return <View/>;
145
-    }
146
-
147
-    getEmptyRenderItem({item}: Object) {
148
-        return (
149
-            <EmptyWebSectionListItem
150
-                text={item.text}
151
-                icon={item.icon}
152
-                refreshing={this.state.refreshing}
153
-            />
154
-        );
155
-    }
156
-
157
-    createEmptyDataset() {
158
-        return [
159
-            {
160
-                title: '',
161
-                data: [
162
-                    {
163
-                        text: this.state.refreshing ?
164
-                            i18n.t('general.loading') :
165
-                            i18n.t('general.networkError'),
166
-                        isSpinner: this.state.refreshing,
167
-                        icon: this.state.refreshing ?
168
-                            'refresh' :
169
-                            'access-point-network-off'
170
-                    }
171
-                ],
172
-                keyExtractor: this.datasetKeyExtractor,
173
-            }
174
-        ];
175
-    }
176
-
177
-    datasetKeyExtractor(item: Object) {
178
-        return item.text
179
-    }
180
-
181
-    showSnackBar() {
182
-        this.setState({snackbarVisible: true})
183
-    }
184
-
185
-    hideSnackBar() {
186
-        this.setState({snackbarVisible: false})
187
-    }
188
-
189
-    render() {
190
-        let dataset = this.props.createDataset(this.state.fetchedData);
191
-        const isEmpty = dataset[0].data.length === 0;
192
-        const shouldRenderHeader = !isEmpty && (this.props.renderSectionHeader !== null);
193
-        if (isEmpty)
194
-            dataset = this.createEmptyDataset();
195
-        return (
196
-            <View>
197
-                <Snackbar
198
-                    visible={this.state.snackbarVisible}
199
-                    onDismiss={this.hideSnackBar}
200
-                    action={{
201
-                        label: 'OK',
202
-                        onPress: this.hideSnackBar,
203
-                    }}
204
-                    duration={4000}
205
-                >
206
-                    {i18n.t("homeScreen.listUpdateFail")}
207
-                </Snackbar>
208
-                <SectionList
209
-                    sections={dataset}
210
-                    refreshControl={
211
-                        <RefreshControl
212
-                            refreshing={this.state.refreshing}
213
-                            onRefresh={this.onRefresh}
214
-                        />
215
-                    }
216
-                    renderSectionHeader={shouldRenderHeader ? this.props.renderSectionHeader : this.getEmptySectionHeader}
217
-                    renderItem={isEmpty ? this.getEmptyRenderItem : this.props.renderItem}
218
-                    style={{minHeight: 300, width: '100%'}}
219
-                    stickySectionHeadersEnabled={this.props.stickyHeader}
220
-                    contentContainerStyle={
221
-                        isEmpty ?
222
-                            {flexGrow: 1, justifyContent: 'center', alignItems: 'center'} : {}
223
-                    }
224
-                />
225
-            </View>
226
-        );
227
-    }
228
-}

+ 0
- 136
components/WebViewScreen.js View File

@@ -1,136 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import {View} from 'react-native';
5
-import WebView from "react-native-webview";
6
-import {ActivityIndicator, withTheme} from 'react-native-paper';
7
-import HeaderButton from "./HeaderButton";
8
-
9
-type Props = {
10
-    navigation: Object,
11
-    data: Array<{
12
-        url: string,
13
-        icon: string,
14
-        name: string,
15
-        customJS: string
16
-    }>,
17
-    headerTitle: string,
18
-    hasHeaderBackButton: boolean,
19
-    hasSideMenu: boolean,
20
-    hasFooter: boolean,
21
-}
22
-
23
-/**
24
- * Class defining a webview screen.
25
- */
26
-class WebViewScreen extends React.PureComponent<Props> {
27
-
28
-    static defaultProps = {
29
-        hasBackButton: false,
30
-        hasSideMenu: true,
31
-        hasFooter: true,
32
-    };
33
-    webviewRef: Object;
34
-
35
-    onRefreshClicked: Function;
36
-    onWebviewRef: Function;
37
-    onGoBackWebview: Function;
38
-    onGoForwardWebview: Function;
39
-    getRenderLoading: Function;
40
-
41
-    colors: Object;
42
-
43
-    constructor(props) {
44
-        super(props);
45
-        this.onRefreshClicked = this.onRefreshClicked.bind(this);
46
-        this.onWebviewRef = this.onWebviewRef.bind(this);
47
-        this.onGoBackWebview = this.onGoBackWebview.bind(this);
48
-        this.onGoForwardWebview = this.onGoForwardWebview.bind(this);
49
-        this.getRenderLoading = this.getRenderLoading.bind(this);
50
-        this.colors = props.theme.colors;
51
-    }
52
-
53
-    componentDidMount() {
54
-        const rightButton = this.getRefreshButton.bind(this);
55
-        this.props.navigation.setOptions({
56
-            headerRight: rightButton,
57
-        });
58
-    }
59
-
60
-    getHeaderButton(clickAction: Function, icon: string) {
61
-        return (
62
-            <HeaderButton icon={icon} onPress={clickAction}/>
63
-        );
64
-    }
65
-
66
-    getRefreshButton() {
67
-        return (
68
-            <View style={{
69
-                flexDirection: 'row',
70
-                marginRight: 10
71
-            }}>
72
-                {this.getHeaderButton(this.onRefreshClicked, 'refresh')}
73
-            </View>
74
-        );
75
-    };
76
-
77
-    onRefreshClicked() {
78
-        if (this.webviewRef !== null)
79
-            this.webviewRef.reload();
80
-    }
81
-
82
-    onGoBackWebview() {
83
-        if (this.webviewRef !== null)
84
-            this.webviewRef.goBack();
85
-    }
86
-
87
-    onGoForwardWebview() {
88
-        if (this.webviewRef !== null)
89
-            this.webviewRef.goForward();
90
-    }
91
-
92
-    onWebviewRef(ref: Object) {
93
-        this.webviewRef = ref
94
-    }
95
-
96
-    getRenderLoading() {
97
-        return (
98
-            <View style={{
99
-                backgroundColor: this.colors.background,
100
-                position: 'absolute',
101
-                top: 0,
102
-                right: 0,
103
-                width: '100%',
104
-                height: '100%',
105
-                flex: 1,
106
-                alignItems: 'center',
107
-                justifyContent: 'center'
108
-            }}>
109
-                <ActivityIndicator
110
-                    animating={true}
111
-                    size={'large'}
112
-                    color={this.colors.primary}/>
113
-            </View>
114
-        );
115
-    }
116
-
117
-    render() {
118
-        // console.log("rendering WebViewScreen");
119
-        return (
120
-            <WebView
121
-                ref={this.onWebviewRef}
122
-                source={{uri: this.props.data[0]['url']}}
123
-                style={{
124
-                    width: '100%',
125
-                    height: '100%',
126
-                }}
127
-                startInLoadingState={true}
128
-                injectedJavaScript={this.props.data[0]['customJS']}
129
-                javaScriptEnabled={true}
130
-                renderLoading={this.getRenderLoading}
131
-            />
132
-        );
133
-    }
134
-}
135
-
136
-export default withTheme(WebViewScreen);

+ 0
- 10
constants/ProxiwashConstants.js View File

@@ -1,10 +0,0 @@
1
-
2
-export default {
3
-    machineStates: {
4
-        "TERMINE": "0",
5
-        "DISPONIBLE": "1",
6
-        "EN COURS": "2",
7
-        "HS": "3",
8
-        "ERREUR": "4"
9
-    },
10
-};

+ 0
- 25
constants/Update.js View File

@@ -1,25 +0,0 @@
1
-import i18n from "i18n-js";
2
-
3
-export default class Update {
4
-
5
-    static number = 5;
6
-    static icon = 'surround-sound-2-0';
7
-
8
-    static instance: Update | null = null;
9
-
10
-    constructor() {
11
-        this.title = i18n.t('intro.updateSlide.title');
12
-        this.description = i18n.t('intro.updateSlide.text');
13
-    }
14
-
15
-    /**
16
-     * Get this class instance or create one if none is found
17
-     * @returns {Update}
18
-     */
19
-    static getInstance(): Update {
20
-        return Update.instance === null ?
21
-            Update.instance = new Update() :
22
-            Update.instance;
23
-    }
24
-
25
-};

+ 37
- 0
eject.txt View File

@@ -0,0 +1,37 @@
1
+Your git working tree is clean
2
+To revert the changes after this command completes, you can run the following:
3
+  git clean --force && git reset --hard
4
+
5
+✔ App configuration (app.json) updated.
6
+✔ Created native project directories (./ios and ./android) and updated .gitignore.
7
+✔ Updated package.json and added index.js entry point for iOS and Android.
8
+✔ Installed JavaScript dependencies.
9
+
10
+⚠️  iOS configuration applied with warnings that should be fixed:
11
+- icon: This is the image that your app uses on your home screen, you will need to configure it manually.
12
+- splash: This is the image that your app uses on the loading screen, we recommend installing and using expo-splash-screen. Details. (​https://github.com/expo/expo/blob/master/packages/expo-splash-screen/README.md​)
13
+
14
+⚠️  Android configuration applied with warnings that should be fixed:
15
+- splash: This is the image that your app uses on the loading screen, we recommend installing and using expo-splash-screen. Details. (​https://github.com/expo/expo/blob/master/packages/expo-splash-screen/README.md​)
16
+- icon: This is the image that your app uses on your home screen, you will need to configure it manually.
17
+- android.adaptiveIcon: This is the image that your app uses on your home screen, you will need to configure it manually.
18
+
19
+✔ Skipped installing CocoaPods because operating system is not on macOS.
20
+
21
+⚠️  Your app includes 3 packages that require additional setup in order to run:
22
+- expo-camera: https://github.com/expo/expo/tree/master/packages/expo-camera
23
+- react-native-appearance: https://github.com/expo/react-native-appearance
24
+- react-native-webview: https://github.com/react-native-community/react-native-webview
25
+
26
+➡️  Next steps
27
+- 👆 Review the logs above and look for any warnings (⚠️ ) that might need follow-up.
28
+- 💡 You may want to run npx @react-native-community/cli doctor to help install any tools that your app may need to run your native projects.
29
+- 🍫 When CocoaPods is installed, initialize the project workspace: cd ios && pod install
30
+- 🔑 Download your Android keystore (if you're not sure if you need to, just run the command and see): expo fetch:android:keystore
31
+- 🚀 expo-updates (​https://github.com/expo/expo/blob/master/packages/expo-updates/README.md​) has been configured in your project. Before you do a release build, make sure you run expo publish. Learn more. (​https://expo.fyi/release-builds-with-expo-updates​)
32
+
33
+☑️  When you are ready to run your project
34
+To compile and run your project in development, execute one of the following commands:
35
+- npm run ios
36
+- npm run android
37
+- npm run web

+ 4
- 0
index.js View File

@@ -0,0 +1,4 @@
1
+import {AppRegistry} from 'react-native';
2
+import App from './App';
3
+
4
+AppRegistry.registerComponent('main', () => App);

+ 498
- 0
ios/Campus.xcodeproj/project.pbxproj View File

@@ -0,0 +1,498 @@
1
+// !$*UTF8*$!
2
+{
3
+	archiveVersion = 1;
4
+	classes = {
5
+	};
6
+	objectVersion = 46;
7
+	objects = {
8
+
9
+/* Begin PBXBuildFile section */
10
+		074F4BDC2432833400BDB9FE /* app.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 07C2E6E4243282B30028AF0A /* app.bundle */; };
11
+		074F4BDD2432833400BDB9FE /* app.manifest in Resources */ = {isa = PBXBuildFile; fileRef = 07C2E6E3243282B30028AF0A /* app.manifest */; };
12
+		13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13
+		13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
14
+		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
15
+		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
16
+		3DE4DAD41476765101945408 /* libPods-Campus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D43FF9D506E70904424FA7E9 /* libPods-Campus.a */; };
17
+/* End PBXBuildFile section */
18
+
19
+/* Begin PBXFileReference section */
20
+		008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
21
+		07C2E6E3243282B30028AF0A /* app.manifest */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = app.manifest; path = Campus/Supporting/app.manifest; sourceTree = "<group>"; };
22
+		07C2E6E4243282B30028AF0A /* app.bundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = app.bundle; path = Campus/Supporting/app.bundle; sourceTree = "<group>"; };
23
+		13B07F961A680F5B00A75B9A /* application.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = application.app; sourceTree = BUILT_PRODUCTS_DIR; };
24
+		13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Campus/AppDelegate.h; sourceTree = "<group>"; };
25
+		13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Campus/AppDelegate.m; sourceTree = "<group>"; };
26
+		13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
27
+		13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Campus/Images.xcassets; sourceTree = "<group>"; };
28
+		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Campus/Info.plist; sourceTree = "<group>"; };
29
+		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Campus/main.m; sourceTree = "<group>"; };
30
+		2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
31
+		3B47C5AFCB8BDE514B7D1AC6 /* Pods-Campus.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Campus.debug.xcconfig"; path = "Target Support Files/Pods-Campus/Pods-Campus.debug.xcconfig"; sourceTree = "<group>"; };
32
+		8AC623DBF3A3E2CB072F81F2 /* Pods-Campus.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Campus.release.xcconfig"; path = "Target Support Files/Pods-Campus/Pods-Campus.release.xcconfig"; sourceTree = "<group>"; };
33
+		D43FF9D506E70904424FA7E9 /* libPods-Campus.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Campus.a"; sourceTree = BUILT_PRODUCTS_DIR; };
34
+		ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
35
+		ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
36
+/* End PBXFileReference section */
37
+
38
+/* Begin PBXFrameworksBuildPhase section */
39
+		13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
40
+			isa = PBXFrameworksBuildPhase;
41
+			buildActionMask = 2147483647;
42
+			files = (
43
+				3DE4DAD41476765101945408 /* libPods-Campus.a in Frameworks */,
44
+			);
45
+			runOnlyForDeploymentPostprocessing = 0;
46
+		};
47
+/* End PBXFrameworksBuildPhase section */
48
+
49
+/* Begin PBXGroup section */
50
+		13B07FAE1A68108700A75B9A /* Campus */ = {
51
+			isa = PBXGroup;
52
+			children = (
53
+				008F07F21AC5B25A0029DE68 /* main.jsbundle */,
54
+				13B07FAF1A68108700A75B9A /* AppDelegate.h */,
55
+				13B07FB01A68108700A75B9A /* AppDelegate.m */,
56
+				13B07FB51A68108700A75B9A /* Images.xcassets */,
57
+				13B07FB61A68108700A75B9A /* Info.plist */,
58
+				13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
59
+				13B07FB71A68108700A75B9A /* main.m */,
60
+				07C2E6E4243282B30028AF0A /* app.bundle */,
61
+				07C2E6E3243282B30028AF0A /* app.manifest */,
62
+			);
63
+			name = Campus;
64
+			sourceTree = "<group>";
65
+		};
66
+		2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
67
+			isa = PBXGroup;
68
+			children = (
69
+				ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
70
+				ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
71
+				2D16E6891FA4F8E400B85C8A /* libReact.a */,
72
+				D43FF9D506E70904424FA7E9 /* libPods-Campus.a */,
73
+			);
74
+			name = Frameworks;
75
+			sourceTree = "<group>";
76
+		};
77
+		72E5486571395D51695C2A02 /* Pods */ = {
78
+			isa = PBXGroup;
79
+			children = (
80
+				3B47C5AFCB8BDE514B7D1AC6 /* Pods-Campus.debug.xcconfig */,
81
+				8AC623DBF3A3E2CB072F81F2 /* Pods-Campus.release.xcconfig */,
82
+			);
83
+			path = Pods;
84
+			sourceTree = "<group>";
85
+		};
86
+		832341AE1AAA6A7D00B99B32 /* Libraries */ = {
87
+			isa = PBXGroup;
88
+			children = (
89
+			);
90
+			name = Libraries;
91
+			sourceTree = "<group>";
92
+		};
93
+		83CBB9F61A601CBA00E9B192 = {
94
+			isa = PBXGroup;
95
+			children = (
96
+				13B07FAE1A68108700A75B9A /* Campus */,
97
+				832341AE1AAA6A7D00B99B32 /* Libraries */,
98
+				83CBBA001A601CBA00E9B192 /* Products */,
99
+				2D16E6871FA4F8E400B85C8A /* Frameworks */,
100
+				72E5486571395D51695C2A02 /* Pods */,
101
+			);
102
+			indentWidth = 2;
103
+			sourceTree = "<group>";
104
+			tabWidth = 2;
105
+			usesTabs = 0;
106
+		};
107
+		83CBBA001A601CBA00E9B192 /* Products */ = {
108
+			isa = PBXGroup;
109
+			children = (
110
+				13B07F961A680F5B00A75B9A /* application.app */,
111
+			);
112
+			name = Products;
113
+			sourceTree = "<group>";
114
+		};
115
+/* End PBXGroup section */
116
+
117
+/* Begin PBXNativeTarget section */
118
+		13B07F861A680F5B00A75B9A /* Campus */ = {
119
+			isa = PBXNativeTarget;
120
+			buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Campus" */;
121
+			buildPhases = (
122
+				F8BC737F2AD7A05944D9E2A1 /* [CP] Check Pods Manifest.lock */,
123
+				FD4C38642228810C00325AF5 /* Start Packager */,
124
+				13B07F871A680F5B00A75B9A /* Sources */,
125
+				13B07F8C1A680F5B00A75B9A /* Frameworks */,
126
+				13B07F8E1A680F5B00A75B9A /* Resources */,
127
+				00DD1BFF1BD5951E006B06BC /* Bundle Expo Assets */,
128
+				58CDB7AB66969EE82AA3E3B0 /* [CP] Copy Pods Resources */,
129
+			);
130
+			buildRules = (
131
+			);
132
+			dependencies = (
133
+			);
134
+			name = Campus;
135
+			productName = "Hello World";
136
+			productReference = 13B07F961A680F5B00A75B9A /* application.app */;
137
+			productType = "com.apple.product-type.application";
138
+		};
139
+/* End PBXNativeTarget section */
140
+
141
+/* Begin PBXProject section */
142
+		83CBB9F71A601CBA00E9B192 /* Project object */ = {
143
+			isa = PBXProject;
144
+			attributes = {
145
+				LastUpgradeCheck = 940;
146
+				ORGANIZATIONNAME = Facebook;
147
+				TargetAttributes = {
148
+					13B07F861A680F5B00A75B9A = {
149
+						DevelopmentTeam = 6JA7CLNUV6;
150
+						ProvisioningStyle = Automatic;
151
+					};
152
+				};
153
+			};
154
+			buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Campus" */;
155
+			compatibilityVersion = "Xcode 3.2";
156
+			developmentRegion = English;
157
+			hasScannedForEncodings = 0;
158
+			knownRegions = (
159
+				English,
160
+				en,
161
+				Base,
162
+			);
163
+			mainGroup = 83CBB9F61A601CBA00E9B192;
164
+			productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
165
+			projectDirPath = "";
166
+			projectRoot = "";
167
+			targets = (
168
+				13B07F861A680F5B00A75B9A /* Campus */,
169
+			);
170
+		};
171
+/* End PBXProject section */
172
+
173
+/* Begin PBXResourcesBuildPhase section */
174
+		13B07F8E1A680F5B00A75B9A /* Resources */ = {
175
+			isa = PBXResourcesBuildPhase;
176
+			buildActionMask = 2147483647;
177
+			files = (
178
+				074F4BDC2432833400BDB9FE /* app.bundle in Resources */,
179
+				074F4BDD2432833400BDB9FE /* app.manifest in Resources */,
180
+				13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
181
+				13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
182
+			);
183
+			runOnlyForDeploymentPostprocessing = 0;
184
+		};
185
+/* End PBXResourcesBuildPhase section */
186
+
187
+/* Begin PBXShellScriptBuildPhase section */
188
+		00DD1BFF1BD5951E006B06BC /* Bundle Expo Assets */ = {
189
+			isa = PBXShellScriptBuildPhase;
190
+			buildActionMask = 2147483647;
191
+			files = (
192
+			);
193
+			inputPaths = (
194
+			);
195
+			name = "Bundle Expo Assets";
196
+			outputPaths = (
197
+			);
198
+			runOnlyForDeploymentPostprocessing = 0;
199
+			shellPath = /bin/sh;
200
+			shellScript = "../node_modules/react-native/scripts/react-native-xcode.sh\n";
201
+		};
202
+		58CDB7AB66969EE82AA3E3B0 /* [CP] Copy Pods Resources */ = {
203
+			isa = PBXShellScriptBuildPhase;
204
+			buildActionMask = 2147483647;
205
+			files = (
206
+			);
207
+			inputPaths = (
208
+				"${PODS_ROOT}/Target Support Files/Pods-Campus/Pods-Campus-resources.sh",
209
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
210
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
211
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
212
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
213
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
214
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
215
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
216
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
217
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
218
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
219
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
220
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
221
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
222
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
223
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
224
+				"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
225
+			);
226
+			name = "[CP] Copy Pods Resources";
227
+			outputPaths = (
228
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
229
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
230
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
231
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
232
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
233
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
234
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
235
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
236
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
237
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
238
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
239
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
240
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
241
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
242
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
243
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
244
+			);
245
+			runOnlyForDeploymentPostprocessing = 0;
246
+			shellPath = /bin/sh;
247
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Campus/Pods-Campus-resources.sh\"\n";
248
+			showEnvVarsInLog = 0;
249
+		};
250
+		F8BC737F2AD7A05944D9E2A1 /* [CP] Check Pods Manifest.lock */ = {
251
+			isa = PBXShellScriptBuildPhase;
252
+			buildActionMask = 2147483647;
253
+			files = (
254
+			);
255
+			inputFileListPaths = (
256
+			);
257
+			inputPaths = (
258
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
259
+				"${PODS_ROOT}/Manifest.lock",
260
+			);
261
+			name = "[CP] Check Pods Manifest.lock";
262
+			outputFileListPaths = (
263
+			);
264
+			outputPaths = (
265
+				"$(DERIVED_FILE_DIR)/Pods-Campus-checkManifestLockResult.txt",
266
+			);
267
+			runOnlyForDeploymentPostprocessing = 0;
268
+			shellPath = /bin/sh;
269
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
270
+			showEnvVarsInLog = 0;
271
+		};
272
+		FD4C38642228810C00325AF5 /* Start Packager */ = {
273
+			isa = PBXShellScriptBuildPhase;
274
+			buildActionMask = 2147483647;
275
+			files = (
276
+			);
277
+			inputFileListPaths = (
278
+			);
279
+			inputPaths = (
280
+			);
281
+			name = "Start Packager";
282
+			outputFileListPaths = (
283
+			);
284
+			outputPaths = (
285
+			);
286
+			runOnlyForDeploymentPostprocessing = 0;
287
+			shellPath = /bin/sh;
288
+			shellScript = "if [ \"$CONFIGURATION\" == \"Release\" ]; then\n  exit 0;\nfi\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n  if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n    if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n      echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n      exit 2\n    fi\n  else\n    open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n  fi\nfi\n";
289
+			showEnvVarsInLog = 0;
290
+		};
291
+/* End PBXShellScriptBuildPhase section */
292
+
293
+/* Begin PBXSourcesBuildPhase section */
294
+		13B07F871A680F5B00A75B9A /* Sources */ = {
295
+			isa = PBXSourcesBuildPhase;
296
+			buildActionMask = 2147483647;
297
+			files = (
298
+				13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
299
+				13B07FC11A68108700A75B9A /* main.m in Sources */,
300
+			);
301
+			runOnlyForDeploymentPostprocessing = 0;
302
+		};
303
+/* End PBXSourcesBuildPhase section */
304
+
305
+/* Begin PBXVariantGroup section */
306
+		13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
307
+			isa = PBXVariantGroup;
308
+			children = (
309
+				13B07FB21A68108700A75B9A /* Base */,
310
+			);
311
+			name = LaunchScreen.xib;
312
+			path = Campus;
313
+			sourceTree = "<group>";
314
+		};
315
+/* End PBXVariantGroup section */
316
+
317
+/* Begin XCBuildConfiguration section */
318
+		13B07F941A680F5B00A75B9A /* Debug */ = {
319
+			isa = XCBuildConfiguration;
320
+			baseConfigurationReference = 3B47C5AFCB8BDE514B7D1AC6 /* Pods-Campus.debug.xcconfig */;
321
+			buildSettings = {
322
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
323
+				CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
324
+				CODE_SIGN_IDENTITY = "Apple Development";
325
+				CODE_SIGN_STYLE = Automatic;
326
+				CURRENT_PROJECT_VERSION = 4;
327
+				DEAD_CODE_STRIPPING = NO;
328
+				DEVELOPMENT_TEAM = 6JA7CLNUV6;
329
+				INFOPLIST_FILE = Campus/Info.plist;
330
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
331
+				MARKETING_VERSION = 2.0.1;
332
+				OTHER_LDFLAGS = (
333
+					"$(inherited)",
334
+					"-ObjC",
335
+					"-lc++",
336
+				);
337
+				PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
338
+				PRODUCT_NAME = application;
339
+				PROVISIONING_PROFILE_SPECIFIER = "";
340
+				VERSIONING_SYSTEM = "apple-generic";
341
+			};
342
+			name = Debug;
343
+		};
344
+		13B07F951A680F5B00A75B9A /* Release */ = {
345
+			isa = XCBuildConfiguration;
346
+			baseConfigurationReference = 8AC623DBF3A3E2CB072F81F2 /* Pods-Campus.release.xcconfig */;
347
+			buildSettings = {
348
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
349
+				CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
350
+				CODE_SIGN_IDENTITY = "Apple Development";
351
+				CODE_SIGN_STYLE = Automatic;
352
+				CURRENT_PROJECT_VERSION = 4;
353
+				DEVELOPMENT_TEAM = 6JA7CLNUV6;
354
+				INFOPLIST_FILE = Campus/Info.plist;
355
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
356
+				MARKETING_VERSION = 2.0.1;
357
+				OTHER_LDFLAGS = (
358
+					"$(inherited)",
359
+					"-ObjC",
360
+					"-lc++",
361
+				);
362
+				PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
363
+				PRODUCT_NAME = application;
364
+				PROVISIONING_PROFILE_SPECIFIER = "";
365
+				VERSIONING_SYSTEM = "apple-generic";
366
+			};
367
+			name = Release;
368
+		};
369
+		83CBBA201A601CBA00E9B192 /* Debug */ = {
370
+			isa = XCBuildConfiguration;
371
+			buildSettings = {
372
+				ALWAYS_SEARCH_USER_PATHS = NO;
373
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
374
+				CLANG_CXX_LIBRARY = "libc++";
375
+				CLANG_ENABLE_MODULES = YES;
376
+				CLANG_ENABLE_OBJC_ARC = YES;
377
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
378
+				CLANG_WARN_BOOL_CONVERSION = YES;
379
+				CLANG_WARN_COMMA = YES;
380
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
381
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
382
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
383
+				CLANG_WARN_EMPTY_BODY = YES;
384
+				CLANG_WARN_ENUM_CONVERSION = YES;
385
+				CLANG_WARN_INFINITE_RECURSION = YES;
386
+				CLANG_WARN_INT_CONVERSION = YES;
387
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
388
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
389
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
390
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
391
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
392
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
393
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
394
+				CLANG_WARN_UNREACHABLE_CODE = YES;
395
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
396
+				CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
397
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
398
+				COPY_PHASE_STRIP = NO;
399
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
400
+				ENABLE_TESTABILITY = YES;
401
+				GCC_C_LANGUAGE_STANDARD = gnu99;
402
+				GCC_DYNAMIC_NO_PIC = NO;
403
+				GCC_NO_COMMON_BLOCKS = YES;
404
+				GCC_OPTIMIZATION_LEVEL = 0;
405
+				GCC_PREPROCESSOR_DEFINITIONS = (
406
+					"DEBUG=1",
407
+					"$(inherited)",
408
+				);
409
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
410
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
411
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
412
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
413
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
414
+				GCC_WARN_UNUSED_FUNCTION = YES;
415
+				GCC_WARN_UNUSED_VARIABLE = YES;
416
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
417
+				MTL_ENABLE_DEBUG_INFO = YES;
418
+				ONLY_ACTIVE_ARCH = YES;
419
+				PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
420
+				PRODUCT_NAME = application;
421
+				SDKROOT = iphoneos;
422
+			};
423
+			name = Debug;
424
+		};
425
+		83CBBA211A601CBA00E9B192 /* Release */ = {
426
+			isa = XCBuildConfiguration;
427
+			buildSettings = {
428
+				ALWAYS_SEARCH_USER_PATHS = NO;
429
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
430
+				CLANG_CXX_LIBRARY = "libc++";
431
+				CLANG_ENABLE_MODULES = YES;
432
+				CLANG_ENABLE_OBJC_ARC = YES;
433
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
434
+				CLANG_WARN_BOOL_CONVERSION = YES;
435
+				CLANG_WARN_COMMA = YES;
436
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
437
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
438
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
439
+				CLANG_WARN_EMPTY_BODY = YES;
440
+				CLANG_WARN_ENUM_CONVERSION = YES;
441
+				CLANG_WARN_INFINITE_RECURSION = YES;
442
+				CLANG_WARN_INT_CONVERSION = YES;
443
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
444
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
445
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
446
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
447
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
448
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
449
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
450
+				CLANG_WARN_UNREACHABLE_CODE = YES;
451
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
452
+				CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
453
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
454
+				COPY_PHASE_STRIP = YES;
455
+				ENABLE_NS_ASSERTIONS = NO;
456
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
457
+				GCC_C_LANGUAGE_STANDARD = gnu99;
458
+				GCC_NO_COMMON_BLOCKS = YES;
459
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
460
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
461
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
462
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
463
+				GCC_WARN_UNUSED_FUNCTION = YES;
464
+				GCC_WARN_UNUSED_VARIABLE = YES;
465
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
466
+				MTL_ENABLE_DEBUG_INFO = NO;
467
+				PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
468
+				PRODUCT_NAME = application;
469
+				SDKROOT = iphoneos;
470
+				VALIDATE_PRODUCT = YES;
471
+			};
472
+			name = Release;
473
+		};
474
+/* End XCBuildConfiguration section */
475
+
476
+/* Begin XCConfigurationList section */
477
+		13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Campus" */ = {
478
+			isa = XCConfigurationList;
479
+			buildConfigurations = (
480
+				13B07F941A680F5B00A75B9A /* Debug */,
481
+				13B07F951A680F5B00A75B9A /* Release */,
482
+			);
483
+			defaultConfigurationIsVisible = 0;
484
+			defaultConfigurationName = Release;
485
+		};
486
+		83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Campus" */ = {
487
+			isa = XCConfigurationList;
488
+			buildConfigurations = (
489
+				83CBBA201A601CBA00E9B192 /* Debug */,
490
+				83CBBA211A601CBA00E9B192 /* Release */,
491
+			);
492
+			defaultConfigurationIsVisible = 0;
493
+			defaultConfigurationName = Release;
494
+		};
495
+/* End XCConfigurationList section */
496
+	};
497
+	rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
498
+}

+ 125
- 0
ios/Campus.xcodeproj/xcshareddata/xcschemes/Campus.xcscheme View File

@@ -0,0 +1,125 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "0940"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "NO"
7
+      buildImplicitDependencies = "YES">
8
+      <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
18
+               BuildableName = "libReact.a"
19
+               BlueprintName = "React"
20
+               ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+         <BuildActionEntry
24
+            buildForTesting = "YES"
25
+            buildForRunning = "YES"
26
+            buildForProfiling = "YES"
27
+            buildForArchiving = "YES"
28
+            buildForAnalyzing = "YES">
29
+            <BuildableReference
30
+               BuildableIdentifier = "primary"
31
+               BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
32
+               BuildableName = "application.app"
33
+               BlueprintName = "Campus"
34
+               ReferencedContainer = "container:Campus.xcodeproj">
35
+            </BuildableReference>
36
+         </BuildActionEntry>
37
+         <BuildActionEntry
38
+            buildForTesting = "YES"
39
+            buildForRunning = "YES"
40
+            buildForProfiling = "NO"
41
+            buildForArchiving = "NO"
42
+            buildForAnalyzing = "YES">
43
+            <BuildableReference
44
+               BuildableIdentifier = "primary"
45
+               BlueprintIdentifier = "00E356ED1AD99517003FC87E"
46
+               BuildableName = "CampusTests.xctest"
47
+               BlueprintName = "CampusTests"
48
+               ReferencedContainer = "container:Campus.xcodeproj">
49
+            </BuildableReference>
50
+         </BuildActionEntry>
51
+      </BuildActionEntries>
52
+   </BuildAction>
53
+   <TestAction
54
+      buildConfiguration = "Debug"
55
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57
+      shouldUseLaunchSchemeArgsEnv = "YES">
58
+      <MacroExpansion>
59
+         <BuildableReference
60
+            BuildableIdentifier = "primary"
61
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
62
+            BuildableName = "application.app"
63
+            BlueprintName = "Campus"
64
+            ReferencedContainer = "container:Campus.xcodeproj">
65
+         </BuildableReference>
66
+      </MacroExpansion>
67
+      <Testables>
68
+         <TestableReference
69
+            skipped = "NO">
70
+            <BuildableReference
71
+               BuildableIdentifier = "primary"
72
+               BlueprintIdentifier = "00E356ED1AD99517003FC87E"
73
+               BuildableName = "CampusTests.xctest"
74
+               BlueprintName = "CampusTests"
75
+               ReferencedContainer = "container:Campus.xcodeproj">
76
+            </BuildableReference>
77
+         </TestableReference>
78
+      </Testables>
79
+   </TestAction>
80
+   <LaunchAction
81
+      buildConfiguration = "Release"
82
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
83
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
84
+      launchStyle = "0"
85
+      useCustomWorkingDirectory = "NO"
86
+      ignoresPersistentStateOnLaunch = "NO"
87
+      debugDocumentVersioning = "YES"
88
+      debugServiceExtension = "internal"
89
+      allowLocationSimulation = "YES">
90
+      <BuildableProductRunnable
91
+         runnableDebuggingMode = "0">
92
+         <BuildableReference
93
+            BuildableIdentifier = "primary"
94
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
95
+            BuildableName = "application.app"
96
+            BlueprintName = "Campus"
97
+            ReferencedContainer = "container:Campus.xcodeproj">
98
+         </BuildableReference>
99
+      </BuildableProductRunnable>
100
+   </LaunchAction>
101
+   <ProfileAction
102
+      buildConfiguration = "Release"
103
+      shouldUseLaunchSchemeArgsEnv = "YES"
104
+      savedToolIdentifier = ""
105
+      useCustomWorkingDirectory = "NO"
106
+      debugDocumentVersioning = "YES">
107
+      <BuildableProductRunnable
108
+         runnableDebuggingMode = "0">
109
+         <BuildableReference
110
+            BuildableIdentifier = "primary"
111
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
112
+            BuildableName = "application.app"
113
+            BlueprintName = "Campus"
114
+            ReferencedContainer = "container:Campus.xcodeproj">
115
+         </BuildableReference>
116
+      </BuildableProductRunnable>
117
+   </ProfileAction>
118
+   <AnalyzeAction
119
+      buildConfiguration = "Debug">
120
+   </AnalyzeAction>
121
+   <ArchiveAction
122
+      buildConfiguration = "Release"
123
+      revealArchiveInOrganizer = "YES">
124
+   </ArchiveAction>
125
+</Scheme>

+ 16
- 0
ios/Campus/AppDelegate.h View File

@@ -0,0 +1,16 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <UIKit/UIKit.h>
9
+#import <React/RCTBridgeDelegate.h>
10
+#import <UserNotifications/UNUserNotificationCenter.h>
11
+
12
+@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>
13
+
14
+@property (nonatomic, strong) UIWindow *window;
15
+
16
+@end

+ 89
- 0
ios/Campus/AppDelegate.m View File

@@ -0,0 +1,89 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import "AppDelegate.h"
9
+
10
+#import <React/RCTBundleURLProvider.h>
11
+#import <React/RCTRootView.h>
12
+
13
+#import <React/RCTLinkingManager.h>
14
+#import "RNSplashScreen.h"
15
+#import <RNCPushNotificationIOS.h>
16
+#import <UserNotifications/UserNotifications.h>
17
+
18
+@implementation AppDelegate
19
+
20
+@synthesize window = _window;
21
+
22
+- (BOOL)application:(UIApplication *)application
23
+   openURL:(NSURL *)url
24
+   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
25
+{
26
+  return [RCTLinkingManager application:application openURL:url options:options];
27
+}
28
+
29
+
30
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
31
+{
32
+  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
33
+  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
34
+  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
35
+
36
+  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
37
+  UIViewController *rootViewController = [UIViewController new];
38
+  rootViewController.view = rootView;
39
+  self.window.rootViewController = rootViewController;
40
+  [self.window makeKeyAndVisible];
41
+
42
+// Define UNUserNotificationCenter
43
+  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
44
+  center.delegate = self;
45
+  [RNSplashScreen show];
46
+  return YES;
47
+}
48
+
49
+//Called when a notification is delivered to a foreground app.
50
+-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
51
+{
52
+  completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
53
+}
54
+// Required to register for notifications
55
+- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
56
+{
57
+ [RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
58
+}
59
+// Required for the register event.
60
+- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
61
+{
62
+ [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
63
+}
64
+// Required for the notification event. You must call the completion handler after handling the remote notification.
65
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
66
+fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
67
+{
68
+  [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
69
+}
70
+// Required for the registrationError event.
71
+- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
72
+{
73
+ [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
74
+}
75
+// Required for the localNotification event.
76
+- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
77
+{
78
+ [RNCPushNotificationIOS didReceiveLocalNotification:notification];
79
+}
80
+
81
+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
82
+#ifdef DEBUG
83
+  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
84
+#else
85
+  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
86
+#endif
87
+}
88
+
89
+@end

+ 35
- 0
ios/Campus/Base.lproj/LaunchScreen.xib View File

@@ -0,0 +1,35 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
3
+    <device id="retina3_5" orientation="portrait" appearance="light"/>
4
+    <dependencies>
5
+        <deployment identifier="iOS"/>
6
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
7
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8
+    </dependencies>
9
+    <objects>
10
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
11
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
12
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
13
+            <rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
14
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
15
+            <subviews>
16
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="MEu-9j-Yk9">
17
+                    <rect key="frame" x="0.0" y="0.0" width="320" height="440"/>
18
+                </imageView>
19
+            </subviews>
20
+            <color key="backgroundColor" red="0.74509803921568629" green="0.082352941176470587" blue="0.13333333333333333" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
21
+            <constraints>
22
+                <constraint firstItem="MEu-9j-Yk9" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="topMargin" id="JBv-Ns-A6x"/>
23
+                <constraint firstItem="MEu-9j-Yk9" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="JNO-FD-uRI"/>
24
+                <constraint firstItem="MEu-9j-Yk9" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="KdP-HF-t4U"/>
25
+                <constraint firstItem="MEu-9j-Yk9" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="LNb-Oe-Px1"/>
26
+            </constraints>
27
+            <nil key="simulatedStatusBarMetrics"/>
28
+            <modalPageSheetSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
29
+            <point key="canvasLocation" x="546.37681159420299" y="453.26086956521743"/>
30
+        </view>
31
+    </objects>
32
+    <resources>
33
+        <image name="LaunchScreen" width="682.66668701171875" height="200"/>
34
+    </resources>
35
+</document>

BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/1024.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/120-1.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/120.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/180.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/40.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/58.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/60.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/80.png View File


BIN
ios/Campus/Images.xcassets/AppIcon.appiconset/87.png View File


+ 62
- 0
ios/Campus/Images.xcassets/AppIcon.appiconset/Contents.json View File

@@ -0,0 +1,62 @@
1
+{
2
+  "images" : [
3
+    {
4
+      "filename" : "40.png",
5
+      "idiom" : "iphone",
6
+      "scale" : "2x",
7
+      "size" : "20x20"
8
+    },
9
+    {
10
+      "filename" : "60.png",
11
+      "idiom" : "iphone",
12
+      "scale" : "3x",
13
+      "size" : "20x20"
14
+    },
15
+    {
16
+      "filename" : "58.png",
17
+      "idiom" : "iphone",
18
+      "scale" : "2x",
19
+      "size" : "29x29"
20
+    },
21
+    {
22
+      "filename" : "87.png",
23
+      "idiom" : "iphone",
24
+      "scale" : "3x",
25
+      "size" : "29x29"
26
+    },
27
+    {
28
+      "filename" : "80.png",
29
+      "idiom" : "iphone",
30
+      "scale" : "2x",
31
+      "size" : "40x40"
32
+    },
33
+    {
34
+      "filename" : "120-1.png",
35
+      "idiom" : "iphone",
36
+      "scale" : "3x",
37
+      "size" : "40x40"
38
+    },
39
+    {
40
+      "filename" : "120.png",
41
+      "idiom" : "iphone",
42
+      "scale" : "2x",
43
+      "size" : "60x60"
44
+    },
45
+    {
46
+      "filename" : "180.png",
47
+      "idiom" : "iphone",
48
+      "scale" : "3x",
49
+      "size" : "60x60"
50
+    },
51
+    {
52
+      "filename" : "1024.png",
53
+      "idiom" : "ios-marketing",
54
+      "scale" : "1x",
55
+      "size" : "1024x1024"
56
+    }
57
+  ],
58
+  "info" : {
59
+    "author" : "xcode",
60
+    "version" : 1
61
+  }
62
+}

+ 6
- 0
ios/Campus/Images.xcassets/Contents.json View File

@@ -0,0 +1,6 @@
1
+{
2
+  "info" : {
3
+    "version" : 1,
4
+    "author" : "xcode"
5
+  }
6
+}

+ 21
- 0
ios/Campus/Images.xcassets/LaunchScreen.imageset/Contents.json View File

@@ -0,0 +1,21 @@
1
+{
2
+  "images" : [
3
+    {
4
+      "idiom" : "universal",
5
+      "scale" : "1x"
6
+    },
7
+    {
8
+      "idiom" : "universal",
9
+      "scale" : "2x"
10
+    },
11
+    {
12
+      "filename" : "splash.png",
13
+      "idiom" : "universal",
14
+      "scale" : "3x"
15
+    }
16
+  ],
17
+  "info" : {
18
+    "author" : "xcode",
19
+    "version" : 1
20
+  }
21
+}

BIN
ios/Campus/Images.xcassets/LaunchScreen.imageset/splash.png View File


+ 79
- 0
ios/Campus/Info.plist View File

@@ -0,0 +1,79 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>CFBundleDevelopmentRegion</key>
6
+	<string>en</string>
7
+	<key>CFBundleDisplayName</key>
8
+	<string>Campus</string>
9
+	<key>CFBundleExecutable</key>
10
+	<string>$(EXECUTABLE_NAME)</string>
11
+	<key>CFBundleIdentifier</key>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+	<key>CFBundleInfoDictionaryVersion</key>
14
+	<string>6.0</string>
15
+	<key>CFBundleName</key>
16
+	<string>$(PRODUCT_NAME)</string>
17
+	<key>CFBundlePackageType</key>
18
+	<string>APPL</string>
19
+	<key>CFBundleShortVersionString</key>
20
+	<string>$(MARKETING_VERSION)</string>
21
+	<key>CFBundleSignature</key>
22
+	<string>????</string>
23
+	<key>CFBundleURLTypes</key>
24
+	<array>
25
+		<dict>
26
+			<key>CFBundleURLSchemes</key>
27
+			<array>
28
+				<string>campus-insat</string>
29
+			</array>
30
+		</dict>
31
+	</array>
32
+	<key>CFBundleVersion</key>
33
+	<string>$(CURRENT_PROJECT_VERSION)</string>
34
+	<key>FacebookAdvertiserIDCollectionEnabled</key>
35
+	<false/>
36
+	<key>FacebookAutoInitEnabled</key>
37
+	<false/>
38
+	<key>FacebookAutoLogAppEventsEnabled</key>
39
+	<false/>
40
+	<key>LSRequiresIPhoneOS</key>
41
+	<true/>
42
+	<key>NSAppTransportSecurity</key>
43
+	<dict>
44
+		<key>NSAllowsArbitraryLoads</key>
45
+		<true/>
46
+		<key>NSExceptionDomains</key>
47
+		<dict>
48
+			<key>localhost</key>
49
+			<dict>
50
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
51
+				<true/>
52
+			</dict>
53
+		</dict>
54
+	</dict>
55
+	<key>NSCameraUsageDescription</key>
56
+	<string>Allow Campus to use the camera</string>
57
+	<key>UILaunchStoryboardName</key>
58
+	<string>LaunchScreen</string>
59
+	<key>UIRequiredDeviceCapabilities</key>
60
+	<array>
61
+		<string>armv7</string>
62
+	</array>
63
+	<key>UIRequiresFullScreen</key>
64
+	<true/>
65
+	<key>UISupportedInterfaceOrientations</key>
66
+	<array>
67
+		<string>UIInterfaceOrientationPortrait</string>
68
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
69
+	</array>
70
+	<key>UIUserInterfaceStyle</key>
71
+	<string>Automatic</string>
72
+	<key>UIViewControllerBasedStatusBarAppearance</key>
73
+	<false/>
74
+	<key>UIAppFonts</key>
75
+    <array>
76
+      <string>MaterialCommunityIcons.ttf</string>
77
+    </array>
78
+</dict>
79
+</plist>

+ 0
- 0
ios/Campus/Supporting/app.bundle View File


+ 1
- 0
ios/Campus/Supporting/app.manifest View File

@@ -0,0 +1 @@
1
+{}

+ 5
- 0
ios/Campus/application.entitlements View File

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+  <dict/>
5
+</plist>

+ 16
- 0
ios/Campus/main.m View File

@@ -0,0 +1,16 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <UIKit/UIKit.h>
9
+
10
+#import "AppDelegate.h"
11
+
12
+int main(int argc, char * argv[]) {
13
+  @autoreleasepool {
14
+    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15
+  }
16
+}

+ 49
- 0
ios/Podfile View File

@@ -0,0 +1,49 @@
1
+platform :ios, '9.0'
2
+
3
+require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
4
+
5
+target 'Campus' do
6
+  rnPrefix = "../node_modules/react-native"
7
+
8
+  # React Native and its dependencies
9
+  pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector"
10
+  pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec"
11
+  pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired"
12
+  pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety"
13
+  pod 'React', :path => "#{rnPrefix}/"
14
+  pod 'React-Core', :path => "#{rnPrefix}/"
15
+  pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules"
16
+  pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS"
17
+  pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation"
18
+  pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob"
19
+  pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Image"
20
+  pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS"
21
+  pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Network"
22
+  pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings"
23
+  pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text"
24
+  pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration"
25
+  pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/"
26
+  pod 'React-Core/DevSupport', :path => "#{rnPrefix}/"
27
+  pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact"
28
+  pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi"
29
+  pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor"
30
+  pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector"
31
+  pod 'ReactCommon/jscallinvoker', :path => "#{rnPrefix}/ReactCommon"
32
+  pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon"
33
+  pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga"
34
+  pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
35
+  pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec"
36
+  pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec"
37
+
38
+  # Other native modules
39
+
40
+  # react-native-cli autolinking
41
+  use_native_modules!
42
+
43
+  # Permissions
44
+  permissions_path = '../node_modules/react-native-permissions/ios'
45
+
46
+  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
47
+  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
48
+
49
+end

+ 17
- 0
metro.config.js View File

@@ -0,0 +1,17 @@
1
+/**
2
+ * Metro configuration for React Native
3
+ * https://github.com/facebook/react-native
4
+ *
5
+ * @format
6
+ */
7
+
8
+module.exports = {
9
+    transformer: {
10
+        getTransformOptions: async () => ({
11
+            transform: {
12
+                experimentalImportSupport: false,
13
+                inlineRequires: false,
14
+            },
15
+        }),
16
+    },
17
+};

+ 0
- 0
navigation/DrawerNavigator.js View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save