<?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">

    <data>

        <variable
            name="roomData"
            type="com.rdiot.yx485.bean.RoomData" />

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

        <import type="com.rdiot.yx485.net.ModeType" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".ui.ctrl.SubRoomCtrlFragment">

        <com.rdiot.yx485.view.ZNavbar
            android:id="@+id/nb"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:zRightIcon="@mipmap/icon_more"
            app:zTitle="@string/room" />



        <!--控制-->
        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <com.king.view.arcseekbar.ArcSeekBar
                android:id="@+id/arc_seek_bar"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_marginTop="40dp"
                android:padding="10dp"
                app:arcMax="14"
                app:arcNormalColor="@color/device_ctrl_panel_bg_color"
                app:arcProgressColor="@color/device_ctrl_panel_progress_color"
                app:arcShowLabel="false"
                app:arcStartAngle="140"
                app:arcStrokeWidth="20dp"
                app:arcSweepAngle="260"
                app:arcThumbColor="@color/white"
                app:arcEnabledDrag="false"
                app:arcEnabledSingle="false"
                app:arcThumbInnerDotWidth="10dp"
                app:arcThumbShadowColor="#20000000"
                app:arcThumbShadowRadius="5dp"
                app:arcThumbWidth="18dp"
                app:layout_constraintDimensionRatio="h,1:1"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintWidth_percent="0.7" />

            <TextView
                android:id="@+id/tv_temp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="30dp"
                android:includeFontPadding="false"
                android:text="@{String.format(`%d`,roomData.setTemp)}"
                android:textColor="@color/main_text_color"
                android:textSize="72sp"
                android:textStyle="bold"
                app:layout_constraintBottom_toBottomOf="@id/arc_seek_bar"
                app:layout_constraintEnd_toEndOf="@id/arc_seek_bar"
                app:layout_constraintStart_toStartOf="@id/arc_seek_bar"
                app:layout_constraintTop_toTopOf="@id/arc_seek_bar"
                tools:text="28" />

            <TextView
                android:id="@+id/tv_mark"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="12sp"
                android:includeFontPadding="false"
                android:text="℃"
                android:textColor="@color/main_text_color"
                android:textSize="25sp"
                android:textStyle="bold"
                app:layout_constraintStart_toEndOf="@id/tv_temp"
                app:layout_constraintTop_toTopOf="@id/tv_temp" />




            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/main_text_color"
                android:textSize="16sp"
                android:textStyle="bold"
                android:text="@string/master_settings"
                app:layout_constraintEnd_toEndOf="@id/tv_temp"
                app:layout_constraintStart_toStartOf="@id/tv_temp"
                app:layout_constraintTop_toBottomOf="@id/tv_temp"
                tools:text="主控设定" />


            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/cl_air_info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintBottom_toTopOf="@id/ll_fan_speed"
                app:layout_constraintTop_toBottomOf="@id/arc_seek_bar">

                <TextView
                    android:id="@+id/tv_home_temp2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:text="@{String.format(`%d℃`,roomData.temperature)}"
                    android:textAlignment="center"
                    android:textColor="@color/main_text_color"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    app:drawableTopCompat="@mipmap/icon_temperature_room"
                    app:layout_constraintEnd_toStartOf="@id/tv_home_humidity2"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:text="13℃" />

                <TextView
                    android:id="@+id/tv_home_humidity2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{String.format(`%d%%`,roomData.humidity)}"
                    android:textAlignment="center"
                    android:textColor="@color/main_text_color"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    app:drawableTopCompat="@mipmap/icon_humidity_room"
                    app:layout_constraintEnd_toStartOf="@id/tv_pm_2_5"
                    app:layout_constraintStart_toEndOf="@id/tv_home_temp2"
                    app:layout_constraintTop_toTopOf="@id/tv_home_temp2"
                    tools:text="55%" />

                <TextView
                    android:id="@+id/tv_pm_2_5"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{String.format(`%d`,roomData.pm25)}"
                    android:textAlignment="center"
                    android:textColor="@color/main_text_color"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    android:visibility="gone"
                    app:drawableTopCompat="@mipmap/icon_pm2_5_room"
                    app:layout_constraintEnd_toStartOf="@id/tv_co2"
                    app:layout_constraintStart_toEndOf="@id/tv_home_humidity2"
                    app:layout_constraintTop_toTopOf="@id/tv_home_humidity2"
                    tools:text="400" />

                <TextView
                    android:id="@+id/tv_co2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{String.format(`%d`,roomData.co2)}"
                    android:textAlignment="center"
                    android:textColor="@color/main_text_color"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    android:visibility="gone"
                    app:drawableTopCompat="@mipmap/icon_co2_room"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/tv_pm_2_5"
                    app:layout_constraintTop_toTopOf="@id/tv_pm_2_5"
                    tools:text="400" />
            </androidx.constraintlayout.widget.ConstraintLayout>


            <LinearLayout
                android:id="@+id/ll_fan_speed"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="25dp"
                android:layout_marginTop="20dp"
                android:layout_marginEnd="25dp"
                android:background="@drawable/bg_device_ctrl_btn"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                app:layout_constraintBottom_toTopOf="@id/ll_switch"
                app:layout_constraintHorizontal_chainStyle="spread_inside"
                app:layout_constraintTop_toBottomOf="@id/cl_air_info">

                <androidx.appcompat.widget.AppCompatImageView
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginStart="10dp"
                    android:layout_marginTop="25dp"
                    android:layout_marginBottom="25dp"
                    app:srcCompat="@mipmap/icon_fan" />

                <com.jaygoo.widget.RangeSeekBar
                    android:id="@+id/range_seek_bar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="3dp"
                    android:layout_marginEnd="6dp"
                    app:rsb_gravity="center"
                    app:rsb_max="4"
                    app:rsb_min="0"
                    app:rsb_mode="single"
                    app:rsb_progress_color="@color/device_ctrl_seek_bar_progress_color"
                    app:rsb_progress_default_color="@color/device_ctrl_seek_bar_progress_default_color"
                    app:rsb_progress_height="12dp"
                    app:rsb_progress_radius="10dp"
                    app:rsb_step_auto_bonding="true"
                    app:rsb_step_color="@color/white"
                    app:rsb_step_height="8dp"
                    app:rsb_step_radius="4dp"
                    app:rsb_step_width="1dp"
                    app:rsb_steps="4"
                    app:rsb_thumb_height="18dp"
                    app:rsb_thumb_scale_ratio="1.2"
                    app:rsb_thumb_width="18dp"
                    app:rsb_tick_mark_gravity="center"
                    app:rsb_tick_mark_mode="other"
                    app:rsb_tick_mark_number="5" />


            </LinearLayout>

            <LinearLayout
                android:id="@+id/ll_switch"
                android:layout_width="0dp"
                app:layout_constraintDimensionRatio="w,2.5:1"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="9dp"
                android:layout_marginBottom="30dp"
                android:background="@{roomData.power? @drawable/bg_device_ctrl_btn_sel :@drawable/bg_device_ctrl_btn}"
                android:gravity="center"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                tools:background="@drawable/bg_device_ctrl_btn_sel">

                <androidx.appcompat.widget.AppCompatImageView
                    srcString="@{roomData.power ? `icon_on_sel` :`icon_on_sel_1`}"
                    android:layout_width="46dp"
                    android:layout_height="46dp"
                    android:layout_marginTop="22dp"
                    android:layout_marginBottom="22dp"
                    tools:srcCompat="@mipmap/icon_on_sel" />
            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>


    </LinearLayout>
</layout>