forked from github/wulkanowy-mirror
Merge branch 'release/0.9.1'
This commit is contained in:
commit
9cd5377438
@ -6,6 +6,7 @@ apply plugin: 'io.fabric'
|
|||||||
apply plugin: 'com.github.triplet.play'
|
apply plugin: 'com.github.triplet.play'
|
||||||
apply from: 'jacoco.gradle'
|
apply from: 'jacoco.gradle'
|
||||||
apply from: 'sonarqube.gradle'
|
apply from: 'sonarqube.gradle'
|
||||||
|
apply from: 'hooks.gradle'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
@ -16,8 +17,8 @@ android {
|
|||||||
testApplicationId "io.github.tests.wulkanowy"
|
testApplicationId "io.github.tests.wulkanowy"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 38
|
versionCode 39
|
||||||
versionName "0.9.0"
|
versionName "0.9.1"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
@ -97,7 +98,7 @@ play {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||||
@ -106,7 +107,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation "androidx.cardview:cardview:1.0.0"
|
implementation "androidx.cardview:cardview:1.0.0"
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
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.wulkanowy:MaterialChipsInput:b72fd0ee6f'
|
||||||
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
||||||
|
|
||||||
|
10
app/hooks.gradle
Normal file
10
app/hooks.gradle
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
apply plugin: "com.star-zero.gradle.githook"
|
||||||
|
|
||||||
|
githook {
|
||||||
|
failOnMissingHooksDir = false
|
||||||
|
hooks {
|
||||||
|
"pre-push" {
|
||||||
|
shell = "./app/play-publish-lint.sh"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
app/play-publish-lint.sh
Executable file
7
app/play-publish-lint.sh
Executable file
@ -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
|
@ -20,6 +20,9 @@ class PreferencesRepository @Inject constructor(
|
|||||||
val gradeAverageMode: String
|
val gradeAverageMode: String
|
||||||
get() = sharedPref.getString(context.getString(R.string.pref_key_grade_average_mode), "only_one_semester") ?: "only_one_semester"
|
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
|
val isGradeExpandable: Boolean
|
||||||
get() = !sharedPref.getBoolean(context.getString(R.string.pref_key_expand_grade), false)
|
get() = !sharedPref.getBoolean(context.getString(R.string.pref_key_expand_grade), false)
|
||||||
|
|
||||||
|
@ -67,6 +67,6 @@ class GradeAverageProvider @Inject constructor(
|
|||||||
if (it.any { summary -> summary.average != .0 }) {
|
if (it.any { summary -> summary.average != .0 }) {
|
||||||
Maybe.just(it.map { summary -> summary.subject to summary.average }.toMap())
|
Maybe.just(it.map { summary -> summary.subject to summary.average }.toMap())
|
||||||
} else Maybe.empty()
|
} else Maybe.empty()
|
||||||
}
|
}.filter { !preferencesRepository.gradeAverageForceCalc }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ Wersja 0.9.0
|
|||||||
|
|
||||||
Dodaliśmy:
|
Dodaliśmy:
|
||||||
- zarządzanie dostępem mobilnym do dziennika
|
- 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
|
- wyświetlanie informacji o wygasłej sesji, gdy zostanie zmienione hasło
|
||||||
|
|
||||||
Naprawiliśmy:
|
Naprawiliśmy:
|
||||||
|
@ -253,6 +253,7 @@
|
|||||||
<string name="pref_view_header">Wygląd</string>
|
<string name="pref_view_header">Wygląd</string>
|
||||||
<string name="pref_view_list">Domyślny widok</string>
|
<string name="pref_view_list">Domyślny widok</string>
|
||||||
<string name="pref_view_grade_average_mode">Obliczanie średniej końcoworocznej</string>
|
<string name="pref_view_grade_average_mode">Obliczanie średniej końcoworocznej</string>
|
||||||
|
<string name="pref_view_grade_average_force_calc">Wymuś obliczanie średniej przez aplikację</string>
|
||||||
<string name="pref_view_present">Pokazuj obecność we frekwencji</string>
|
<string name="pref_view_present">Pokazuj obecność we frekwencji</string>
|
||||||
<string name="pref_view_app_theme">Motyw aplikacji</string>
|
<string name="pref_view_app_theme">Motyw aplikacji</string>
|
||||||
<string name="pref_view_expand_grade">Rozwiń oceny</string>
|
<string name="pref_view_expand_grade">Rozwiń oceny</string>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<string name="pref_key_grade_color_scheme">grade_color_scheme</string>
|
<string name="pref_key_grade_color_scheme">grade_color_scheme</string>
|
||||||
<string name="pref_key_expand_grade">expand_grade</string>
|
<string name="pref_key_expand_grade">expand_grade</string>
|
||||||
<string name="pref_key_grade_average_mode">grade_average_mode</string>
|
<string name="pref_key_grade_average_mode">grade_average_mode</string>
|
||||||
|
<string name="pref_key_grade_average_force_calc">grade_average_always_calc</string>
|
||||||
<string name="pref_key_services_enable">services_enable</string>
|
<string name="pref_key_services_enable">services_enable</string>
|
||||||
<string name="pref_key_services_interval">services_interval</string>
|
<string name="pref_key_services_interval">services_interval</string>
|
||||||
<string name="pref_key_services_wifi_only">services_disable_wifi_only</string>
|
<string name="pref_key_services_wifi_only">services_disable_wifi_only</string>
|
||||||
|
@ -237,6 +237,7 @@
|
|||||||
<string name="pref_view_header">Appearance</string>
|
<string name="pref_view_header">Appearance</string>
|
||||||
<string name="pref_view_list">Default view</string>
|
<string name="pref_view_list">Default view</string>
|
||||||
<string name="pref_view_grade_average_mode">Calculation of the end-of-year average</string>
|
<string name="pref_view_grade_average_mode">Calculation of the end-of-year average</string>
|
||||||
|
<string name="pref_view_grade_average_force_calc">Force average calculation by app</string>
|
||||||
<string name="pref_view_present">Show presence in attendance</string>
|
<string name="pref_view_present">Show presence in attendance</string>
|
||||||
<string name="pref_view_app_theme">Application theme</string>
|
<string name="pref_view_app_theme">Application theme</string>
|
||||||
<string name="pref_view_expand_grade">Expand grades</string>
|
<string name="pref_view_expand_grade">Expand grades</string>
|
||||||
|
@ -105,6 +105,11 @@
|
|||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/pref_view_grade_average_mode"
|
android:title="@string/pref_view_grade_average_mode"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
<SwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="@string/pref_key_grade_average_force_calc"
|
||||||
|
android:title="@string/pref_view_grade_average_force_calc"
|
||||||
|
app:iconSpaceReserved="false" />
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="@string/pref_key_fill_message_content"
|
android:key="@string/pref_key_fill_message_content"
|
||||||
|
@ -59,6 +59,7 @@ class GradeAverageProviderTest {
|
|||||||
|
|
||||||
doReturn(.33).`when`(preferencesRepository).gradeMinusModifier
|
doReturn(.33).`when`(preferencesRepository).gradeMinusModifier
|
||||||
doReturn(.33).`when`(preferencesRepository).gradePlusModifier
|
doReturn(.33).`when`(preferencesRepository).gradePlusModifier
|
||||||
|
doReturn(false).`when`(preferencesRepository).gradeAverageForceCalc
|
||||||
|
|
||||||
doReturn(Single.just(firstGrades)).`when`(gradeRepository).getGrades(student, semesters[1], true)
|
doReturn(Single.just(firstGrades)).`when`(gradeRepository).getGrades(student, semesters[1], true)
|
||||||
doReturn(Single.just(secondGrade)).`when`(gradeRepository).getGrades(student, semesters[2], true)
|
doReturn(Single.just(secondGrade)).`when`(gradeRepository).getGrades(student, semesters[2], true)
|
||||||
@ -128,6 +129,24 @@ class GradeAverageProviderTest {
|
|||||||
assertEquals(3.26, averages["Fizyka"])
|
assertEquals(3.26, averages["Fizyka"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun onlyOneSemester_averageFromSummary_forceCalc() {
|
||||||
|
doReturn(true).`when`(preferencesRepository).gradeAverageForceCalc
|
||||||
|
doReturn("all_year").`when`(preferencesRepository).gradeAverageMode
|
||||||
|
doReturn(Single.just(firstGrades)).`when`(gradeRepository).getGrades(student, semesters[1], false)
|
||||||
|
doReturn(Single.just(listOf(
|
||||||
|
getSummary(22, "Matematyka", 3.1),
|
||||||
|
getSummary(22, "Fizyka", 3.26)
|
||||||
|
))).`when`(gradeSummaryRepository).getGradesSummary(semesters[2], true)
|
||||||
|
|
||||||
|
val averages = gradeAverageProvider.getGradeAverage(student, semesters, semesters[2].semesterId, true)
|
||||||
|
.blockingGet()
|
||||||
|
|
||||||
|
assertEquals(2, averages.size)
|
||||||
|
assertEquals(3.0, averages["Matematyka"])
|
||||||
|
assertEquals(3.25, averages["Fizyka"])
|
||||||
|
}
|
||||||
|
|
||||||
private fun getGrade(semesterId: Int, subject: String, value: Int): Grade {
|
private fun getGrade(semesterId: Int, subject: String, value: Int): Grade {
|
||||||
return Grade(
|
return Grade(
|
||||||
studentId = 101,
|
studentId = 101,
|
||||||
|
@ -14,6 +14,7 @@ buildscript {
|
|||||||
classpath "io.fabric.tools:gradle:1.29.0"
|
classpath "io.fabric.tools:gradle:1.29.0"
|
||||||
classpath "com.github.triplet.gradle:play-publisher:2.2.1"
|
classpath "com.github.triplet.gradle:play-publisher:2.2.1"
|
||||||
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
|
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
|
||||||
|
classpath "gradle.plugin.com.star-zero.gradle:githook:1.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user