<?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:binding="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="viewModel"
            type="com.hongyegroup.cpt_ewallet.mvvm.EWalletHistoryViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_ewallet.ui.EWalletHistoryActivity.ClickProxy" />

        <import type="android.text.TextUtils" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_46dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingLeft="@dimen/d_15dp"
            android:paddingRight="@dimen/d_15dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="1.5dp"
                android:src="@mipmap/iv_blue_back"
                binding:clicks="@{click.backPage}" />

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="32dp"
                android:layout_marginLeft="@dimen/d_15dp"
                android:layout_weight="1"
                android:background="@drawable/shape_search_gray_bg_corners3"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <ImageView
                    android:layout_width="@dimen/d_16dp"
                    android:layout_height="@dimen/d_16dp"
                    android:layout_marginLeft="@dimen/d_12dp"
                    android:src="@drawable/search_icon"
                    binding:clicks="@{click.doSearch}" />

                <EditText
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_12dp"
                    android:layout_weight="1"
                    android:background="@color/transparent"
                    android:hint="大家都在搜"
                    android:imeOptions="actionSearch"
                    android:singleLine="true"
                    android:text="@={viewModel.mKeywordLiveData}"
                    android:textColor="@color/black"
                    android:textColorHint="@color/gray_99"
                    android:textSize="@dimen/d_14sp"
                    binding:onKeyEnter="@{click.doSearch}"
                    binding:typefaceMedium="@{true}" />

                <ImageView
                    android:layout_width="@dimen/d_16dp"
                    android:layout_height="@dimen/d_16dp"
                    android:layout_marginRight="@dimen/d_10dp"
                    android:src="@drawable/search_delete"
                    android:visibility="gone"
                    binding:clicks="@{click.searchDel}"
                    binding:isVisibleGone="@{!TextUtils.isEmpty(viewModel.MKeywordLiveData)}" />

            </LinearLayout>

            <ImageView
                android:layout_width="21.5dp"
                android:layout_height="20.5dp"
                android:layout_marginLeft="@dimen/d_12dp"
                android:src="@drawable/history_title_red_calendar_icon"
                binding:clicks="@{click.searchByData}" />

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_0.7dp"
            android:background="@color/main_divider" />

        <com.scwang.smart.refresh.layout.SmartRefreshLayout
            android:id="@+id/refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:srlEnablePreviewInEditMode="false"
            app:srlPrimaryColor="@color/white">

            <com.scwang.smart.refresh.header.ClassicsHeader
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <com.guadou.cs_cptservices.widget.MyStickRecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:overScrollMode="never"
                android:scrollbars="none" />

        </com.scwang.smart.refresh.layout.SmartRefreshLayout>


    </LinearLayout>

</layout>
