<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical"
    android:id="@+id/panel"
    tools:context=".ui.home.HomeFragment">

    <androidx.core.widget.NestedScrollView
        android:id="@+id/nested_scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none"
        android:scrollingCache="true"
        android:background="#14532D">

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

            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/spacing_small" />



        <!-- Druhy radek, OBRAZEK LIZATKA, TEPLOTY, PAMET/BATERKA,REZIM -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:descendantFocusability="blocksDescendants"
            android:orientation="vertical">

            <!-- mezera -->
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/spacing_small" />

            <!---slozeny obrazek -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingLeft="10dp"
                android:paddingRight="@dimen/spacing_middle"
                android:layout_marginTop="0dp"
                android:layout_marginBottom="20dp">

                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_marginBottom="@dimen/spacing_xsmall"
                    android:layout_marginLeft="@dimen/spacing_xsmall"
                    android:layout_marginRight="@dimen/spacing_xsmall"
                    android:layout_marginTop="@dimen/spacing_xsmall"
                    android:layout_weight="1"
                    android:visibility="visible"
                    app:cardCornerRadius="10dp"
                    app:cardElevation="2dp">

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

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

                            <TextView
                                android:id="@+id/devser"
                                android:layout_height="wrap_content"
                                android:layout_width="match_parent"
                                android:gravity="right"
                                android:layout_marginLeft="20dp"
                                android:textSize="24dp"
                                android:text="92776122"
                                android:layout_marginRight="20dp"
                                android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead"
                                android:textStyle="bold"
                            />

                        </LinearLayout>


                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:padding="@dimen/spacing_large">

                            <ImageView
                                android:background="@null"
                                android:layout_width="40dp"
                                android:layout_height="wrap_content"
                                android:layout_centerHorizontal="true"
                                android:layout_centerVertical="true"
                                app:srcCompat="@drawable/tms3_small" />

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

                                android:padding="20dp">

                                <View
                                    android:layout_width="match_parent"
                                    android:layout_height="@dimen/spacing_medium" />

                                <!--- hum AD -->
                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">
                                    <!-- popiska k teplote -->
                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="20dp"
                                        android:textStyle="bold"
                                        android:text="AD     "/>
                                    <TextView
                                        android:id="@+id/devhumAD"
                                        android:layout_width="match_parent"
                                        android:layout_height="20dp"
                                        android:text="15.0"
                                        android:textColor="?android:attr/textColorPrimary"
                                        android:textStyle="bold" />
                                </LinearLayout>
                                <!--- teplota T1 -->
                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">
                                    <!-- popiska k teplote -->
                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="20dp"
                                        android:textStyle="bold"
                                        android:text="T3/\u2103 "/>
                                    <TextView
                                        android:id="@+id/devt1"
                                        android:layout_width="match_parent"
                                        android:layout_height="20dp"
                                        android:text="50.2"
                                        android:textColor="?android:attr/textColorPrimary"
                                        android:textStyle="bold" />
                                </LinearLayout>
                                <!--- teplota T2 -->
                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">
                                    <!-- popiska k teplote -->
                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="20dp"
                                        android:textStyle="bold"
                                        android:text="T2/\u2103 "/>
                                    <TextView
                                        android:id="@+id/devt2"
                                        android:layout_width="match_parent"
                                        android:layout_height="20dp"
                                        android:textColor="?android:attr/textColorPrimary"
                                        android:text="13.5"
                                        android:textStyle="bold" />
                                </LinearLayout>
                                <!--- teplota T3 -->
                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">
                                    <!-- popiska k teplote -->
                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="20dp"
                                        android:textStyle="bold"
                                        android:text="T1/\u2103 "/>
                                    <TextView
                                        android:id="@+id/devt3"
                                        android:layout_width="match_parent"
                                        android:layout_height="20dp"
                                        android:textColor="?android:attr/textColorPrimary"
                                        android:text="-80.3"
                                        android:textStyle="bold" />
                                </LinearLayout>
                            </LinearLayout>

                        </LinearLayout>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <!--- mezera mezi slozenymi obrazky -->
                <View
                    android:layout_width="@dimen/spacing_xsmall"
                    android:layout_height="0dp" />

                <!--- zacatek druhe slozene karty -->
                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="@dimen/spacing_xsmall"
                    android:layout_marginLeft="@dimen/spacing_xsmall"
                    android:layout_marginRight="@dimen/spacing_xsmall"
                    android:layout_marginTop="@dimen/spacing_xsmall"
                    android:layout_weight="1"
                    android:visibility="visible"
                    app:cardCornerRadius="10dp"
                    app:cardElevation="2dp">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:padding="@dimen/spacing_large"
                        android:background="#FDFAF1">

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

                            <TextView
                                android:id="@+id/devMode"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:textSize="24dp"
                                android:text="Basic"
                                android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead"
                                android:textStyle="bold" />

                            <View
                                android:layout_width="0dp"
                                android:layout_height="5dp" />

                        </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:padding="@dimen/spacing_large">
                            <RelativeLayout
                                android:layout_width="102dp"
                                android:layout_height="102dp">

                                <ImageView
                                    android:id="@+id/devImage"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:layout_centerInParent="true"
                                    app:srcCompat="@drawable/a1" />


                            </RelativeLayout>
                    </LinearLayout>

                        <ProgressBar
                            android:id="@+id/devMemory"
                            style="@android:style/Widget.ProgressBar.Horizontal"
                            android:progress="70"
                            android:secondaryProgress="10"
                            android:scaleY="1"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:progressBackgroundTint="@color/white"
                            android:progressTint="@color/indigo_100"
                            />

                    </LinearLayout>

                    <!-- karty teplot -->
                </androidx.cardview.widget.CardView>

            </LinearLayout>
        </LinearLayout>


        <!-- tms time/pc time/Delta -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingLeft="@dimen/spacing_middle"
            android:paddingRight="@dimen/spacing_middle">

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/spacing_xsmall"
                android:layout_marginLeft="@dimen/spacing_xsmall"
                android:layout_marginRight="@dimen/spacing_xsmall"
                android:layout_marginTop="@dimen/spacing_xsmall"
                android:layout_weight="1"
                android:visibility="visible"
                app:cardCornerRadius="10dp"
                app:cardElevation="2dp">

                <!-- velke radky, skladam je pod sebe -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:padding="1dp"
                    android:background="#FDFAF1">

                    <!-- prvni radek v cardview -->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        >
                        <!-- zahlavi s popiskem zobrazenych casu -->


                        <View
                            android:layout_width="match_parent"
                            android:layout_height="1dp"
                            android:background="@color/grey_10" />


                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/spacing_xmlarge"
                        android:gravity="center_vertical"
                        android:orientation="horizontal">

                        <View
                            android:layout_width="@dimen/spacing_large"
                            android:layout_height="0dp" />

                        <TextView
                            android:layout_width="8dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="TMS time"
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <TextView
                            android:id="@+id/devTime"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="01.01.2023 23.59.59"
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <TextView
                            android:layout_width="32dp"
                            android:layout_height="wrap_content"
                            android:text="    "
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <View
                            android:layout_width="@dimen/spacing_large"
                            android:layout_height="0dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/spacing_xmlarge"
                        android:gravity="center_vertical"
                        android:orientation="horizontal">

                        <View
                            android:layout_width="@dimen/spacing_large"
                            android:layout_height="0dp" />

                        <TextView
                            android:layout_width="8dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="Telephone time"
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <TextView
                            android:id="@+id/phoneTime"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="01.01.2023 23.59.59"
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <View
                            android:layout_width="48dp"
                            android:layout_height="0dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/spacing_xmlarge"
                        android:gravity="center_vertical"
                        android:orientation="horizontal">

                        <View
                            android:layout_width="@dimen/spacing_large"
                            android:layout_height="0dp" />

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="Difference: (phone - device) / sec:"
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <TextView
                            android:id="@+id/diffTime"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="..."
                            android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
                        />

                        <View
                            android:layout_width="48dp"
                            android:layout_height="0dp" />
                    </LinearLayout>

                </LinearLayout>
            </androidx.cardview.widget.CardView>

        </LinearLayout>

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingLeft="@dimen/spacing_middle"
                android:paddingRight="@dimen/spacing_middle"
                android:layout_marginTop="20dp">

            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/spacing_xsmall"
                android:layout_marginLeft="@dimen/spacing_xsmall"
                android:layout_marginRight="@dimen/spacing_xsmall"
                android:layout_marginTop="@dimen/spacing_xsmall"
                android:layout_weight="1"
                android:visibility="visible"
                app:cardCornerRadius="10dp">


                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:padding="@dimen/spacing_large"
                    android:background="#FDFAF1">

                    <TextView
                        android:id="@+id/proMessage"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="@dimen/spacing_middle"
                        android:layout_marginTop="@dimen/spacing_medium"
                        android:text="Please use button to download the data"
                        android:textAppearance="@style/TextAppearance.AppCompat.Body2"
                    />

                    <View
                        android:layout_width="0dp"
                        android:layout_height="@dimen/spacing_medium" />


                    <androidx.cardview.widget.CardView
                        android:id="@+id/card_view"
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/spacing_xxlarge"
                        android:layout_marginHorizontal="@dimen/spacing_middle"
                        android:layout_marginVertical="@dimen/spacing_middle"
                        app:cardBackgroundColor="@color/colorPrimary"
                        app:cardCornerRadius="4dp"
                        app:cardElevation="0dp">

                        <RelativeLayout
                            android:id="@+id/dev_download"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:background="#F1A833"
                            android:clickable="true">

                            <ProgressBar
                                android:id="@+id/pro_bar"
                                style="@style/Widget.AppCompat.ProgressBar.Horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:layout_alignParentBottom="true"
                                android:indeterminate="false"
                                android:minWidth="0dp"
                                android:minHeight="0dp"
                                android:progress="1"
                                android:progressDrawable="@drawable/progressbar_green" />

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_centerInParent="true"
                                android:gravity="center_vertical"
                                android:orientation="horizontal"
                                android:paddingHorizontal="@dimen/spacing_medium">



                                <TextView
                                    android:id="@+id/tv_download"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="DOWNLOAD"
                                    android:textAppearance="@style/TextAppearance.AppCompat.Body2"
                                    android:textColor="@android:color/white" />

                                <View
                                    android:layout_width="0dp"
                                    android:layout_height="0dp"
                                    android:layout_weight="1" />

                                <TextView
                                    android:id="@+id/tv_status"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginHorizontal="@dimen/spacing_middle"
                                    android:text="0%"
                                    android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
                                    android:textColor="@android:color/white"
                                    app:fontFamily="sans-serif-medium" />

                                <TextView
                                    android:id="@+id/tv_heartbeat"

                                    android:layout_width="15dp"
                                    android:layout_height="15dp"
                                    android:layout_marginHorizontal="@dimen/spacing_middle"
                                    android:text="/"
                                    android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
                                    android:textColor="@android:color/white"
                                    app:fontFamily="sans-serif-medium" />

                            </LinearLayout>

                        </RelativeLayout>

                    </androidx.cardview.widget.CardView>

                </LinearLayout>

            </androidx.cardview.widget.CardView>


        </LinearLayout>

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

</LinearLayout>