From 762d4b13931768247bf5b29768dbbaef13c4f7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Thu, 26 Oct 2023 10:06:54 +0200 Subject: [PATCH 1/3] Timetable timers fixes (#2333) --- .../wulkanowy/data/repositories/PreferencesRepository.kt | 6 ------ .../wulkanowy/ui/modules/timetable/TimetableAdapter.kt | 2 +- .../wulkanowy/ui/modules/timetable/TimetablePresenter.kt | 8 ++++++-- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-da-rDK/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es-rES/strings.xml | 1 - app/src/main/res/values-it-rIT/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sk/strings.xml | 1 - app/src/main/res/values-uk/strings.xml | 1 - app/src/main/res/values/preferences_defaults.xml | 1 - app/src/main/res/values/preferences_keys.xml | 1 - app/src/main/res/values/strings.xml | 1 - app/src/main/res/xml/scheme_preferences_appearance.xml | 5 ----- 16 files changed, 7 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt b/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt index 85c74072e..495415f9f 100644 --- a/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt +++ b/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt @@ -194,12 +194,6 @@ class PreferencesRepository @Inject constructor( ) ) - val showTimetableTimers: Boolean - get() = getBoolean( - R.string.pref_key_timetable_show_timers, - R.bool.pref_default_timetable_show_timers - ) - val showTimetableGaps: TimetableGapsMode get() = TimetableGapsMode.getByValue( getString( diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableAdapter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableAdapter.kt index 1201937c0..a957ef798 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableAdapter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableAdapter.kt @@ -325,7 +325,7 @@ class TimetableAdapter @Inject constructor() : override fun getChangePayload(oldItem: TimetableItem, newItem: TimetableItem): Any? { return if (oldItem is TimetableItem.Normal && newItem is TimetableItem.Normal) { - if (oldItem.lesson == newItem.lesson && oldItem.timeLeft != newItem.timeLeft) { + if (oldItem.lesson == newItem.lesson && oldItem.showGroupsInPlan == newItem.showGroupsInPlan && oldItem.timeLeft != newItem.timeLeft) { "time_left" } else super.getChangePayload(oldItem, newItem) } else super.getChangePayload(oldItem, newItem) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt index f99970482..6b442d1c2 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt @@ -1,5 +1,7 @@ package io.github.wulkanowy.ui.modules.timetable +import android.os.Handler +import android.os.Looper import io.github.wulkanowy.data.dataOrNull import io.github.wulkanowy.data.db.entities.Semester import io.github.wulkanowy.data.db.entities.Student @@ -236,11 +238,13 @@ class TimetablePresenter @Inject constructor( private fun updateData(lessons: List) { tickTimer?.cancel() - if (!prefRepository.showTimetableTimers) { + if (currentDate != now()) { view?.updateData(createItems(lessons)) } else { tickTimer = timer(period = 2_000) { - view?.updateData(createItems(lessons)) + Handler(Looper.getMainLooper()).post { + view?.updateData(createItems(lessons)) + } } } } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 1749548e1..3af494fa4 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -713,7 +713,6 @@ Zobrazit přítomnost Motiv Rozvíjení známek - Označit aktuální lekci Zobrazit skupiny vedle předmětů Zobrazit prázdné dlaždice, kde není žádná lekce Zobrazit seznam grafů v známkách třídy diff --git a/app/src/main/res/values-da-rDK/strings.xml b/app/src/main/res/values-da-rDK/strings.xml index 500fba1f3..a89b83769 100644 --- a/app/src/main/res/values-da-rDK/strings.xml +++ b/app/src/main/res/values-da-rDK/strings.xml @@ -623,7 +623,6 @@ Show presence Theme Grades expanding - Mark current lesson Show groups next to subjects Show empty tiles where there\'s no lesson Show chart list in class grades diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d8cc92984..4c9aa2d28 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -623,7 +623,6 @@ Anwesendheit zeigen Thema Steigende Sorten - Aktuelle Lektion markieren Gruppen neben Schulfächen anzeigen Show empty tiles where there\'s no lesson Liste der Diagramme in Klassenbewertungen anzeigen diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 500fba1f3..a89b83769 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -623,7 +623,6 @@ Show presence Theme Grades expanding - Mark current lesson Show groups next to subjects Show empty tiles where there\'s no lesson Show chart list in class grades diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index 500fba1f3..a89b83769 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -623,7 +623,6 @@ Show presence Theme Grades expanding - Mark current lesson Show groups next to subjects Show empty tiles where there\'s no lesson Show chart list in class grades diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 9375aeb39..31b9ce32c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -713,7 +713,6 @@ Pokazuj obecność Motyw Rozwijanie ocen - Oznaczaj bieżącą lekcję Pokazuj grupę obok przedmiotu Pokazuj puste kafelki gdzie nie ma lekcji Pokazuj listę wykresów w ocenach klasy diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index a6e45d445..89a94a59d 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -713,7 +713,6 @@ Показывать присутствия Тема Разворачивание оценок - Отметить текущий урок Показать группы рядом с темами Show empty tiles where there\'s no lesson Показывать диаграммы в оценках класса diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index ed06e023e..3cde8152c 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -713,7 +713,6 @@ Zobraziť prítomnosť Motív Rozvijanie známok - Označiť aktuálne lekciu Zobraziť skupiny vedľa predmetov Zobraziť prázdne dlaždice, kde nie je žiadne lekcie Zobraziť zoznam grafov v známkach triedy diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 6a79263f7..20a917aa4 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -713,7 +713,6 @@ Показувати присутність Тема Розгортання оцінок - Позначити поточний урок Показувати групи поруч з темами Показувати порожні плитки там, де немає уроків Показувати діаграми в оцінках класу diff --git a/app/src/main/res/values/preferences_defaults.xml b/app/src/main/res/values/preferences_defaults.xml index 8d69f25c8..8e6fc7d66 100644 --- a/app/src/main/res/values/preferences_defaults.xml +++ b/app/src/main/res/values/preferences_defaults.xml @@ -22,7 +22,6 @@ false no alphabetic - false between false false diff --git a/app/src/main/res/values/preferences_keys.xml b/app/src/main/res/values/preferences_keys.xml index c48381e8c..5afffb649 100644 --- a/app/src/main/res/values/preferences_keys.xml +++ b/app/src/main/res/values/preferences_keys.xml @@ -27,7 +27,6 @@ grade_sorting_mode show_whole_class_plan show_groups_in_plan - timetable_show_timers timetable_show_gaps subjects_without_grades optional_arithmetic_average diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ba9c9970..5cad09d0b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -701,7 +701,6 @@ Show presence Theme Grades expanding - Mark current lesson Show groups next to subjects Show empty tiles where there\'s no lesson Show chart list in class grades diff --git a/app/src/main/res/xml/scheme_preferences_appearance.xml b/app/src/main/res/xml/scheme_preferences_appearance.xml index 7177d396c..9c02a4910 100644 --- a/app/src/main/res/xml/scheme_preferences_appearance.xml +++ b/app/src/main/res/xml/scheme_preferences_appearance.xml @@ -90,11 +90,6 @@ android:layout_height="wrap_content" app:iconSpaceReserved="false" app:title="@string/pref_timetable_appearance_view"> - Date: Thu, 26 Oct 2023 14:01:45 +0200 Subject: [PATCH 2/3] New Crowdin updates (#2334) From eef3464d0bc79233a996d711903a8159079bc7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Thu, 26 Oct 2023 18:31:51 +0200 Subject: [PATCH 3/3] Version 2.2.3 --- app/build.gradle | 6 +++--- app/src/main/play/release-notes/pl-PL/default.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 42a1f8f74..afa4ac160 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,8 +27,8 @@ android { testApplicationId "io.github.tests.wulkanowy" minSdkVersion 21 targetSdkVersion 34 - versionCode 134 - versionName "2.2.2" + versionCode 135 + versionName "2.2.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resValue "string", "app_name", "Wulkanowy" @@ -192,7 +192,7 @@ ext { } dependencies { - implementation 'io.github.wulkanowy:sdk:2.2.2' + implementation 'io.github.wulkanowy:sdk:2.2.3' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3' 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 2d8d4ce7f..dfc045462 100644 --- a/app/src/main/play/release-notes/pl-PL/default.txt +++ b/app/src/main/play/release-notes/pl-PL/default.txt @@ -1,6 +1,6 @@ -Wersja 2.2.2 +Wersja 2.2.3 -— dodaliśmy możliwość łatwego wejścia w sobotę i niedziele w planie lekcji przy użyciu strzałek +— ułatwiliśmy przełączenie dnia na weekend w planie lekcji przy użyciu strzałek — poprawiliśmy wsparcie dla statystyk ocen z systemem punktowym — poprawiliśmy sortowanie nauczycieli w widoku Szkoła i nauczyciele