Compare commits

...

21 Commits
3.2.0 ... 3.2.3

Author SHA1 Message Date
unknown
bf8ca49f98 fix build script 2022-02-01 18:37:34 +01:00
unknown
0fca636311 compile time version definition 2022-02-01 18:33:13 +01:00
Brúnó Salomon
8673a9e42a chore: version + changelog 2022-01-22 21:55:49 +01:00
Brúnó Salomon
0390d0df39 feat(quick-actions): add localization 2022-01-17 16:50:32 +01:00
Brúnó Salomon
4ec2f74fee chore(quick-actions): add ios icons 2022-01-17 16:45:55 +01:00
ezyyeah
e2078db34b Merge branch 'master' of https://github.com/filc/naplo 2022-01-16 23:08:29 +01:00
ezyyeah
1f39bdc301 quick actions 2022-01-16 23:08:16 +01:00
unknown
029e841d7b version bump 2022-01-16 21:26:55 +01:00
unknown
6a16f93884 version bump 2022-01-16 21:07:08 +01:00
unknown
cfc0229f09 changelog 2022-01-16 21:03:45 +01:00
unknown
a68dd759d8 homework attachments 2022-01-16 18:15:26 +01:00
unknown
e7d0e3805d Merge branch 'master' of ssh://github.com/filc/naplo 2022-01-16 14:08:07 +01:00
unknown
d617d9ef47 changelog 2022-01-16 14:07:05 +01:00
Unknown
2564224a6e Update changelog.md 2022-01-15 01:52:03 +01:00
unknown
5c2b690bc8 mobile 2022-01-15 01:50:42 +01:00
unknown
ff72d146c0 version bump 2022-01-14 23:50:11 +01:00
unknown
088b6e4580 mobile 2022-01-14 23:44:47 +01:00
Unknown
66793607e8 Update README.md 2022-01-14 23:19:04 +01:00
unknown
c91e792c6c changelog 2022-01-14 23:09:50 +01:00
unknown
16d0bd4163 mobile 2022-01-14 23:09:38 +01:00
Unknown
e559338483 Update README.md 2022-01-08 18:28:47 +01:00
31 changed files with 220 additions and 48 deletions

4
.vscode/launch.json vendored
View File

@@ -7,8 +7,8 @@
{
"name": "filcnaplo",
"cwd": "filcnaplo",
"request": "launch",
"type": "dart"
"request": "attach",
"type": "dart",
}
]
}

View File

@@ -7,12 +7,6 @@
[![Downloads](https://img.shields.io/github/downloads-pre/filc/naplo/latest/total?color=%23&label=Downloads&logo=github&sort=semver)](https://github.com/filc/naplo/releases)   [![discord](https://img.shields.io/discord/712698455193157643?label=Discord)](http://filcnaplo.hu/discord)   [![Codemagic build status](https://api.codemagic.io/apps/612cc79b35b443d1b2c638ec/612cc79b35b443d1b2c638eb/status_badge.svg)](https://codemagic.io/apps/612cc79b35b443d1b2c638ec/612cc79b35b443d1b2c638eb/latest_build)
## Versions
- [Latest Stable](https://github.com/filc/naplo/releases/latest): `3.1.1`
- [Experiment 1]() (Tabs): `3.2.0-pre.1`
- [Experiment 2]() (Widgets): `3.2.0-pre.2`
## Setup
### Clone the project

View File

@@ -1,9 +1,6 @@
- Mai nap jelzése az órarendben (kis pont alul)
- Jobb frissítés kezelés
- Frissítések megjelenítése a főoldalon
- Jobb link kezelés
- Hosszú szövegek mostmár kiférnek faliújságnál
- Könnyebben látható frissítések
- Grafikon design változások
- Tantárgy icon javítások
- Hibajavítások
- Órarendben dolgozatok javítása
- Kilógó félév jelző javítása a grafikonon
- Dicséretes jegyek jelzése
- Üzenet & Szellem jegy animációk
- Design javítások
- Kisebb hibajavítások

View File

@@ -8,7 +8,6 @@
.buildlog/
.history
.svn/
build.sh
# IntelliJ related
*.iml

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

19
filcnaplo/build.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/fish
# With build number
function get_version_bn
cat pubspec.yaml | grep version: | cut -d' ' -f2
end
function get_version
cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1
end
if test -e /mnt/enc/keys/filc3.properties
set -x ANDROID_SIGNING /mnt/enc/keys/filc3.properties
end
flutter build apk --release --dart-define=APPVER=(get_version)
cp -v "build/app/outputs/flutter-apk/app-release.apk" ~/"Desktop/hu.filc.naplo_"(get_version_bn).apk
notify-send "Flutter" "Apk build done."

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

View File

@@ -1,6 +1,7 @@
// ignore_for_file: avoid_print
import 'dart:convert';
import 'dart:developer';
import 'package:filcnaplo/models/config.dart';
import 'package:filcnaplo/models/news.dart';
@@ -45,14 +46,20 @@ class FilcAPI {
} catch (error) {
print("ERROR: FilcAPI.getSchools: $error");
}
return null;
}
static Future<Config?> getConfig(SettingsProvider settings) async {
final userAgent = SettingsProvider.defaultSettings().config.userAgent;
Map<String, String> headers = {
"x-filc-id": settings.xFilcId,
"user-agent": SettingsProvider.defaultSettings().config.userAgent,
"user-agent": userAgent,
};
log("[CONFIG] x-filc-id: \"${settings.xFilcId}\"");
log("[CONFIG] user-agent: \"$userAgent\"");
try {
http.Response res = await http.get(Uri.parse(config), headers: headers);
@@ -66,6 +73,7 @@ class FilcAPI {
} catch (error) {
print("ERROR: FilcAPI.getConfig: $error");
}
return null;
}
static Future<List<News>?> getNews() async {
@@ -80,6 +88,7 @@ class FilcAPI {
} catch (error) {
print("ERROR: FilcAPI.getNews: $error");
}
return null;
}
static Future<Supporters?> getSupporters() async {
@@ -94,6 +103,7 @@ class FilcAPI {
} catch (error) {
print("ERROR: FilcAPI.getSupporters: $error");
}
return null;
}
static Future<List<Release>?> getReleases() async {
@@ -108,6 +118,7 @@ class FilcAPI {
} catch (error) {
print("ERROR: FilcAPI.getReleases: $error");
}
return null;
}
static Future<http.StreamedResponse?> downloadRelease(Release release) {

View File

@@ -3,14 +3,12 @@ import 'dart:io';
import 'package:filcnaplo/api/client.dart';
import 'package:filcnaplo/models/release.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
class UpdateProvider extends ChangeNotifier {
// Private
late List<Release> _releases;
bool _available = false;
bool get available => _available && _releases.isNotEmpty;
PackageInfo? _packageInfo;
// Public
List<Release> get releases => _releases;
@@ -20,10 +18,9 @@ class UpdateProvider extends ChangeNotifier {
required BuildContext context,
}) {
_releases = List.castFrom(initialReleases);
PackageInfo.fromPlatform().then((value) => _packageInfo = value);
}
String get currentVersion => _packageInfo?.version ?? "";
static const currentVersion = String.fromEnvironment("APPVER", defaultValue: "1.0");
Future<void> fetch() async {
if (!Platform.isAndroid) return;
@@ -33,7 +30,7 @@ class UpdateProvider extends ChangeNotifier {
// Check for new releases
if (_releases.isNotEmpty) {
_available = _packageInfo != null && _releases.first.version.compareTo(Version.fromString(currentVersion)) == 1;
_available = _releases.first.version.compareTo(Version.fromString(currentVersion)) == 1;
// ignore: avoid_print
if (_available) print("INFO: New update: ${releases.first.version}");
notifyListeners();

View File

@@ -1,3 +1,4 @@
import 'dart:io';
import 'dart:math';
import 'package:filcnaplo/api/client.dart';
@@ -32,7 +33,7 @@ import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
import 'package:filcnaplo/api/providers/user_provider.dart';
import 'package:filcnaplo/api/providers/update_provider.dart';
import 'package:filcnaplo_mobile_ui/pages/grades/calculator/grade_calculator_provider.dart';
// import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
class App extends StatelessWidget {
final SettingsProvider settings;
@@ -48,7 +49,7 @@ class App extends StatelessWidget {
setSystemChrome(context);
// Set high refresh mode #28
// if (Platform.isAndroid) FlutterDisplayMode.setHighRefreshRate();
if (Platform.isAndroid) FlutterDisplayMode.setHighRefreshRate();
WidgetsBinding.instance?.addPostFrameCallback((_) {
FilcAPI.getConfig(settings).then((Config? config) {
@@ -142,6 +143,7 @@ class App extends StatelessWidget {
case "settings":
return settingsRoute(const SettingsScreen());
}
return null;
// else if platform == windows || ...
}

View File

@@ -1,9 +1,11 @@
import 'dart:io';
import 'dart:typed_data';
import 'package:filcnaplo/api/providers/user_provider.dart';
import 'package:filcnaplo/helpers/storage_helper.dart';
import 'package:filcnaplo_kreta_api/client/client.dart';
import 'package:filcnaplo_kreta_api/models/attachment.dart';
import 'package:filcnaplo_kreta_api/models/homework.dart';
import 'package:flutter/widgets.dart';
import 'package:open_file/open_file.dart';
import 'package:provider/provider.dart';
@@ -22,7 +24,29 @@ extension AttachmentHelper on Attachment {
Future<bool> open(BuildContext context) async {
String downloads = await StorageHelper.downloadsPath();
if (!await File("$downloads/$name").exists()) await download(context);
var result = await OpenFile.open("$downloads/$name");
return result.type == ResultType.done;
}
}
extension HomeworkAttachmentHelper on HomeworkAttachment {
Future<String> download(BuildContext context, {bool overwrite = false}) async {
String downloads = await StorageHelper.downloadsPath();
if (!overwrite && await File("$downloads/$name").exists()) return "$downloads/$name";
String url = downloadUrl(Provider.of<UserProvider>(context, listen: false).instituteCode ?? "");
Uint8List data = await Provider.of<KretaClient>(context, listen: false).getAPI(url, rawResponse: true);
if (!await StorageHelper.write("$downloads/$name", data)) return "";
return "$downloads/$name";
}
Future<bool> open(BuildContext context) async {
String downloads = await StorageHelper.downloadsPath();
if (!await File("$downloads/$name").exists()) await download(context);
var result = await OpenFile.open("$downloads/$name");
return result.type == ResultType.done;

View File

@@ -0,0 +1,36 @@
import 'package:flutter/cupertino.dart';
import 'package:quick_actions/quick_actions.dart';
import 'package:filcnaplo_mobile_ui/common/screens.i18n.dart';
const QuickActions quickActions = QuickActions();
void setupQuickActions() {
quickActions.setShortcutItems(<ShortcutItem>[
ShortcutItem(type: 'action_grades', localizedTitle: 'grades'.i18n, icon: 'ic_grades'),
ShortcutItem(type: 'action_timetable', localizedTitle: 'timetable'.i18n, icon: 'ic_timetable'),
ShortcutItem(type: 'action_messages', localizedTitle: 'messages'.i18n, icon: 'ic_messages'),
ShortcutItem(type: 'action_absences', localizedTitle: 'absences'.i18n, icon: 'ic_absences')
]);
}
void handleQuickActions(BuildContext context, void Function(String) callback) {
quickActions.initialize((shortcutType) {
switch (shortcutType) {
case 'action_home':
callback("home");
break;
case 'action_grades':
callback("grades");
break;
case 'action_timetable':
callback("timetable");
break;
case 'action_messages':
callback("messages");
break;
case 'action_absences':
callback("absences");
break;
}
});
}

View File

@@ -1,15 +1,11 @@
import 'dart:io';
import 'package:package_info_plus/package_info_plus.dart';
class Config {
String _userAgent;
String? _version;
Map? json;
static const String _version = String.fromEnvironment("APPVER", defaultValue: "2.2.0");
Config({required String userAgent, this.json}) : _userAgent = userAgent {
PackageInfo.fromPlatform().then((value) => _version = value.version);
}
Config({required String userAgent, this.json}) : _userAgent = userAgent;
factory Config.fromJson(Map json) {
return Config(
@@ -18,7 +14,7 @@ class Config {
);
}
String get userAgent => _userAgent.replaceAll("\$0", _version ?? "0").replaceAll("\$1", platform).replaceAll("\$2", "0");
String get userAgent => _userAgent.replaceAll("\$0", _version).replaceAll("\$1", platform).replaceAll("\$2", "0");
static String get platform {
if (Platform.isAndroid) {

View File

@@ -4,7 +4,6 @@ import 'package:filcnaplo/api/providers/database_provider.dart';
import 'package:filcnaplo/models/config.dart';
import 'package:filcnaplo/theme.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:uuid/uuid.dart';
@@ -13,8 +12,6 @@ enum UpdateChannel { stable, beta, dev }
enum VibrationStrength { off, light, medium, strong }
class SettingsProvider extends ChangeNotifier {
PackageInfo? _packageInfo;
// en_en, hu_hu, de_de
String _language;
Pages _startPage;
@@ -86,11 +83,7 @@ class SettingsProvider extends ChangeNotifier {
_swapABweeks = swapABweeks,
_updateChannel = updateChannel,
_config = config,
_xFilcId = xFilcId {
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
_packageInfo = packageInfo;
});
}
_xFilcId = xFilcId;
factory SettingsProvider.fromMap(Map map) {
return SettingsProvider(
@@ -194,7 +187,6 @@ class SettingsProvider extends ChangeNotifier {
bool get abWeeks => _abWeeks;
bool get swapABweeks => _swapABweeks;
UpdateChannel get updateChannel => _updateChannel;
PackageInfo? get packageInfo => _packageInfo;
Config get config => _config;
String get xFilcId => _xFilcId;

View File

@@ -20,6 +20,7 @@ class JwtUtils {
// ignore: avoid_print
print("ERROR: JwtUtils.decodeJwt: $error");
}
return null;
}
static String? getNameFromJWT(String jwt) {
@@ -36,5 +37,6 @@ class JwtUtils {
case "Gondviselo":
return Role.parent;
}
return null;
}
}

View File

@@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
homepage: https://filcnaplo.hu
publish_to: "none"
version: 3.2.0+142
version: 3.2.3+148
environment:
sdk: ">=2.16.0-80.1.beta <3.0.0"
@@ -34,9 +34,10 @@ dependencies:
path_provider: ^2.0.2
permission_handler: ^8.3.0
share_plus: ^3.0.4
package_info_plus: ^1.0.6
connectivity_plus: ^2.0.2
# flutter_displaymode: ^0.3.2
flutter_displaymode: ^0.3.2
quick_actions: ^0.6.0
implicitly_animated_reorderable_list: ^0.4.2
dev_dependencies:
flutter_test:

12
filcnaplo/run.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/fish
function get_version
cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1
end
if test -e /mnt/enc/keys/filc3.properties
set -x ANDROID_SIGNING /mnt/enc/keys/filc3.properties
end
flutter run --debug --dart-define=APPVER=(get_version)