From 760338496ca9558d0fd95a3393d1e77f2c19fee4 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sat, 8 Feb 2020 01:33:34 +0100 Subject: [PATCH] [Dialog/GenerateBlockTimetable] Add option for showing teacher names. --- .../timetable/GenerateBlockTimetableDialog.kt | 7 +++++ .../dialog_generate_block_timetable.xml | 26 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 34 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/GenerateBlockTimetableDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/GenerateBlockTimetableDialog.kt index 4a230a18..3f947761 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/GenerateBlockTimetableDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/GenerateBlockTimetableDialog.kt @@ -10,6 +10,7 @@ import android.net.Uri import android.os.Build import android.os.Environment import android.util.Log +import android.view.View import android.view.View.MeasureSpec import android.widget.LinearLayout import android.widget.TextView @@ -60,6 +61,7 @@ class GenerateBlockTimetableDialog( private lateinit var b: DialogGenerateBlockTimetableBinding private var showProfileName: Boolean = false + private var showTeachersNames: Boolean = true private var noColors: Boolean = false init { run { @@ -78,6 +80,9 @@ class GenerateBlockTimetableDialog( b.showProfileNameItem.onClick { b.showProfileNameCheckbox.trigger() } b.showProfileNameCheckbox.setOnCheckedChangeListener { _, isChecked -> showProfileName = isChecked } + b.showTeachersNamesItem.onClick { b.showTeachersNamesCheckbox.trigger() } + b.showTeachersNamesCheckbox.setOnCheckedChangeListener { _, isChecked -> showTeachersNames = isChecked } + b.noColorsItem.onClick { b.noColorsCheckbox.trigger() } b.noColorsCheckbox.setOnCheckedChangeListener { _, isChecked -> noColors = isChecked } @@ -221,6 +226,8 @@ class GenerateBlockTimetableDialog( teacherName.text = lesson.displayTeacherName ?: "" teamName.text = lesson.displayTeamName ?: "" + if (!showTeachersNames) teacherName.visibility = View.GONE + when (lesson.type) { Lesson.TYPE_NORMAL -> {} Lesson.TYPE_CANCELLED, Lesson.TYPE_SHIFTED_SOURCE -> { diff --git a/app/src/main/res/layout/dialog_generate_block_timetable.xml b/app/src/main/res/layout/dialog_generate_block_timetable.xml index 3f97733b..e4f2d01b 100644 --- a/app/src/main/res/layout/dialog_generate_block_timetable.xml +++ b/app/src/main/res/layout/dialog_generate_block_timetable.xml @@ -34,6 +34,32 @@ android:text="@string/timetable_generate_show_profile_name" /> + + + + + + + Wg wartości oceny Inne Ustawienia ocen + Pokaż imiona i nazwiska nauczycieli