Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixing #99

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions android/app/build.gradle
Expand Up @@ -36,6 +36,9 @@ android {
compileSdk 33

compileOptions {
// for flutter_local_notification: Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// set Java compatibility to Java 17
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
Expand All @@ -54,6 +57,7 @@ android {
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true // for flutter_local_notification plugin
}

signingConfigs {
Expand Down Expand Up @@ -94,5 +98,18 @@ flutter {
}

dependencies {
// for flutter_local_notification: to prevent the app from crashing on Android 12L and higher
implementation "androidx.window:window:1.0.0"
// For Java-friendly APIs to register and unregister callbacks
implementation "androidx.window:window-java:1.0.0"
// For RxJava2 integration
implementation "androidx.window:window-rxjava2:1.0.0"
// For RxJava3 integration
implementation "androidx.window:window-rxjava3:1.0.0"
// For testing
implementation "androidx.window:window-testing:1.0.0"
MatsG23 marked this conversation as resolved.
Show resolved Hide resolved
// for flutter_local_notification plugin
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
19 changes: 18 additions & 1 deletion android/app/proguard-rules.pro
Expand Up @@ -26,4 +26,21 @@
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
##---------------End: proguard configuration for Gson ----------
##---------------End: proguard configuration for Gson ----------


## ---------- rules for androidx.window:window ------------ ##
# This is generated automatically by the Android Gradle plugin.
-dontwarn androidx.window.extensions.WindowExtensions
-dontwarn androidx.window.extensions.WindowExtensionsProvider
-dontwarn androidx.window.extensions.layout.DisplayFeature
-dontwarn androidx.window.extensions.layout.FoldingFeature
-dontwarn androidx.window.extensions.layout.WindowLayoutComponent
-dontwarn androidx.window.extensions.layout.WindowLayoutInfo
-dontwarn androidx.window.sidecar.SidecarDeviceState
-dontwarn androidx.window.sidecar.SidecarDisplayFeature
-dontwarn androidx.window.sidecar.SidecarInterface$SidecarCallback
-dontwarn androidx.window.sidecar.SidecarInterface
-dontwarn androidx.window.sidecar.SidecarProvider
-dontwarn androidx.window.sidecar.SidecarWindowLayoutInfo
## --------- End: rules for androidx.window:window ------- ##
17 changes: 13 additions & 4 deletions android/app/src/main/AndroidManifest.xml
Expand Up @@ -63,14 +63,23 @@
</intent-filter>
</receiver>

<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>

</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> -->
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<!-- For apps with targetSDK >= 31 (Android 12+) -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<queries>
Expand Down
1 change: 1 addition & 0 deletions lib/class/abstract_Place.dart
Expand Up @@ -89,6 +89,7 @@ abstract class Place {
}
final updater = Provider.of<Update>(context, listen: false);
updater.updateReadStatusInList();
saveMyPlacesList();
}

/// set the read and notified status from all warnings to false
Expand Down
2 changes: 1 addition & 1 deletion lib/class/class_userPreferences.dart
Expand Up @@ -26,7 +26,7 @@ class UserPreferences {
bool showAllWarnings = false;
bool areWarningsFromCache = false;

String versionNumber = "0.6.0"; // shown in the about view
String versionNumber = "0.6.1"; // shown in the about view

bool activateAlertSwiss = false;
bool isFirstStart = true;
Expand Down
3 changes: 2 additions & 1 deletion lib/views/WarningDetailView.dart
Expand Up @@ -210,7 +210,8 @@ class _DetailScreenState extends State<DetailScreen> {
setState(() {
widget._warnMessage.read = true;
});
saveMyPlacesList(); //@todo nötig?
// save places List to store new read state
saveMyPlacesList();

List<String> generateAreaDescList(int length) {
List<String> tempList = [];
Expand Down
5 changes: 5 additions & 0 deletions lib/widgets/WarningWidget.dart
Expand Up @@ -5,6 +5,7 @@ import 'package:provider/provider.dart';
import '../class/class_WarnMessage.dart';
import '../class/class_Area.dart';
import '../class/class_Geocode.dart';
import '../services/saveAndLoadSharedPreferences.dart';
import '../views/WarningDetailView.dart';
import '../services/updateProvider.dart';
import '../services/translateAndColorizeWarning.dart';
Expand Down Expand Up @@ -56,6 +57,8 @@ class WarningWidget extends StatelessWidget {
_warnMessage.read = false;
final updater = Provider.of<Update>(context, listen: false);
updater.updateReadStatusInList();
// save places list to store new read state
saveMyPlacesList();
},
icon: Icon(
Icons.mark_chat_read,
Expand All @@ -66,6 +69,8 @@ class WarningWidget extends StatelessWidget {
_warnMessage.read = true;
final updater = Provider.of<Update>(context, listen: false);
updater.updateReadStatusInList();
// save places list to store new read state
saveMyPlacesList();
},
icon: Icon(
Icons.warning_amber_outlined,
Expand Down
5 changes: 5 additions & 0 deletions lib/widgets/dialogs/ChangeLogDialog.dart
Expand Up @@ -13,6 +13,11 @@ class ChangeLogDialog extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
"0.6.1 (beta)",
style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
),
Text("* Fehlerbehebungen \n"),
Text(
"0.6.0 (beta)",
style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,7 +1,7 @@
name: foss_warn
description: Eine FOSS Umsetzung von NINA
publish_to: 'none'
version: 0.6.0+28
version: 0.6.1+29

environment:
sdk: ">=2.17.0 <3.13.3"
Expand Down