mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 05:48:19 +01:00
[Dialog/GenerateBlockTimetable] Add option for showing teacher names.
This commit is contained in:
parent
b52e7a3078
commit
760338496c
@ -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 -> {
|
||||
|
@ -34,6 +34,32 @@
|
||||
android:text="@string/timetable_generate_show_profile_name" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/showTeachersNamesItem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/showTeachersNamesCheckbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:checked="true" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/timetable_generate_show_teachers_names" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/noColorsItem"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1173,4 +1173,5 @@
|
||||
<string name="dialog_grades_config_color_by_value">Wg wartości oceny</string>
|
||||
<string name="other">Inne</string>
|
||||
<string name="menu_grades_config">Ustawienia ocen</string>
|
||||
<string name="timetable_generate_show_teachers_names">Pokaż imiona i nazwiska nauczycieli</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user