forked from github/wulkanowy-mirror
Fix blank description in exam details (#1778)
This commit is contained in:
parent
6290663f02
commit
84d0ba525f
@ -5,6 +5,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.data.db.entities.Exam
|
||||
import io.github.wulkanowy.databinding.DialogExamBinding
|
||||
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
||||
@ -47,7 +48,9 @@ class ExamDialog : DialogFragment() {
|
||||
examDialogTypeValue.text = exam.type
|
||||
examDialogTeacherValue.text = exam.teacher
|
||||
examDialogDateValue.text = exam.entryDate.toFormattedString()
|
||||
examDialogDescriptionValue.text = exam.description
|
||||
examDialogDescriptionValue.text = exam.description.ifBlank {
|
||||
getString(R.string.all_no_data)
|
||||
}
|
||||
|
||||
examDialogClose.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
@ -10,11 +10,7 @@ import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.data.db.entities.Grade
|
||||
import io.github.wulkanowy.data.enums.GradeColorTheme
|
||||
import io.github.wulkanowy.databinding.DialogGradeBinding
|
||||
import io.github.wulkanowy.utils.colorStringId
|
||||
import io.github.wulkanowy.utils.getBackgroundColor
|
||||
import io.github.wulkanowy.utils.getGradeColor
|
||||
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
||||
import io.github.wulkanowy.utils.toFormattedString
|
||||
import io.github.wulkanowy.utils.*
|
||||
|
||||
class GradeDetailsDialog : DialogFragment() {
|
||||
|
||||
@ -80,9 +76,7 @@ class GradeDetailsDialog : DialogFragment() {
|
||||
setBackgroundResource(grade.getBackgroundColor(gradeColorTheme))
|
||||
}
|
||||
|
||||
gradeDialogTeacherValue.text = if (grade.teacher.isBlank()) {
|
||||
getString(R.string.all_no_data)
|
||||
} else grade.teacher
|
||||
gradeDialogTeacherValue.text = grade.teacher.ifBlank { getString(R.string.all_no_data) }
|
||||
|
||||
gradeDialogDescriptionValue.text = grade.run {
|
||||
when {
|
||||
|
Loading…
x
Reference in New Issue
Block a user