<?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="orderViewModel"
            type="com.datarecovery.master.module.order.OrderViewModel" />

        <import type="com.atmob.common.ui.SizeUtil" />
    </data>

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

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:src="@drawable/bg_example"
            app:layout_constraintDimensionRatio="1080:558"
            app:layout_constraintTop_toTopOf="parent" />

        <Space
            android:id="@+id/space_status_bar"
            android:layout_width="match_parent"
            android:layout_height="@{SizeUtil.getStatusBarHeight(), default=@dimen/app_status_bar_height}"
            app:layout_constraintTop_toTopOf="parent" />

        <Space
            android:id="@+id/space1"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:16"
            app:layout_constraintTop_toBottomOf="@+id/space_status_bar" />

        <ImageView
            android:id="@+id/iv_example"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
            android:src="@drawable/icon_order"
            app:layout_constraintDimensionRatio="246:60"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/space1"
            app:layout_constraintWidth_percent="0.2277777777777778" />

        <Space
            android:id="@+id/space2"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:22"
            app:layout_constraintTop_toBottomOf="@+id/iv_example" />


        <ImageView
            android:id="@+id/iv_order_no_data"
            isGone="@{orderViewModel.orderList.size() > 0}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:src="@drawable/icon_order_no_data"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintDimensionRatio="260:160"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/space2"
            app:layout_constraintVertical_bias="0.2351190476190476"
            app:layout_constraintVertical_chainStyle="packed"
            app:layout_constraintWidth_percent="0.7222222222222222" />

        <TextView
            android:id="@+id/tv_order_no_data"
            isGone="@{orderViewModel.orderList.size() > 0}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/order_no_data"
            android:textColor="#404040"
            android:textSize="16sp"
            app:layout_constraintEnd_toEndOf="@+id/iv_order_no_data"
            app:layout_constraintStart_toStartOf="@+id/iv_order_no_data"
            app:layout_constraintTop_toBottomOf="@+id/iv_order_no_data" />


        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/swiper_layout"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintTop_toBottomOf="@id/space2">


            <androidx.core.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <LinearLayout
                    isGone="@{orderViewModel.orderList == null || orderViewModel.orderList.size() == 0}"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/ry_order"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        tools:listitem="@layout/item_order" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingVertical="8dp">

                        <View
                            android:layout_width="12dp"
                            android:layout_height="1dp"
                            android:background="#CCCCCC" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginHorizontal="4dp"
                            android:text="@string/order_show_hint"
                            android:textColor="#CCCCCC"
                            android:textSize="12dp" />

                        <View
                            android:layout_width="12dp"
                            android:layout_height="1dp"
                            android:background="#CCCCCC" />


                    </LinearLayout>

                </LinearLayout>

            </androidx.core.widget.NestedScrollView>


        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>


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