forked from github/wulkanowy-mirror
Fix showing empty view in grade details when there is no grades (#1963)
This commit is contained in:
parent
6153c7b97d
commit
e05abb3539
@ -3,7 +3,6 @@ package io.github.wulkanowy.ui.modules.grade.details
|
|||||||
import io.github.wulkanowy.data.*
|
import io.github.wulkanowy.data.*
|
||||||
import io.github.wulkanowy.data.db.entities.Grade
|
import io.github.wulkanowy.data.db.entities.Grade
|
||||||
import io.github.wulkanowy.data.enums.GradeExpandMode
|
import io.github.wulkanowy.data.enums.GradeExpandMode
|
||||||
import io.github.wulkanowy.data.enums.GradeSortingMode
|
|
||||||
import io.github.wulkanowy.data.enums.GradeSortingMode.*
|
import io.github.wulkanowy.data.enums.GradeSortingMode.*
|
||||||
import io.github.wulkanowy.data.repositories.GradeRepository
|
import io.github.wulkanowy.data.repositories.GradeRepository
|
||||||
import io.github.wulkanowy.data.repositories.PreferencesRepository
|
import io.github.wulkanowy.data.repositories.PreferencesRepository
|
||||||
@ -132,16 +131,17 @@ class GradeDetailsPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
.logResourceStatus("load grade details")
|
.logResourceStatus("load grade details")
|
||||||
.onResourceData {
|
.onResourceData {
|
||||||
|
val gradeItems = createGradeItems(it)
|
||||||
view?.run {
|
view?.run {
|
||||||
enableSwipe(true)
|
enableSwipe(true)
|
||||||
showProgress(false)
|
showProgress(false)
|
||||||
showErrorView(false)
|
showErrorView(false)
|
||||||
showContent(it.isNotEmpty())
|
showContent(gradeItems.isNotEmpty())
|
||||||
showEmpty(it.isEmpty())
|
showEmpty(gradeItems.isEmpty())
|
||||||
updateNewGradesAmount(it)
|
updateNewGradesAmount(it)
|
||||||
updateMarkAsDoneButton()
|
updateMarkAsDoneButton()
|
||||||
updateData(
|
updateData(
|
||||||
data = createGradeItems(it),
|
data = gradeItems,
|
||||||
expandMode = preferencesRepository.gradeExpandMode,
|
expandMode = preferencesRepository.gradeExpandMode,
|
||||||
preferencesRepository.gradeColorTheme
|
preferencesRepository.gradeColorTheme
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user