<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) Kuba Szczodrzyński 2021-4-10.
  -->

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <import type="android.view.View" />

        <variable
            name="config"
            type="pl.szczodrzynski.edziennik.config.ProfileConfig" />

        <variable
            name="isAgendaMode"
            type="boolean" />
    </data>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="24dp">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/config_appearance"
                android:textAppearance="@style/NavView.TextView.Subtitle" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:checked="@={config.ui.agendaLessonChanges}"
                android:minHeight="32dp"
                android:text="@string/agenda_config_lesson_changes" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:checked="@={config.ui.agendaTeacherAbsence}"
                android:minHeight="32dp"
                android:text="@string/agenda_config_teacher_absence" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:checked="@={config.ui.agendaCompactMode}"
                android:enabled="@{isAgendaMode}"
                android:minHeight="32dp"
                android:text="@string/agenda_config_compact_mode"
                tools:enabled="false" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="16dp"
                android:enabled="@{isAgendaMode}"
                android:text="@string/agenda_config_compact_mode_hint"
                android:textAppearance="@style/NavView.TextView.Helper"
                tools:enabled="false" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:checked="@={config.ui.agendaGroupByType}"
                android:enabled="@{isAgendaMode}"
                android:minHeight="32dp"
                android:text="@string/agenda_config_group_by_type"
                tools:enabled="false" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/agenda_config_mode_unavailable"
                android:textStyle="italic"
                android:visibility="@{isAgendaMode ? View.GONE : View.VISIBLE}" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/agenda_config_event_sharing"
                android:textAppearance="@style/NavView.TextView.Subtitle" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/eventSharingEnabled"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:minHeight="32dp"
                android:text="@string/agenda_config_event_sharing_enabled" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/shareByDefault"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:minHeight="32dp"
                android:checked="@={config.shareByDefault}"
                android:text="@string/settings_register_share_by_default_text" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/agenda_config_elearning"
                android:textAppearance="@style/NavView.TextView.Subtitle" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/agenda_config_not_available_yet"
                android:textAppearance="@style/NavView.TextView.Small"
                android:textStyle="italic" />

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/elearningEnabled"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:checked="@={config.ui.agendaElearningMark}"
                android:enabled="false"
                android:minHeight="32dp"
                android:text="@string/agenda_config_elearning_mark" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/elearningType"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:enabled="@{elearningEnabled.checked}"
                android:hint="@string/agenda_config_elearning_type">

                <pl.szczodrzynski.edziennik.utils.TextInputDropDown
                    android:id="@+id/elearningTypeDropdown"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:enabled="false"
                    android:focusable="true"
                    android:focusableInTouchMode="true" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.checkbox.MaterialCheckBox
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:checked="@={config.ui.agendaElearningGroup}"
                android:enabled="false"
                android:minHeight="32dp"
                android:text="@string/agenda_config_elearning_group" />
        </LinearLayout>
    </ScrollView>
</layout>
