<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:id="@+id/cardTimetableTitle"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_marginStart="8dp"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="8dp"
            android:layout_weight="1"
            android:fontFamily="sans-serif-medium"
            android:text="@string/card_timetable_header_title"
            android:textAppearance="@style/TextAppearance.AppCompat"
            android:textSize="18sp"
            android:textStyle="bold" />

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardTimetable"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            app:cardElevation="4dp"
            app:cardCornerRadius="5dp">

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

                <TextView
                    android:id="@+id/cardTimetableNoData"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="8dp"
                    android:gravity="center_horizontal"
                    android:text="@string/card_timetable_no_data"
                    android:textSize="14sp"
                    android:textStyle="italic"
                    android:visibility="gone" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/cardTimetableContent"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="visible">

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/cardTimetableHeader"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:layout_constraintTop_toTopOf="parent">

                        <com.mikepenz.iconics.view.IconicsImageView
                            android:id="@+id/cardTimetableClockIcon"
                            android:layout_width="48dp"
                            android:layout_height="48dp"
                            android:layout_marginStart="8dp"
                            android:layout_marginLeft="8dp"
                            android:layout_marginTop="8dp"
                            android:padding="8dp"
                            app:iiv_color="?android:textColorSecondary"
                            app:iiv_icon="cmd-clock"
                            app:iiv_size="48dp"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent"
                            tools:srcCompat="@tools:sample/avatars[0]" />

                        <LinearLayout
                            android:id="@+id/test"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            app:layout_constraintEnd_toStartOf="@+id/cardTimetableBellSync"
                            app:layout_constraintStart_toEndOf="@+id/cardTimetableClockIcon"
                            app:layout_constraintTop_toTopOf="parent">

                            <TextView
                                android:id="@+id/cardTimetableType"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="8dp"
                                android:layout_marginLeft="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginBottom="8dp"
                                android:layout_weight="2"
                                android:ellipsize="end"
                                android:maxLines="2"
                                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                                tools:text="Czas trwania lekcji:" />

                            <TextView
                                android:id="@+id/cardTimetableSummary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="8dp"
                                android:layout_marginLeft="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginEnd="8dp"
                                android:layout_marginRight="8dp"
                                android:layout_weight="1"
                                android:ellipsize="end"
                                android:fontFamily="sans-serif-medium"
                                android:maxLines="2"

                                android:text="@string/loading"
                                android:textAllCaps="false"
                                android:textSize="16sp"
                                android:textStyle="bold" />
                        </LinearLayout>

                        <com.mikepenz.iconics.view.IconicsImageView
                            android:id="@+id/cardTimetableBellSync"
                            android:layout_width="32dp"
                            android:layout_height="32dp"
                            android:layout_marginTop="16dp"
                            android:layout_marginEnd="8dp"
                            android:layout_marginRight="8dp"
                            android:background="?android:attr/selectableItemBackground"
                            android:padding="4dp"
                            app:iiv_color="?android:textColorSecondary"
                            app:iiv_icon="cmd-alarm-bell"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintTop_toTopOf="parent"
                            tools:srcCompat="@android:drawable/ic_partial_secure" />

                        <TextView
                            android:id="@+id/cardTimetableTimeLeft"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="8dp"
                            android:layout_marginLeft="8dp"
                            android:textAppearance="@style/TextAppearance.AppCompat.Small"
                            app:layout_constraintBottom_toBottomOf="@+id/cardTimetableFullscreenCounter"
                            app:layout_constraintStart_toEndOf="@+id/cardTimetableClockIcon"
                            app:layout_constraintTop_toTopOf="@+id/cardTimetableFullscreenCounter"
                            tools:text="Zostało 25 minut" />

                        <com.mikepenz.iconics.view.IconicsImageView
                            android:id="@+id/cardTimetableFullscreenCounter"
                            android:layout_width="32dp"
                            android:layout_height="32dp"
                            android:layout_marginStart="8dp"
                            android:layout_marginLeft="8dp"
                            android:background="?android:attr/selectableItemBackground"
                            android:padding="8dp"
                            app:iiv_color="?android:textColorSecondary"
                            app:iiv_icon="cmd-fullscreen"
                            app:layout_constraintStart_toEndOf="@+id/cardTimetableTimeLeft"
                            app:layout_constraintTop_toBottomOf="@+id/test"
                            tools:srcCompat="@android:drawable/ic_partial_secure" />
                    </androidx.constraintlayout.widget.ConstraintLayout>

                    <TextView
                        android:id="@+id/cardTimetableLessonOverview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="8dp"
                        android:layout_marginLeft="8dp"
                        android:layout_marginEnd="8dp"
                        android:layout_marginRight="8dp"
                        android:ellipsize="end"
                        android:maxLines="3"
                        android:textAppearance="@style/TextAppearance.AppCompat.Small"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/cardTimetableHeader"
                        tools:text="Następne lekcje:\n11:05 matematyka\n12:00 język polski" />

                    <TextView
                        android:id="@+id/cardTimetableEventOverview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="8dp"
                        android:layout_marginLeft="8dp"
                        android:layout_marginEnd="8dp"
                        android:layout_marginRight="8dp"
                        android:layout_marginBottom="8dp"
                        android:ellipsize="end"
                        android:maxLines="4"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/cardTimetableLessonOverview"
                        tools:text="Wydarzenia:\n10:00 język niemiecki sprawdzianik hehehehe nie wiem co napisać\n12:55 chemia ciekawe czy zrobi te trzy kropki na końcu heh" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="?android:textColorSecondary" />

                <Button
                    android:id="@+id/cardTimetableButton"
                    style="@style/Widget.MaterialComponents.Button.TextButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="?selectableItemBackground"
                    android:gravity="center_vertical|start"
                    android:minHeight="0dp"
                    android:padding="@dimen/card_button_padding"
                    android:text="@string/card_timetable_button" />

            </LinearLayout>
        </com.google.android.material.card.MaterialCardView>

    </LinearLayout>
</layout>