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

    <androidx.core.widget.NestedScrollView
        android:id="@+id/nested_scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/col_6f7"
            android:orientation="vertical"
            android:padding="@dimen/dp_14">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/shape_sleep_bg_8dp_head"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingLeft="16dp"
                android:paddingTop="16dp"
                android:paddingRight="16dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/shape_title_section" />

                <TextView
                    android:layout_width="@dimen/dp_0"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:padding="@dimen/dp_8"
                    android:text="睡眠时长"
                    android:textColor="@color/col_333"
                    android:textSize="17sp" />
                <TextView
                    android:id="@+id/compare_tv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_22"
                    android:layout_marginBottom="@dimen/dp_27"
                    android:drawablePadding="@dimen/dp_6"
                    android:text="查看数据对比"
                    android:gravity="center_vertical"
                    android:textColor="@color/col_c7c"
                    android:drawableRight="@mipmap/arrow_right"
                    android:textSize="@dimen/dp_13"
                    android:textStyle="bold"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />


            </LinearLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="@dimen/dp_40"
                android:background="@color/white"
                android:orientation="horizontal">

                <com.xty.common.weight.tablayout.CommonTabLayout
                    android:id="@+id/commonTabLayout"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_marginEnd="@dimen/dp_12"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/tvHideDate"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:tl_iconVisible="false"
                    app:tl_indicator_color="@color/col_02c"
                    app:tl_indicator_corner_radius="@dimen/dp_2"
                    app:tl_indicator_height="@dimen/dp_3"
                    app:tl_indicator_width="@dimen/dp_16"
                    app:tl_textSelectColor="@color/col_02c"
                    app:tl_textUnselectColor="#7C7C7C"
                    app:tl_textsize="@dimen/sp_15"
                    app:tl_textsizeSelected="@dimen/sp_15" />

                <ImageView
                    android:id="@+id/ivPosition"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="9dp"
                    android:padding="5dp"
                    android:src="@mipmap/ic_arrow_down"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/tvHideDate"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="2023-02-24 至 2023-02-24"
                    android:textColor="#313131"
                    android:textSize="@dimen/sp_12"
                    android:visibility="invisible"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/ivPosition"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/tvShowDate"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="2023-02-24"
                    android:textColor="#313131"
                    android:textSize="@dimen/sp_12"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/ivPosition"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/white"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingRight="@dimen/dp_5"
                android:visibility="gone"
                >

                <com.google.android.material.tabs.TabLayout
                    android:id="@+id/tab_layout"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_40"
                    android:visibility="visible"
                    app:tabGravity="center"
                    app:tabIndicator="@drawable/shape_tab_indicator"
                    app:tabIndicatorColor="@color/col_02c"
                    app:tabIndicatorFullWidth="false"
                    app:tabIndicatorHeight="@dimen/dp_2"
                    app:tabMaxWidth="@dimen/dp_40"
                    app:tabMode="scrollable"
                    app:tabSelectedTextColor="@color/col_02c"
                    app:tabTextSize="@dimen/sp_15"
                    app:tabUnboundedRipple="true"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/mTime"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"/>


                <TextView
                    android:id="@+id/mTime"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:drawableRight="@mipmap/ic_arrow_down"
                    android:drawablePadding="@dimen/dp_5"
                    android:paddingTop="@dimen/dp_10"
                    android:paddingRight="@dimen/dp_10"
                    android:paddingBottom="@dimen/dp_10"
                    android:textColor="@color/black"
                    android:textSize="12sp"
                    android:text="2023-02-24 至 2023-02-24"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.viewpager2.widget.ViewPager2
                android:id="@+id/mVp2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
            <!--    睡眠音乐        -->
            <include
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                layout="@layout/sleep_music_info"
                android:layout_marginBottom="@dimen/dp_20"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="@dimen/sp_15"
                android:textColor="@color/col_313"
                android:layout_marginTop="@dimen/dp_17"
                android:text="睡眠监测原理：\n手表是通过身体动作与心率、呼吸率相结合算出睡眠状况。首先利用内置传感器检测人在熟睡、浅睡或没睡的状态，因为它可以检测到人的心率、手腕的运动频率和幅度的效果，当手腕运动频率较快、幅度较大、心率较高时，说明人的睡眠比较浅当手腕运动很小特别轻微，且心率也较低时则是熟睡。传感器会每隔十分钟分钟测量心率、运动参数，如果前一次和当前测量的结果相似说明一直是相同的睡眠模式，然后累计之后就是熟睡、浅睡等不同的阶段的时间，也就是我们在最后看到的各个阶段的睡眠时间，注意传感器并不是一直工作，而且熟睡的时间是累计的，它不一定是一直持续的，可能是分段的。"/>
        </LinearLayout>
    </androidx.core.widget.NestedScrollView>




</RelativeLayout>
