Compare commits

...

33 commits

Author SHA1 Message Date
3b5b0aaa1a Updated Changelog.md 2020-06-13 17:19:55 +02:00
b150ac55ef Increased version number 2020-06-06 20:18:46 +02:00
742a1f445a Changed scanner mask into a square 2020-06-06 20:06:02 +02:00
f759c44f20 Removed unused pref key 2020-06-06 20:03:23 +02:00
0c881f5ce9 Moved debug, about and feedback inside settings screen 2020-06-06 20:01:17 +02:00
8163429539 Improved bluemind usability 2020-06-06 19:38:32 +02:00
2d59912c1a Fixed wiketud controls hidden 2020-06-06 19:19:57 +02:00
44cb35d6d9 Updated version number and changelog 2020-06-03 17:49:57 +02:00
7fa477ddf8 Merge remote-tracking branch 'origin/dev' into dev 2020-06-02 17:36:28 +02:00
38538d562d Updated intro slider and translations 2020-06-02 17:36:15 +02:00
bbd4b5c9b4 Fixed ios crash on startup 2020-06-01 11:27:12 +02:00
1c2d2ab1ca Fixed padding breaking other components offsets 2020-05-31 17:18:53 +02:00
e2cdc26442 Added padding to tab bar bottom for iPhoneX devices 2020-05-31 16:30:38 +02:00
9cf3484dbf Display a message when no menu is available 2020-05-31 16:00:42 +02:00
21a447ca60 Use dark theme by default 2020-05-31 15:49:07 +02:00
baf1a9f563 Updated android config file to better match vanilla react native project and fixed release apk crash on some devices 2020-05-31 15:39:07 +02:00
cc82a8c8a9 Fixed yoga path 2020-05-29 14:32:29 +02:00
870323b618 Fixed podfile 2020-05-29 14:29:56 +02:00
8c8b9c776d updated podflie to disable flipper 2020-05-29 14:27:37 +02:00
1a3ba5d4c5 Merge branch 'dev' of https://git.etud.insa-toulouse.fr/vergnet/application-amicale into dev 2020-05-29 14:20:41 +02:00
3c1bcb19dc updated ios scheme to match upgrade indications 2020-05-29 14:17:58 +02:00
90336b22f8 Merge branch 'dev' of https://git.etud.insa-toulouse.fr/vergnet/application-amicale into dev 2020-05-28 16:53:07 +02:00
a7cac7767d Edited app delegate file to match upgrade instructions 2020-05-28 16:45:32 +02:00
0590cc1972 updated xcode project version 2020-05-28 11:43:51 +02:00
0cf69bff59 Fixed xcode scheme error 2020-05-28 11:41:37 +02:00
2100aea6bf Updated changelog 2020-05-28 11:00:24 +02:00
f201b5004d Added amicale website to student services 2020-05-28 10:54:00 +02:00
a0bb02991f Fixed feedback and bug emails 2020-05-27 16:57:25 +02:00
44e0f63e64 Enabled proguard in release builds 2020-05-27 16:24:01 +02:00
7658cbcb16 Added safe area for tab bar 2020-05-27 15:30:01 +02:00
a27d0b7fa6 Updated slider lib 2020-05-27 15:27:35 +02:00
cbd741d54b Fixed deprecation warning 2020-05-27 14:57:55 +02:00
d18b812e53 Updated react native to 62.2 2020-05-27 14:55:03 +02:00
34 changed files with 513 additions and 343 deletions

16
App.js
View file

@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import {Platform, StatusBar, View, YellowBox} from 'react-native';
import {Platform, SafeAreaView, StatusBar, View, YellowBox} from 'react-native';
import LocaleManager from './src/managers/LocaleManager';
import AsyncStorageManager from "./src/managers/AsyncStorageManager";
import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider";
@ -192,12 +192,14 @@ export default class App extends React.Component<Props, State> {
<PaperProvider theme={this.state.currentTheme}>
<OverflowMenuProvider>
<View style={{backgroundColor: ThemeManager.getCurrentTheme().colors.background, flex: 1}}>
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
<MainNavigator
defaultHomeRoute={this.defaultHomeRoute}
defaultHomeData={this.defaultHomeData}
/>
</NavigationContainer>
<SafeAreaView style={{flex: 1}}>
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
<MainNavigator
defaultHomeRoute={this.defaultHomeRoute}
defaultHomeData={this.defaultHomeData}
/>
</NavigationContainer>
</SafeAreaView>
</View>
</OverflowMenuProvider>
</PaperProvider>

View file

@ -2,6 +2,22 @@
Pensez à garder l'appli à jour pour profiter des dernières fonctionnalités !
- **v3.0.7** - 13/06/2020
- Correction de crash au démarrage sur certains appareils
- Mise à jour des écrans d'intro pour mieux refléter l'appli actuelle
- Déplacement du bouton *À propos* dans les paramètres
- Mode sombre par défaut parce que voilà
- Correction de l'affichage de certains sites web
- _Notes de développement :_
- Force soloader 0.8.2
- **v3.0.5** - 28/05/2020
- Importante amélioration de la vitesse de démarrage et des performances
- Nouvelle réduction importante de la taille de l'application à télécharger et une fois installée
- _Notes de développement :_
- Passage de React Native 61.5 à 62.2
- Utilisation du moteur JS Hermes et proguard
- **v3.0.0** - 26/05/2020
- Nouvelle barre de navigation !
- Nouveau planex tout beau tout neuf !

View file

@ -77,7 +77,7 @@ import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
enableHermes: false,
enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
@ -100,7 +100,7 @@ def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
def enableProguardInReleaseBuilds = true
/**
* The preferred build flavor of JavaScriptCore.
@ -136,8 +136,8 @@ android {
applicationId 'fr.amicaleinsat.application'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 19
versionName "3.0.2"
versionCode 24
versionName "3.0.7"
missingDimensionStrategy 'react-native-camera', 'general'
}
splits {
@ -176,6 +176,22 @@ android {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/x86/libc++_shared.so"
pickFirst "lib/x86_64/libc++_shared.so"
}
// Force so_loader version to fix crash on apk release
configurations.all {
resolutionStrategy {
force "com.facebook.soloader:soloader:0.8.2"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
@ -194,8 +210,23 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

View file

@ -0,0 +1,68 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package fr.amicaleinsat.application;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}

View file

@ -1,12 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="fr.amicaleinsat.application">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.amicaleinsat.application">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
@ -16,40 +17,43 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
>
<!-- NOTIFICATIONS -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="reminders"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="reminders"/>
<!-- NOTIFICATIONS -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="reminders"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="reminders"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/colorPrimary"/> <!-- or @android:color/{name} to use a standard color -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/colorPrimary"/> <!-- or @android:color/{name} to use a standard color -->
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher"/>
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<!-- END NOTIFICATIONS-->
<!-- END NOTIFICATIONS-->
<meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="false"/>
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/>
<activity android:name=".MainActivity" android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask" android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@ -63,4 +67,4 @@
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>
</manifest>

View file

@ -33,7 +33,7 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "main";
return "Campus";
}
@Override

View file

@ -5,6 +5,7 @@ import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
@ -17,23 +18,27 @@ import javax.annotation.Nullable;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
return packages;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
@ -44,23 +49,28 @@ public class MainApplication extends Application implements ReactApplication {
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates.
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(Context context) {
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
Class<?> aClass = Class.forName("com.rndiffapp.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {

View file

@ -12,7 +12,7 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
classpath("com.android.tools.build:gradle:3.5.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -36,6 +36,6 @@ allprojects {
}
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://www.jitpack.io' }
}
}

View file

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

6
android/gradlew vendored
View file

@ -7,7 +7,7 @@
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@ -125,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

View file

@ -1,4 +1,9 @@
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent('main', () => App);
AppRegistry.registerComponent(appName, () => App);

View file

@ -328,7 +328,7 @@
DEVELOPMENT_TEAM = 6JA7CLNUV6;
INFOPLIST_FILE = Campus/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 3.0.5;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@ -353,7 +353,7 @@
DEVELOPMENT_TEAM = 6JA7CLNUV6;
INFOPLIST_FILE = Campus/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 3.0.5;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",

View file

@ -1,25 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
@ -34,20 +20,6 @@
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "CampusTests.xctest"
BlueprintName = "CampusTests"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
@ -55,15 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "application.app"
BlueprintName = "Campus"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@ -78,7 +41,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View file

@ -15,6 +15,24 @@
#import <RNCPushNotificationIOS.h>
#import <UserNotifications/UserNotifications.h>
#if DEBUG
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
#endif
@implementation AppDelegate
@synthesize window = _window;
@ -26,11 +44,14 @@
return [RCTLinkingManager application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
InitializeFlipper(application);
#endif
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Campus" initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

View file

@ -54,6 +54,10 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>Allow Campus to use the camera</string>
<key>UIAppFonts</key>
<array>
<string>MaterialCommunityIcons.ttf</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
@ -71,9 +75,5 @@
<string>Automatic</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIAppFonts</key>
<array>
<string>MaterialCommunityIcons.ttf</string>
</array>
</dict>
</plist>

View file

@ -1,11 +1,50 @@
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'Campus' do
rnPrefix = "../node_modules/react-native"
def add_flipper_pods!(versions = {})
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end
# React Native and its dependencies
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'Campus' do
# Pods for Campus
rnPrefix = "../node_modules/react-native"
pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired"
@ -23,20 +62,19 @@ target 'Campus' do
pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text"
pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration"
pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/"
pod 'React-Core/DevSupport', :path => "#{rnPrefix}/"
pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact"
pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi"
pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor"
pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector"
pod 'ReactCommon/jscallinvoker', :path => "#{rnPrefix}/ReactCommon"
pod 'ReactCommon/callinvoker', :path => "#{rnPrefix}/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon"
pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga"
pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga", :modular_headers => true
pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec"
# Other native modules
# react-native-cli autolinking
use_native_modules!
@ -46,4 +84,13 @@ target 'Campus' do
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
#add_flipper_pods!
#post_install do |installer|
# flipper_post_install(installer)
#end
end

View file

@ -1,6 +1,6 @@
{
"name": "campus",
"version": "3.0.2",
"version": "3.0.7",
"private": true,
"scripts": {
"start": "react-native start",
@ -23,14 +23,13 @@
"@react-native-community/async-storage": "^1.9.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/push-notification-ios": "^1.1.1",
"@react-native-community/slider": "^2.0.9",
"@react-native-community/slider": "^3.0.0",
"@react-navigation/bottom-tabs": "^5.3.2",
"@react-navigation/native": "^5.2.2",
"@react-navigation/stack": "^5.2.17",
"i18n-js": "^3.3.0",
"react": "~16.9.0",
"react-dom": "16.9.0",
"react-native": "~0.61.5",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-animatable": "^1.3.3",
"react-native-app-intro-slider": "^4.0.0",
"react-native-appearance": "~0.3.3",
@ -58,15 +57,15 @@
"react-navigation-header-buttons": "^4.0.2"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/runtime": "^7.9.6",
"@react-native-community/eslint-config": "^1.1.0",
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^25.5.1",
"eslint": "^6.5.1",
"flow-bin": "^0.123.0",
"jest": "^25.5.3",
"jest-extended": "^0.11.5",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.9.0"
"metro-react-native-babel-preset": "^0.58.0",
"react-test-renderer": "16.11.0"
}
}

View file

@ -4,7 +4,6 @@ import * as React from 'react';
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
import {HeaderButton, HeaderButtons} from 'react-navigation-header-buttons';
import {withTheme} from "react-native-paper";
import * as Touchable from "react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android";
const MaterialHeaderButton = (props: Object) =>
<HeaderButton
@ -12,7 +11,6 @@ const MaterialHeaderButton = (props: Object) =>
IconComponent={MaterialCommunityIcons}
iconSize={26}
color={props.color != null ? props.color : props.theme.colors.text}
background={Touchable.Ripple(props.theme.colors.ripple, true)}
/>;
const MaterialHeaderButtons = (props: Object) => {

View file

@ -36,53 +36,53 @@ export default class CustomIntroSlider extends React.Component<Props> {
this.sliderRef = React.createRef();
this.introSlides = [
{
key: '1',
title: i18n.t('intro.slide1.title'),
text: i18n.t('intro.slide1.text'),
key: 'main',
title: i18n.t('intro.slideMain.title'),
text: i18n.t('intro.slideMain.text'),
image: require('../../../assets/splash.png'),
colors: ['#dc2634', '#be1522'],
colors: ['#be1522', '#740d15'],
},
{
key: '2',
title: i18n.t('intro.slide2.title'),
text: i18n.t('intro.slide2.text'),
icon: 'calendar-range',
colors: ['#d99e09', '#9e7205'],
},
{
key: '3',
title: i18n.t('intro.slide3.title'),
text: i18n.t('intro.slide3.text'),
icon: 'washing-machine',
colors: ['#1fa5ee', '#0976b1'],
},
{
key: '4',
title: i18n.t('intro.slide4.title'),
text: i18n.t('intro.slide4.text'),
icon: 'shopping',
colors: ['#ec5904', '#b64300'],
},
{
key: '5',
title: i18n.t('intro.slide5.title'),
text: i18n.t('intro.slide5.text'),
key: 'Planex',
title: i18n.t('intro.slidePlanex.title'),
text: i18n.t('intro.slidePlanex.text'),
icon: 'timetable',
colors: ['#7c33ec', '#5e11d1'],
colors: ['#e77020', '#803e12'],
},
{
key: '6',
title: i18n.t('intro.slide6.title'),
text: i18n.t('intro.slide6.text'),
key: 'RU',
title: i18n.t('intro.slideRU.title'),
text: i18n.t('intro.slideRU.text'),
icon: 'silverware-fork-knife',
colors: ['#ec1213', '#970902'],
colors: ['#dcac18', '#8b6a15'],
},
{
key: '7',
title: i18n.t('intro.slide7.title'),
text: i18n.t('intro.slide7.text'),
icon: 'cogs',
colors: ['#37c13e', '#1a5a1d'],
key: 'events',
title: i18n.t('intro.slideEvents.title'),
text: i18n.t('intro.slideEvents.text'),
icon: 'calendar-range',
colors: ['#41a006', '#095c03'],
},
{
key: 'proxiwash',
title: i18n.t('intro.slideProxiwash.title'),
text: i18n.t('intro.slideProxiwash.text'),
icon: 'washing-machine',
colors: ['#1fa5ee', '#06537d'],
},
{
key: 'services',
title: i18n.t('intro.slideServices.title'),
text: i18n.t('intro.slideServices.text'),
icon: 'view-dashboard-variant',
colors: ['#6737c1', '#281a5a'],
},
{
key: 'done',
title: i18n.t('intro.slideDone.title'),
text: i18n.t('intro.slideDone.text'),
icon: 'account-heart',
colors: ['#b837c1', '#501a5a'],
},
];
this.updateSlides = [];

View file

@ -21,6 +21,7 @@ type Props = {
theme: CustomTheme,
url: string,
customJS: string,
customPaddingFunction: null | (padding: number) => string,
collapsibleStack: Collapsible,
onMessage: Function,
onScroll: Function,
@ -37,6 +38,7 @@ class WebViewScreen extends React.PureComponent<Props> {
static defaultProps = {
customJS: '',
showAdvancedControls: true,
customPaddingFunction: null,
};
webviewRef: Object;
@ -139,14 +141,14 @@ class WebViewScreen extends React.PureComponent<Props> {
/**
* Callback to use when refresh button is clicked. Reloads the webview.
*/
onRefreshClicked = () => this.webviewRef.current.getNode().reload(); // Need to call getNode() as we are working with animated components
onGoBackClicked = () => this.webviewRef.current.getNode().goBack();
onGoForwardClicked = () => this.webviewRef.current.getNode().goForward();
onRefreshClicked = () => this.webviewRef.current.reload();
onGoBackClicked = () => this.webviewRef.current.goBack();
onGoForwardClicked = () => this.webviewRef.current.goForward();
onOpenClicked = () => Linking.openURL(this.props.url);
injectJavaScript = (script: string) => {
this.webviewRef.current.getNode().injectJavaScript(script);
this.webviewRef.current.injectJavaScript(script);
}
/**
@ -157,8 +159,10 @@ class WebViewScreen extends React.PureComponent<Props> {
getRenderLoading = () => <BasicLoadingScreen isAbsolute={true}/>;
getJavascriptPadding(padding: number) {
const customPadding = this.props.customPaddingFunction != null ? this.props.customPaddingFunction(padding) : "";
return (
"document.getElementsByTagName('body')[0].style.paddingTop = '" + padding + "px';" +
customPadding +
"true;"
);
}

View file

@ -36,13 +36,6 @@ class CustomTabBar extends React.Component<Props, State> {
barSynced: false,// Is the bar synced with the header for animations?
}
tabRef: Object;
constructor(props) {
super(props);
this.tabRef = React.createRef();
}
onItemPress(route: Object, currentIndex: number, destIndex: number) {
const event = this.props.navigation.emit({
type: 'tabPress',
@ -67,13 +60,13 @@ class CustomTabBar extends React.Component<Props, State> {
}
tabBarIcon = (route, focused) => {
let icon = TAB_ICONS[route.name];
icon = focused ? icon : icon + ('-outline');
if (route.name !== "home")
return icon;
else
return null;
};
let icon = TAB_ICONS[route.name];
icon = focused ? icon : icon + ('-outline');
if (route.name !== "home")
return icon;
else
return null;
};
onRouteChange = () => {
@ -135,10 +128,7 @@ class CustomTabBar extends React.Component<Props, State> {
this.props.navigation.addListener('state', this.onRouteChange);
return (
<Animated.View
ref={this.tabRef}
// animation={"fadeInUp"}
// duration={500}
// useNativeDriver
useNativeDriver
style={{
flexDirection: 'row',
height: CustomTabBar.TAB_BAR_HEIGHT,
@ -147,7 +137,7 @@ class CustomTabBar extends React.Component<Props, State> {
bottom: 0,
left: 0,
backgroundColor: this.props.theme.colors.surface,
transform: [{translateY: this.state.translateY}]
transform: [{translateY: this.state.translateY}],
}}
>
{this.props.state.routes.map(this.renderIcon)}

View file

@ -24,6 +24,11 @@ export default class AsyncStorageManager {
// Object storing preferences keys, default and current values for use in the app
preferences = {
debugUnlocked: {
key: 'debugUnlocked',
default: '0',
current: '',
},
showIntro: {
key: 'showIntro',
default: '1',
@ -46,17 +51,7 @@ export default class AsyncStorageManager {
},
nightMode: {
key: 'nightMode',
default: '0',
current: '',
},
expoToken: {
key: 'expoToken',
default: '',
current: '',
},
debugUnlocked: {
key: 'debugUnlocked',
default: '0',
default: '1',
current: '',
},
defaultStartScreen: {

View file

@ -3,7 +3,6 @@
import * as React from 'react';
import {FlatList, Linking, Platform, View} from 'react-native';
import i18n from "i18n-js";
import AsyncStorageManager from "../../managers/AsyncStorageManager";
import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
import packageJson from "../../../package.json";
@ -32,10 +31,6 @@ type Props = {
navigation: Object,
};
type State = {
isDebugUnlocked: boolean,
};
/**
* Opens a link in the device's browser
* @param link The link to open
@ -47,14 +42,8 @@ function openWebLink(link) {
/**
* Class defining an about screen. This screen shows the user information about the app and it's author.
*/
class AboutScreen extends React.Component<Props, State> {
class AboutScreen extends React.Component<Props> {
debugTapCounter = 0;
modalRef: Object;
state = {
isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1'
};
/**
* Data to be displayed in the app card
*/
@ -89,20 +78,13 @@ class AboutScreen extends React.Component<Props, State> {
text: i18n.t('aboutScreen.license'),
showChevron: true
},
{
onPressCallback: () => this.props.navigation.navigate('debug'),
icon: 'bug-check',
text: i18n.t('aboutScreen.debug'),
showChevron: true,
showOnlyInDebug: true
},
];
/**
* Data to be displayed in the author card
*/
authorData: Array<Object> = [
{
onPressCallback: () => this.tryUnlockDebugMode(),
onPressCallback: () => console.log('cc'),
icon: 'account-circle',
text: 'Arnaud VERGNET',
showChevron: false
@ -223,7 +205,6 @@ class AboutScreen extends React.Component<Props, State> {
<Card.Content>
<FlatList
data={this.appData}
extraData={this.state.isDebugUnlocked}
keyExtractor={this.keyExtractor}
renderItem={this.getCardItem}
/>
@ -314,51 +295,26 @@ class AboutScreen extends React.Component<Props, State> {
* @returns {*}
*/
getCardItem = ({item}: Object) => {
let shouldShow = item === undefined
|| !item.showOnlyInDebug
|| (item.showOnlyInDebug && this.state.isDebugUnlocked);
const getItemIcon = this.getItemIcon.bind(this, item);
if (shouldShow) {
if (item.showChevron) {
return (
<List.Item
title={item.text}
left={getItemIcon}
right={this.getChevronIcon}
onPress={item.onPressCallback}
/>
);
} else {
return (
<List.Item
title={item.text}
left={getItemIcon}
onPress={item.onPressCallback}
/>
);
}
} else
return null;
};
/**
* Tries to unlock debug mode
*/
tryUnlockDebugMode() {
this.debugTapCounter = this.debugTapCounter + 1;
if (this.debugTapCounter >= 4) {
this.unlockDebugMode();
if (item.showChevron) {
return (
<List.Item
title={item.text}
left={getItemIcon}
right={this.getChevronIcon}
onPress={item.onPressCallback}
/>
);
} else {
return (
<List.Item
title={item.text}
left={getItemIcon}
onPress={item.onPressCallback}
/>
);
}
}
/**
* Unlocks debug mode
*/
unlockDebugMode() {
this.setState({isDebugUnlocked: true});
let key = AsyncStorageManager.getInstance().preferences.debugUnlocked.key;
AsyncStorageManager.getInstance().savePref(key, '1');
}
};
/**
* Gets a card, depending on the given item's id

View file

@ -174,11 +174,9 @@ class HomeScreen extends React.Component<Props, State> {
}
const onPressSettings = () => this.props.navigation.navigate("settings");
const onPressAbout = () => this.props.navigation.navigate("about");
return <MaterialHeaderButtons>
<Item title="log" iconName={logIcon} color={logColor} onPress={onPressLog}/>
<Item title={i18n.t("screens.settings")} iconName={"settings"} onPress={onPressSettings}/>
<Item title={i18n.t("screens.about")} iconName={"information"} onPress={onPressAbout}/>
</MaterialHeaderButtons>;
};

View file

@ -123,6 +123,8 @@ class ScannerScreen extends React.Component<Props, State> {
maskOpacity={0.5}
animatedLineThickness={1}
animationDuration={1000}
width={250}
height={250}
/>
</RNCamera>
);

View file

@ -11,8 +11,7 @@ type Props = {
};
const links = {
bugsMail: `mailto:app@amicale-insat.fr
?subject=[BUG] Application CAMPUS
bugsMail: `mailto:app@amicale-insat.fr?subject=[BUG] Application CAMPUS
&body=Coucou Arnaud ça bug c'est nul,\n\n
Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n
Nature du problème :\n\n\n
@ -20,8 +19,7 @@ Nature du problème :\n\n\n
Stp corrige le pb, bien cordialement.`,
bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues/new',
facebook: "https://www.facebook.com/campus.insat",
feedbackMail: `mailto:app@amicale-insat.fr
?subject=[FEEDBACK] Application CAMPUS
feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
&body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
feedbackGit: "https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues/new",
}

View file

@ -9,8 +9,10 @@ import AsyncStorageManager from "../../managers/AsyncStorageManager";
import {Card, List, Switch, ToggleButton, withTheme} from 'react-native-paper';
import {Appearance} from "react-native-appearance";
import CustomSlider from "../../components/Overrides/CustomSlider";
import {StackNavigationProp} from "@react-navigation/stack";
type Props = {
navigation: StackNavigationProp,
theme: CustomTheme,
};
@ -19,6 +21,7 @@ type State = {
nightModeFollowSystem: boolean,
notificationReminderSelected: number,
startScreenPickerSelected: string,
isDebugUnlocked: boolean,
};
/**
@ -41,9 +44,19 @@ class SettingsScreen extends React.Component<Props, State> {
Appearance.getColorScheme() !== 'no-preference',
notificationReminderSelected: this.savedNotificationReminder,
startScreenPickerSelected: AsyncStorageManager.getInstance().preferences.defaultStartScreen.current,
isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1'
};
}
/**
* Unlocks debug mode
*/
unlockDebugMode = () => {
this.setState({isDebugUnlocked: true});
let key = AsyncStorageManager.getInstance().preferences.debugUnlocked.key;
AsyncStorageManager.getInstance().savePref(key, '1');
}
/**
* Saves the value for the proxiwash reminder notification time
*
@ -205,6 +218,31 @@ class SettingsScreen extends React.Component<Props, State> {
</View>
</List.Section>
</Card>
<Card style={{margin: 5}}>
<Card.Title title={i18n.t('settingsScreen.information')}/>
<List.Section>
{this.state.isDebugUnlocked
? <List.Item
title={i18n.t('screens.debug')}
left={props => <List.Icon {...props} icon="bug-check"/>}
onPress={() => this.props.navigation.navigate("debug")}
/>
:null}
<List.Item
title={i18n.t('screens.about')}
description={i18n.t('aboutScreen.buttonDesc')}
left={props => <List.Icon {...props} icon="information"/>}
onPress={() => this.props.navigation.navigate("about")}
onLongPress={this.unlockDebugMode}
/>
<List.Item
title={i18n.t('feedbackScreen.homeButtonTitle')}
description={i18n.t('feedbackScreen.homeButtonSubtitle')}
left={props => <List.Icon {...props} icon="bug"/>}
onPress={() => this.props.navigation.navigate("feedback")}
/>
</List.Section>
</Card>
</ScrollView>
);
}

View file

@ -6,11 +6,15 @@ import DateManager from "../../managers/DateManager";
import WebSectionList from "../../components/Screens/WebSectionList";
import {Card, Text, withTheme} from 'react-native-paper';
import AprilFoolsManager from "../../managers/AprilFoolsManager";
import {StackNavigationProp} from "@react-navigation/stack";
import type {CustomTheme} from "../../managers/ThemeManager";
import i18n from 'i18n-js';
const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/menu/menu_data.json";
type Props = {
navigation: Object,
navigation: StackNavigationProp,
theme: CustomTheme,
}
/**
@ -18,20 +22,6 @@ type Props = {
*/
class SelfMenuScreen extends React.Component<Props> {
getRenderItem: Function;
getRenderSectionHeader: Function;
createDataset: Function;
colors: Object;
constructor(props) {
super(props);
this.getRenderItem = this.getRenderItem.bind(this);
this.getRenderSectionHeader = this.getRenderSectionHeader.bind(this);
this.createDataset = this.createDataset.bind(this);
this.colors = props.theme.colors;
}
/**
* Extract a key for the given item
*
@ -48,32 +38,32 @@ class SelfMenuScreen extends React.Component<Props> {
* @param fetchedData
* @return {[]}
*/
createDataset(fetchedData: Object) {
createDataset = (fetchedData: Object) => {
let result = [];
// Prevent crash by giving a default value when fetchedData is empty (not yet available)
if (Object.keys(fetchedData).length === 0) {
if (fetchedData == null || Object.keys(fetchedData).length === 0) {
result = [
{
title: '',
title: i18n.t("general.notAvailable"),
data: [],
keyExtractor: this.getKeyExtractor
}
];
}
if (AprilFoolsManager.getInstance().isAprilFoolsEnabled() && fetchedData.length > 0)
fetchedData[0].meal[0].foodcategory = AprilFoolsManager.getFakeMenuItem(fetchedData[0].meal[0].foodcategory);
// fetched data is an array here
for (let i = 0; i < fetchedData.length; i++) {
result.push(
{
title: DateManager.getInstance().getTranslatedDate(fetchedData[i].date),
data: fetchedData[i].meal[0].foodcategory,
keyExtractor: this.getKeyExtractor,
}
);
} else {
if (AprilFoolsManager.getInstance().isAprilFoolsEnabled() && fetchedData.length > 0)
fetchedData[0].meal[0].foodcategory = AprilFoolsManager.getFakeMenuItem(fetchedData[0].meal[0].foodcategory);
// fetched data is an array here
for (let i = 0; i < fetchedData.length; i++) {
result.push(
{
title: DateManager.getInstance().getTranslatedDate(fetchedData[i].date),
data: fetchedData[i].meal[0].foodcategory,
keyExtractor: this.getKeyExtractor,
}
);
}
}
return result
}
};
/**
* Gets the render section header
@ -81,7 +71,7 @@ class SelfMenuScreen extends React.Component<Props> {
* @param section The section to render the header from
* @return {*}
*/
getRenderSectionHeader({section}: Object) {
getRenderSectionHeader = ({section}: Object) => {
return (
<Card style={{
width: '95%',
@ -105,7 +95,7 @@ class SelfMenuScreen extends React.Component<Props> {
/>
</Card>
);
}
};
/**
* Gets a FlatList render item
@ -113,7 +103,7 @@ class SelfMenuScreen extends React.Component<Props> {
* @param item The item to render
* @return {*}
*/
getRenderItem({item}: Object) {
getRenderItem = ({item}: Object) => {
return (
<Card style={{
flex: 0,
@ -129,7 +119,7 @@ class SelfMenuScreen extends React.Component<Props> {
marginLeft: 'auto',
marginRight: 'auto',
borderBottomWidth: 1,
borderBottomColor: this.colors.primary,
borderBottomColor: this.theme.colors.primary,
marginTop: 5,
marginBottom: 5,
}}/>
@ -147,7 +137,7 @@ class SelfMenuScreen extends React.Component<Props> {
</Card.Content>
</Card>
);
}
};
/**
* Formats the given string to make sure it starts with a capital letter

View file

@ -111,6 +111,12 @@ class ServicesScreen extends React.Component<Props, State> {
image: TUTORINSA_IMAGE,
onPress: () => nav.navigate("tutorinsa"),
},
{
title: i18n.t('screens.amicaleWebsite'),
subtitle: "AMICALE",
image: AMICALE_IMAGE,
onPress: () => nav.navigate("amicale-website"),
},
];
this.insaDataset = [
{

View file

@ -4,6 +4,15 @@ import * as React from 'react';
import WebViewScreen from "../../../components/Screens/WebViewScreen";
const URL = 'https://etud-mel.insa-toulouse.fr/webmail/';
const customPadding = (padding: string) => {
return (
"$('head').append('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">');" +
"$('.minwidth').css('top', " + padding + ");" +
"$('#mailview-bottom').css('min-height', 500);"
);
}
/**
* Class defining the app's available rooms screen.
* This screen uses a webview to render the page
@ -12,6 +21,7 @@ export const BlueMindWebsiteScreen = (props: Object) => {
return (
<WebViewScreen
{...props}
customPaddingFunction={customPadding}
url={URL}/>
);
};

View file

@ -4,6 +4,17 @@ import * as React from 'react';
import WebViewScreen from "../../../components/Screens/WebViewScreen";
const URL = 'https://wiki.etud.insa-toulouse.fr/';
const customPadding = (padding: string) => {
return (
"$('#p-logo-text').css('top', 10 + " + padding + ");" +
"$('#site-navigation h2').css('top', 10 + " + padding + ");" +
"$('#site-tools h2').css('top', 10 + " + padding + ");" +
"$('#user-tools h2').css('top', 10 + " + padding + ");"
);
}
/**
* Class defining the app's available rooms screen.
* This screen uses a webview to render the page
@ -12,6 +23,7 @@ export const WiketudWebsiteScreen = (props: Object) => {
return (
<WebViewScreen
{...props}
customPaddingFunction={customPadding}
url={URL}/>
);
};

View file

@ -28,33 +28,33 @@
"feedback": "Feedback"
},
"intro": {
"slide1": {
"slideMain": {
"title": "Welcome to CAMPUS",
"text": "The new app to use during your coffee break to get updates on the campus life!"
},
"slide2": {
"slideEvents": {
"title": "Stay up to date",
"text": "CAMPUS allows you to be aware of any event occurring on the campus, from pancake sales to Enfoiros concerts!"
},
"slide3": {
"slideProxiwash": {
"title": "Never forget your laundry",
"text": "CAMPUS will inform you on the availability of washing machines and will remind you just before yours finishes!"
},
"slide4": {
"title": "Proximo",
"text": "Are you short on pasta? Or maybe you feel a little peckish, then look up your INSA shop's stock in real time"
},
"slide5": {
"slidePlanex": {
"title": "Planex",
"text": "Lookup your timetable on CAMPUS"
"text": "Lookup your next course on CAMPUS with a mobile friendly timetable"
},
"slide6": {
"slideRU": {
"title": "RU Menu",
"text": "For the hungry, check this week's menu!"
},
"slide7": {
"title": "More to come...",
"text": "New features are coming soon, do not hesitate to give us feedback to improve the app"
"slideServices": {
"title": "More services!",
"text": "You can do much more with CAMPUS, explore the app to find out"
},
"slideDone": {
"title": "Made by a student",
"text": "This app is the work of one student (with some help here and there), so any feedback is appreciated!"
},
"updateSlide0": {
"title": "New in this update!",
@ -91,7 +91,8 @@
"startScreen": "Start Screen",
"startScreenSub": "Select which screen to start the app on",
"proxiwashNotifReminder": "Machine running reminder",
"proxiwashNotifReminderSub": "How many minutes before"
"proxiwashNotifReminderSub": "How many minutes before",
"information": "Information"
},
"homeScreen": {
"listUpdated": "List updated!",
@ -110,6 +111,7 @@
}
},
"aboutScreen": {
"buttonDesc": "Information about the app and its creator",
"appstore": "See on the Appstore",
"playstore": "See on the Playstore",
"changelog": "Changelog",
@ -343,7 +345,8 @@
"networkError": "Unable to contact servers. Make sure you are connected to Internet.",
"goBack": "Go Back",
"goForward": "Go Forward",
"openInBrowser": "Open in Browser"
"openInBrowser": "Open in Browser",
"notAvailable": "Not available"
},
"date": {
"daysOfWeek": {

View file

@ -28,33 +28,33 @@
"feedback": "Votre avis"
},
"intro": {
"slide1": {
"slideMain": {
"title": "Bienvenue sur CAMPUS",
"text": "La nouvelle app à consulter pendant la pause café pour être au courant de la vie du campus !"
"text": "La nouvelle appli à consulter pendant la pause café pour être au courant de la vie du campus !"
},
"slide2": {
"slideEvents": {
"title": "Restez informés",
"text": "CAMPUS vous permet d'être au courant de tous les événements qui ont lieu sur le campus, de la vente de crêpes jusqu'aux concerts enfoiros !"
},
"slide3": {
"slideProxiwash": {
"title": "N'oubliez plus votre linge !",
"text": "CAMPUS vous informe de la disponibilité des machines et vous permet d'être notifié lorsque la vôtre se termine bientôt !"
},
"slide4": {
"title": "Proximo",
"text": "Il vous manque des pâtes ? Ou un petit creux au goûter, regardez les stocks de votre supérette insaienne en temps réel"
},
"slide5": {
"slidePlanex": {
"title": "Planex",
"text": "Consultez votre emploi du temps sur CAMPUS"
"text": "Vérifiez votre prochain cours sur CAMPUS avec un emploi du temps adapté mobile"
},
"slide6": {
"slideRU": {
"title": "Menu du RU",
"text": "Pour ceux qui ont faim, vérifiez le menu du RU de la semaine !"
},
"slide7": {
"title": "Plus à venir...",
"text": "D'autres fonctionnalités arrivent bientôt, n'hésitez pas à nous donner votre avis pour améliorer l'appli"
"slideServices": {
"title": "Encore plus de services !",
"text": "CAMPUS vous permet de faire bien plus, explorez l'appli pour savoir quoi"
},
"slideDone": {
"title": "Fait par un étudiant",
"text": "Cette appli à été réalisée par un seul étudiant (avec un peu d'aide par-ci par-là), donc tous les retours sont les bienvenus !"
},
"updateSlide0": {
"title": "Nouveau dans cette mise à jour !",
@ -91,7 +91,8 @@
"startScreen": "Écran de démarrage",
"startScreenSub": "Choisissez l'écran utilisé au démarrage",
"proxiwashNotifReminder": "Rappel de machine en cours",
"proxiwashNotifReminderSub": "Combien de minutes avant"
"proxiwashNotifReminderSub": "Combien de minutes avant",
"information": "Informations"
},
"homeScreen": {
"listUpdated": "List mise à jour!",
@ -110,6 +111,7 @@
}
},
"aboutScreen": {
"buttonDesc": "Informations sur l'appli et son créateur",
"appstore": "Voir sur l'Appstore",
"playstore": "Voir sur le Playstore",
"changelog": "Historique des modifications",
@ -343,7 +345,8 @@
"networkError": "Impossible de contacter les serveurs. Assurez-vous d'être connecté à internet.",
"goBack": "Suivant",
"goForward": "Précédent",
"openInBrowser": "Ouvrir dans le navigateur"
"openInBrowser": "Ouvrir dans le navigateur",
"notAvailable": "Non disponible"
},
"date": {
"daysOfWeek": {
@ -404,10 +407,10 @@
"bugsSubtitle": "Vous avez trouvé un bug ?",
"bugsDescription": "Rapporter les bugs nous aide à améliorer l'appli. Pour cela, merci d'utiliser un des boutons ci-dessous et de décrire votre problème le plus précisément possible !",
"feedback": "Feedback",
"feedbackSubtitle": "Did nous ce que vous pensez!",
"feedbackDescription": "Vous voulez voir une fonctionnalité ajoutée/modifiée/supprimée ?, vous voulez donner votre opinion sur l'appli ou simplement discuter avec les devs ? Utilisez un des liens ci-dessous !",
"feedbackSubtitle": "Dites nous ce que vous pensez !",
"feedbackDescription": "Vous voulez voir une fonctionnalité ajoutée/modifiée/supprimée ? Vous voulez donner votre opinion sur l'appli ou simplement discuter avec le développeur ? Utilisez un des liens ci-dessous !",
"contactMeans": "L'utilisation de Gitea est recommandée, pour l'utiliser, connectez vous avec vos identifiants INSA.",
"homeButtonTitle": "Feedback/Bugs",
"homeButtonSubtitle": "Contacter les devs"
"homeButtonSubtitle": "Contacter le développeur"
}
}