diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2838356..d3080e4 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -3,7 +3,8 @@ + android:icon="@mipmap/ic_launcher" + android:roundIcon="@mipmap/ic_launcher_round"> + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 8403758..cada794 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,11 @@ - + - - + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..13d6fb6 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..7ff32ee Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..504550d 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..aae9ebb Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..eeea478 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..9dc82ce Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..edc3a63 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..5778bf0 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..c26f3bb 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..dcc67fc Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..56a635b --- /dev/null +++ b/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #027CFF + \ No newline at end of file diff --git a/assets/icons/epilyon.svg b/assets/icons/epilyon.svg new file mode 100755 index 0000000..00c20d1 --- /dev/null +++ b/assets/icons/epilyon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/auth.dart b/lib/auth.dart index f3bfb40..e98eb4e 100644 --- a/lib/auth.dart +++ b/lib/auth.dart @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -import 'package:epilyon/firebase.dart'; import 'package:http/http.dart' as http; import 'package:shared_preferences/shared_preferences.dart'; import 'package:epilyon/api_url.dart'; import 'package:epilyon/api.dart'; +import 'package:epilyon/firebase.dart'; String _token = ""; User _user; diff --git a/lib/pages/about.dart b/lib/pages/about.dart index 2a87853..00302f9 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -16,6 +16,7 @@ * along with this program. If not, see . */ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:epilyon/main.dart'; @@ -39,9 +40,10 @@ class _AboutPageState extends State child: Column( children: [ Padding( - padding: const EdgeInsets.only(top: 50.0), - child: Text('Epilyon', style: TextStyle(fontSize: 52, fontWeight: FontWeight.w500),), + padding: const EdgeInsets.only(top: 45.0, bottom: 10.0), + child: SvgPicture.asset('assets/icons/epilyon.svg', width: 50.0,), ), + Text('Epilyon', style: TextStyle(fontSize: 52, fontWeight: FontWeight.w500),), Text(VERSION, style: TextStyle(fontFamily: 'Lato2', fontSize: 22),), Padding( padding: const EdgeInsets.only(top: 10), @@ -67,8 +69,7 @@ class _AboutPageState extends State "Matthieu (utybo)\n" "Yann Michaux\n" "Théo (Thelox), Thomas (Uxon)\n" - "Shika\n" - "Lamia, Marjolaine, et Patricia", + "Shika", style: TextStyle( fontSize: 18, fontStyle: FontStyle.italic, diff --git a/lib/pages/ms_login.dart b/lib/pages/ms_login.dart index 997b02b..76046cc 100644 --- a/lib/pages/ms_login.dart +++ b/lib/pages/ms_login.dart @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -import 'package:epilyon/pages/base.dart'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'package:epilyon/pages/main.dart'; +import 'package:epilyon/pages/base.dart'; import 'package:epilyon/widgets/dialogs.dart'; import 'package:epilyon/data.dart'; import 'package:epilyon/auth.dart'; @@ -27,93 +27,93 @@ import 'package:epilyon/api_url.dart'; class MSLoginPage extends StatefulWidget { - MSLoginPage({ Key key }) : super(key: key); + MSLoginPage({ Key key }) : super(key: key); - @override - _MSLoginPageState createState() => _MSLoginPageState(); + @override + _MSLoginPageState createState() => _MSLoginPageState(); } class _MSLoginPageState extends State { - BuildContext _dialogContext; - - Future _onWebViewCreated(WebViewController controller) async - { - controller.loadUrl(API_URL + "/auth/login", headers: { - "Token": getToken() - }); + BuildContext _dialogContext; + + Future _onWebViewCreated(WebViewController controller) async + { + controller.loadUrl(API_URL + "/auth/login", headers: { + "Token": getToken() + }); + } + + void _onChannelMessage(BuildContext context, JavascriptMessage message) + { + if (message.message != 'Close') { + return; } - void _onChannelMessage(BuildContext context, JavascriptMessage message) - { - if (message.message != 'Close') { - return; - } + showLoadingDialog( + context, + title: 'Chargement', + content: 'Lecture des données...', + onContextUpdate: (ctx) => _dialogContext = ctx + ); + login().then((first) async { + if (first) { + Navigator.pop(_dialogContext); showLoadingDialog( context, - title: 'Chargement', - content: 'Lecture des données...', + title: 'Première connexion', + content: 'Récupération des informations...', onContextUpdate: (ctx) => _dialogContext = ctx ); - login().then((first) async { - if (first) { - Navigator.pop(_dialogContext); - showLoadingDialog( - context, - title: 'Première connexion', - content: 'Récupération des informations...', - onContextUpdate: (ctx) => _dialogContext = ctx - ); - - await forceRefresh(); - } - - await fetchData(); - }).then((_) { - if (_dialogContext == null) { - // TODO: Cancel login or prevent return - return; - } - - Navigator.pop(_dialogContext); - pushMain(context); - }).catchError((e, trace) async { - if (_dialogContext == null) { - return; - } - - await cancelLogin(); - - Navigator.pop(_dialogContext); - Navigator.pop(context); - - print('Error during login/data fetching : ' + e.toString()); - print(trace); - - showErrorDialog( - context, - title: 'Erreur', - content: 'Impossible de se connecter au serveur : ' + e.toString() - ); - }); - } - - @override - Widget build(BuildContext context) - { - return BasePage( - title: 'Connexion', - fixed: true, - child: WebView( - javascriptMode: JavascriptMode.unrestricted, - onWebViewCreated: _onWebViewCreated, - javascriptChannels: Set.from([JavascriptChannel( - name: "Epilyon", - onMessageReceived: (message) => _onChannelMessage(context, message) - )]), - ), - ); - } + await forceRefresh(); + } + + await fetchData(); + }).then((_) { + if (_dialogContext == null) { + // TODO: Cancel login or prevent return + return; + } + + Navigator.pop(_dialogContext); + pushMain(context); + }).catchError((e, trace) async { + if (_dialogContext == null) { + return; + } + + await cancelLogin(); + + Navigator.pop(_dialogContext); + Navigator.pop(context); + + print('Error during login/data fetching : ' + e.toString()); + print(trace); + + showErrorDialog( + context, + title: 'Erreur', + content: 'Impossible de se connecter au serveur : ' + e.toString() + ); + }); + } + + @override + Widget build(BuildContext context) + { + return BasePage( + title: 'Connexion', + fixed: true, + child: WebView( + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: _onWebViewCreated, + javascriptChannels: Set.from([JavascriptChannel( + name: "Epilyon", + onMessageReceived: (message) => _onChannelMessage(context, message) + )]), + ), + ); + } } \ No newline at end of file diff --git a/lib/pages/qcm/qcm_history.dart b/lib/pages/qcm/qcm_history.dart index 9f921a6..8aa0b92 100644 --- a/lib/pages/qcm/qcm_history.dart +++ b/lib/pages/qcm/qcm_history.dart @@ -15,8 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -import 'package:epilyon/pages/base.dart'; -import 'package:epilyon/pages/qcm/qcm_result.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -24,6 +22,8 @@ import 'package:intl/intl.dart'; import 'package:epilyon/widgets/card.dart'; import 'package:epilyon/data.dart'; +import 'package:epilyon/pages/base.dart'; +import 'package:epilyon/pages/qcm/qcm_result.dart'; class QCMHistoryPage extends StatefulWidget { diff --git a/pubspec.yaml b/pubspec.yaml index 9264ebb..132f2c4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,6 +33,7 @@ flutter: - assets/icons/check_box.svg - assets/icons/done_all.svg - assets/icons/edit.svg + - assets/icons/epilyon.svg - assets/icons/event_note.svg - assets/icons/first_page.svg - assets/icons/format_list_bulleted.svg diff --git a/resources/icon_white.svg b/resources/icon_white.svg new file mode 100755 index 0000000..e5d5ff8 --- /dev/null +++ b/resources/icon_white.svg @@ -0,0 +1 @@ +