<?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="audioRecoverViewModel"
            type="com.datarecovery.master.module.audiorecover.AudioRecoverViewModel" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/tool_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent"
            app:navigationIcon="@drawable/icon_back">

            <TextView
                style="@style/Tool_Bar_Title_Txt"
                android:text="@string/audio_recover_title" />

            <ImageView
                imageDraw="@{audioRecoverViewModel.checkAll ? @drawable/icon_image_recover_checked : @drawable/icon_image_recover_uncheck}"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_marginEnd="@dimen/app_common_page_horizontal_padding"
                android:background="?android:attr/selectableItemBackgroundBorderless"
                android:onClick="@{()->audioRecoverViewModel.onCheckAllClick(!audioRecoverViewModel.checkAll)}"
                tools:src="@drawable/icon_image_recover_uncheck" />

        </androidx.appcompat.widget.Toolbar>

        <View
            android:id="@+id/v_filter"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:36"
            app:layout_constraintTop_toBottomOf="@+id/tool_bar" />

        <TextView
            android:id="@+id/tv_date_filter"
            drawableEnd="@{audioRecoverViewModel.isDateFilterArrowUp ? @drawable/icon_filter_arrow_up : @drawable/icon_filter_arrow_down}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/audio_recover_date_filter"
            android:textColor="@{audioRecoverViewModel.dataFilterCondition !=null ? @color/colorPrimary : @color/tab_un_select_text_color}"
            android:textSize="14sp"
            app:drawableEndCompat="@drawable/icon_filter_arrow_down"
            app:layout_constraintBottom_toBottomOf="@+id/v_filter"
            app:layout_constraintLeft_toLeftOf="@+id/v_filter"
            app:layout_constraintRight_toLeftOf="@+id/v_line"
            app:layout_constraintTop_toTopOf="@+id/v_filter" />

        <View
            android:id="@+id/v_date_filter"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:onClick="@{()->audioRecoverViewModel.onDateFilterClick()}"
            app:layout_constraintBottom_toBottomOf="@+id/v_filter"
            app:layout_constraintEnd_toStartOf="@id/v_line"
            app:layout_constraintStart_toStartOf="@id/v_filter"
            app:layout_constraintTop_toTopOf="@+id/v_filter" />


        <View
            android:id="@+id/v_line"
            android:layout_width="1dp"
            android:layout_height="20dp"
            android:background="#F5F5F5"
            app:layout_constraintBottom_toBottomOf="@+id/v_filter"
            app:layout_constraintLeft_toRightOf="@+id/tv_date_filter"
            app:layout_constraintRight_toLeftOf="@+id/tv_size_sort"
            app:layout_constraintTop_toTopOf="@id/v_filter" />

        <TextView
            android:id="@+id/tv_size_sort"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/audio_recover_size_sort"
            drawableEnd="@{audioRecoverViewModel.isSizeSortArrowUp ? @drawable/icon_filter_arrow_up : @drawable/icon_filter_arrow_down}"
            android:textColor="#666666"
            android:textSize="14sp"
            app:layout_constraintBottom_toBottomOf="@+id/v_filter"
            app:layout_constraintLeft_toRightOf="@+id/v_line"
            app:layout_constraintRight_toRightOf="@+id/v_filter"
            app:layout_constraintTop_toTopOf="@+id/v_filter" />

        <View
            android:id="@+id/v_size_sort"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:onClick="@{()->audioRecoverViewModel.onSizeSortClick(!audioRecoverViewModel.isSizeSortArrowUp)}"
            app:layout_constraintBottom_toBottomOf="@+id/v_filter"
            app:layout_constraintEnd_toEndOf="@+id/v_filter"
            app:layout_constraintStart_toEndOf="@+id/v_line"
            app:layout_constraintTop_toTopOf="@+id/v_filter" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/ry_audio_recover"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="#F8F8F8"
            app:layout_constraintBottom_toTopOf="@+id/v_bottom"
            app:layout_constraintTop_toBottomOf="@+id/v_filter"
            tools:listitem="@layout/item_data_audio" />

        <View
            android:id="@+id/v_bottom"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@color/white"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintDimensionRatio="360:72" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@{audioRecoverViewModel.selectedList.size() > 0 ? @drawable/bg_common_btn : @drawable/bg_common_disable_btn}"
            android:gravity="center"
            android:onClick="@{()->audioRecoverViewModel.onExportClick()}"
            android:text="@{audioRecoverViewModel.selectedCountTxt}"
            android:textColor="@color/white"
            android:textSize="16sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@id/v_bottom"
            app:layout_constraintDimensionRatio="328:44"
            app:layout_constraintEnd_toEndOf="@+id/v_bottom"
            app:layout_constraintStart_toStartOf="@id/v_bottom"
            app:layout_constraintTop_toTopOf="@id/v_bottom"
            app:layout_constraintWidth_percent="0.9111111111111111"
            tools:background="@drawable/bg_common_btn"
            tools:text="立即导出" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>