diff --git a/app/build.gradle b/app/build.gradle
index e88f74c6..586e988c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,6 +6,7 @@ apply plugin: 'io.fabric'
apply plugin: 'com.github.triplet.play'
apply from: 'jacoco.gradle'
apply from: 'sonarqube.gradle'
+apply from: 'hooks.gradle'
android {
compileSdkVersion 28
@@ -16,8 +17,8 @@ android {
testApplicationId "io.github.tests.wulkanowy"
minSdkVersion 15
targetSdkVersion 28
- versionCode 38
- versionName "0.9.0"
+ versionCode 39
+ versionName "0.9.1"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@@ -97,7 +98,7 @@ play {
}
dependencies {
- implementation 'io.github.wulkanowy:api:0.9.0'
+ implementation 'io.github.wulkanowy:api:0.9.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
@@ -106,7 +107,7 @@ dependencies {
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
- implementation "com.google.android.material:material:1.1.0-alpha07"
+ implementation "com.google.android.material:material:1.1.0-alpha05"
implementation 'com.github.wulkanowy:MaterialChipsInput:b72fd0ee6f'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
diff --git a/app/hooks.gradle b/app/hooks.gradle
new file mode 100644
index 00000000..038fa9fb
--- /dev/null
+++ b/app/hooks.gradle
@@ -0,0 +1,10 @@
+apply plugin: "com.star-zero.gradle.githook"
+
+githook {
+ failOnMissingHooksDir = false
+ hooks {
+ "pre-push" {
+ shell = "./app/play-publish-lint.sh"
+ }
+ }
+}
diff --git a/app/play-publish-lint.sh b/app/play-publish-lint.sh
new file mode 100755
index 00000000..d3354b1a
--- /dev/null
+++ b/app/play-publish-lint.sh
@@ -0,0 +1,7 @@
+#!/bin/bash -
+
+content=$(cat < "app/src/main/play/release-notes/pl-PL/default.txt") || exit
+if [[ "${#content}" -gt 500 ]]; then
+ echo >&2 "Release notes content has reached the limit of 500 characters"
+ exit 1
+fi
diff --git a/app/src/main/java/io/github/wulkanowy/data/repositories/preferences/PreferencesRepository.kt b/app/src/main/java/io/github/wulkanowy/data/repositories/preferences/PreferencesRepository.kt
index bde84162..bb9a39b1 100644
--- a/app/src/main/java/io/github/wulkanowy/data/repositories/preferences/PreferencesRepository.kt
+++ b/app/src/main/java/io/github/wulkanowy/data/repositories/preferences/PreferencesRepository.kt
@@ -20,6 +20,9 @@ class PreferencesRepository @Inject constructor(
val gradeAverageMode: String
get() = sharedPref.getString(context.getString(R.string.pref_key_grade_average_mode), "only_one_semester") ?: "only_one_semester"
+ val gradeAverageForceCalc: Boolean
+ get() = sharedPref.getBoolean(context.getString(R.string.pref_key_grade_average_force_calc), false)
+
val isGradeExpandable: Boolean
get() = !sharedPref.getBoolean(context.getString(R.string.pref_key_expand_grade), false)
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt
index cff60268..3f794ff1 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt
@@ -67,6 +67,6 @@ class GradeAverageProvider @Inject constructor(
if (it.any { summary -> summary.average != .0 }) {
Maybe.just(it.map { summary -> summary.subject to summary.average }.toMap())
} else Maybe.empty()
- }
+ }.filter { !preferencesRepository.gradeAverageForceCalc }
}
}
diff --git a/app/src/main/play/release-notes/pl-PL/default.txt b/app/src/main/play/release-notes/pl-PL/default.txt
index 7fe143d8..e2048e1f 100644
--- a/app/src/main/play/release-notes/pl-PL/default.txt
+++ b/app/src/main/play/release-notes/pl-PL/default.txt
@@ -2,7 +2,7 @@ Wersja 0.9.0
Dodaliśmy:
- zarządzanie dostępem mobilnym do dziennika
-- wyświetlanie sumy punktów (jeśli dziennik obsługuje)
+- wyświetlanie sumy punktów
- wyświetlanie informacji o wygasłej sesji, gdy zostanie zmienione hasło
Naprawiliśmy:
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 128d8636..91d980a6 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -253,6 +253,7 @@
Wygląd
Domyślny widok
Obliczanie średniej końcoworocznej
+ Wymuś obliczanie średniej przez aplikację
Pokazuj obecność we frekwencji
Motyw aplikacji
Rozwiń oceny
diff --git a/app/src/main/res/values/preferences_keys.xml b/app/src/main/res/values/preferences_keys.xml
index b09ee51b..730fea59 100644
--- a/app/src/main/res/values/preferences_keys.xml
+++ b/app/src/main/res/values/preferences_keys.xml
@@ -6,6 +6,7 @@
grade_color_scheme
expand_grade
grade_average_mode
+ grade_average_always_calc
services_enable
services_interval
services_disable_wifi_only
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b6424876..fd94e5b6 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -237,6 +237,7 @@
Appearance
Default view
Calculation of the end-of-year average
+ Force average calculation by app
Show presence in attendance
Application theme
Expand grades
diff --git a/app/src/main/res/xml/scheme_preferences.xml b/app/src/main/res/xml/scheme_preferences.xml
index 149024c0..ccacfe9d 100644
--- a/app/src/main/res/xml/scheme_preferences.xml
+++ b/app/src/main/res/xml/scheme_preferences.xml
@@ -105,6 +105,11 @@
android:summary="%s"
android:title="@string/pref_view_grade_average_mode"
app:iconSpaceReserved="false" />
+