From 3f6159e976cad3e3224a2a38c7530e8b3fdcb361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Tue, 16 Mar 2021 12:47:51 +0100 Subject: [PATCH] Fix show error details button in additional lessons (#1225) --- app/build.gradle | 2 +- .../modules/timetable/additional/AdditionalLessonsFragment.kt | 1 + .../timetable/additional/AdditionalLessonsPresenter.kt | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index d2f59239..78a31aac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -150,7 +150,7 @@ ext { } dependencies { - implementation "io.github.wulkanowy:sdk:1.1.1" + implementation "com.github.wulkanowy:sdk:340cf4ebd3" coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt index 18551faa..7982387d 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt @@ -57,6 +57,7 @@ class AdditionalLessonsFragment : additionalLessonsSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary)) additionalLessonsSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh)) additionalLessonsErrorRetry.setOnClickListener { presenter.onRetry() } + additionalLessonsErrorDetails.setOnClickListener { presenter.onDetailsClick() } additionalLessonsPreviousButton.setOnClickListener { presenter.onPreviousDay() } additionalLessonsNavDate.setOnClickListener { presenter.onPickDate() } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsPresenter.kt index 623160e7..21997b33 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsPresenter.kt @@ -80,6 +80,10 @@ class AdditionalLessonsPresenter @Inject constructor( loadData(currentDate, true) } + fun onDetailsClick() { + view?.showErrorDetailsDialog(lastError) + } + private fun setBaseDateOnHolidays() { flow { val student = studentRepository.getCurrentStudent()