diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt
index 40339299..cd64a11c 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt
@@ -52,6 +52,7 @@ class AttendanceSummaryPresenter @Inject constructor(
showContent(false)
showProgress(true)
enableSwipe(false)
+ showEmpty(false)
clearView()
}
(subjects.singleOrNull { it.name == name }?.realId ?: -1).let {
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/mobiledevice/MobileDevicePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/mobiledevice/MobileDevicePresenter.kt
index 71359a52..4ff71dc1 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/mobiledevice/MobileDevicePresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/mobiledevice/MobileDevicePresenter.kt
@@ -55,6 +55,7 @@ class MobileDevicePresenter @Inject constructor(
analytics.logEvent("load_devices", "items" to it.size, "force_refresh" to forceRefresh)
}) {
Timber.i("Loading mobile devices result: An exception occurred")
+ view?.run { showEmpty(isViewEmpty) }
errorHandler.dispatch(it)
})
}
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolFragment.kt
index 4e944d38..398a58a6 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolFragment.kt
@@ -52,6 +52,11 @@ class SchoolFragment : BaseFragment(), SchoolView, MainView.TitledView, SchoolAn
schoolPedagogue.text = data.pedagogue
}
+
+ override fun isViewEmpty(): Boolean {
+ return schoolName.text.isBlank()
+ }
+
override fun showEmpty(show: Boolean) {
schoolEmpty.visibility = if (show) View.VISIBLE else View.GONE
}
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolPresenter.kt
index 2b0a37b1..c1ea4fd0 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolPresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolPresenter.kt
@@ -72,12 +72,16 @@ class SchoolPresenter @Inject constructor(
analytics.logEvent("load_school", "force_refresh" to forceRefresh)
}, {
Timber.i("Loading school result: An exception occurred")
+ view?.run {
+ showContent(!isViewEmpty())
+ showEmpty(isViewEmpty())
+ }
errorHandler.dispatch(it)
}, {
Timber.i("Loading school result: No school info found")
view?.run {
- showContent(false)
- showEmpty(true)
+ showContent(!isViewEmpty())
+ showEmpty(isViewEmpty())
}
}))
}
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolView.kt
index 39e7b805..af0c7bd2 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolView.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/school/SchoolView.kt
@@ -10,6 +10,8 @@ interface SchoolView : BaseView, SchoolAndTeachersChildView {
fun updateData(data: School)
+ fun isViewEmpty(): Boolean
+
fun showEmpty(show: Boolean)
fun showProgress(show: Boolean)
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/teacher/TeacherPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/teacher/TeacherPresenter.kt
index aabcff28..a6bdec59 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/teacher/TeacherPresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolandteachers/teacher/TeacherPresenter.kt
@@ -60,6 +60,7 @@ class TeacherPresenter @Inject constructor(
analytics.logEvent("load_teachers", "items" to it.size, "force_refresh" to forceRefresh)
}) {
Timber.i("Loading teachers result: An exception occurred")
+ view?.run { showEmpty(isViewEmpty) }
errorHandler.dispatch(it)
})
}
diff --git a/app/src/main/res/layout/fragment_school.xml b/app/src/main/res/layout/fragment_school.xml
index 2570251b..df2df1bd 100644
--- a/app/src/main/res/layout/fragment_school.xml
+++ b/app/src/main/res/layout/fragment_school.xml
@@ -229,7 +229,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center"
- android:text="@string/teacher_no_items"
+ android:text="@string/school_no_info"
android:textSize="20sp" />
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 2ceff8a0..edbad4ac 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -227,6 +227,7 @@
Szkoła
+ Brak informacji o szkole
Nazwa szkoły
Adres szkoły
Telefon
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d5149a1d..7140cb8f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -213,6 +213,7 @@
School
+ No info about school
School name
School address
Telephone