<?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_rewards.mvvm.RewardsViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_rewards.ui.RewardsActivity.ClickProxy" />

    </data>

    <androidx.constraintlayout.motion.widget.MotionLayout
        android:id="@+id/motion_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        app:layoutDescription="@xml/scene_rewards_main">

        <!--Top-->
        <LinearLayout
            android:id="@+id/ll_top_box"
            android:layout_width="match_parent"
            android:layout_height="170dp"
            android:background="@drawable/iv_rewards_main_top_bg"
            android:gravity="center_horizontal"
            android:orientation="vertical">

            <View
                android:id="@+id/status_bar_view"
                android:layout_width="match_parent"
                android:layout_height="1dp" />

            <!-- Available Points-->
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <LinearLayout
                    android:id="@+id/ll_promotion_rewards_available_point"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:layout_marginLeft="@dimen/d_30dp"
                    android:orientation="horizontal">

                    <com.guadou.lib_baselib.font_text_view.TextViewLight
                        android:id="@+id/tv_promotion_rewards_available_point"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="-"
                        android:textColor="@color/white"
                        android:textSize="@dimen/d_14sp" />

                    <com.guadou.lib_baselib.font_text_view.TextViewLight
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_2dp"
                        android:text="可用积分"
                        android:textColor="#CAECFF"
                        android:textSize="@dimen/d_14sp" />

                </LinearLayout>

            </RelativeLayout>

            <!--Bronze-->
            <LinearLayout
                android:id="@+id/ll_promotion_rewards_level"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/iv_promotion_rewards_level"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/iv_rewards_star" />

                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                    android:id="@+id/tv_promotion_rewards_level"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_5dp"
                    android:text="Bronze"
                    android:textColor="#E2F1FF"
                    android:textSize="@dimen/d_15sp" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_5dp"
                    android:src="@drawable/iv_rewards_right_arrow" />

            </LinearLayout>

            <!--My Rewards-->
            <LinearLayout
                android:id="@+id/ll_promotion_rewards_my_rewards"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/d_10dp"
                android:background="@drawable/shape_15round_white"
                android:gravity="center_vertical"
                binding:clicks="@{click.gotoMyRewardsActivity}"
                android:paddingLeft="@dimen/d_15dp"
                android:paddingTop="@dimen/d_5dp"
                android:paddingRight="@dimen/d_15dp"
                android:paddingBottom="@dimen/d_5dp">

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

                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_5dp"
                    android:text="我的奖励"
                    android:textColor="#1C92FA"
                    android:textSize="@dimen/d_14sp" />

            </LinearLayout>

        </LinearLayout>

        <!-- placeholder   -->
        <ImageView
            android:id="@+id/img_top_bg"
            android:layout_width="match_parent"
            android:layout_height="85dp"
            android:scaleType="centerCrop"
            android:src="@drawable/login_top_bg" />

        <!--Search-->
        <LinearLayout
            android:id="@+id/ll_promotion_rewards_search"
            android:layout_width="match_parent"
            android:layout_height="70dp"
            android:background="@drawable/iv_rewards_search_bg"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            binding:clicks="@{click.gotoSearchActivity}"
            tools:layout_editor_absoluteX="10dp"
            tools:layout_editor_absoluteY="169dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/d_20dp"
                android:layout_marginTop="-5dp"
                android:src="@drawable/search" />

            <com.guadou.lib_baselib.font_text_view.TextViewLight
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/d_10dp"
                android:layout_marginTop="-5dp"
                android:layout_weight="1"
                android:background="@null"
                android:enabled="false"
                android:hint="搜索"
                android:textColor="@color/black"
                android:textColorHint="@color/gray_text"
                android:textSize="@dimen/d_14sp" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/d_10dp"
                android:layout_marginTop="-5dp"
                android:layout_marginRight="@dimen/d_20dp"
                android:src="@drawable/search_delete"
                android:visibility="gone" />

        </LinearLayout>
        <!--  Back -->
        <ImageView
            android:id="@+id/iv_promotion_rewards_main_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="@dimen/d_5dp"
            android:src="@mipmap/back_white_icon" />

        <com.scwang.smart.refresh.layout.SmartRefreshLayout
            android:id="@+id/refresh_layout_promotion_rewards"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            tools:layout_constraintBottom_toBottomOf="parent"
            tools:layout_constraintTop_toBottomOf="@id/ll_promotion_rewards_search">

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

            <androidx.core.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true"
                android:overScrollMode="never"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <!--Category-->
                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/recycler_view_promotion_rewards_category"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:overScrollMode="never" />

                    <!--Recommend-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:paddingTop="@dimen/d_12dp"
                        android:paddingBottom="@dimen/d_12dp">

                        <com.guadou.lib_baselib.font_text_view.TextViewBold
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:paddingLeft="@dimen/d_15dp"
                            android:text="推荐"
                            android:textColor="@color/black"
                            android:textSize="@dimen/d_15sp" />

                        <com.guadou.lib_baselib.font_text_view.TextViewLight
                            android:id="@+id/tv_promotion_rewards_recommend_see_all"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginRight="@dimen/d_10dp"
                            android:padding="@dimen/d_5dp"
                            android:text="查看所有"
                            binding:clicks="@{click.gotoRewardsList}"
                            android:textColor="@color/dark_gray_text"
                            android:textSize="@dimen/d_13sp" />

                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/recycler_view_promotion_rewards_recommend"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:overScrollMode="never" />

                    <!--Hottest-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:paddingTop="@dimen/d_12dp"
                        android:paddingBottom="@dimen/d_13sp">

                        <com.guadou.lib_baselib.font_text_view.TextViewBold
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:paddingLeft="@dimen/d_15dp"
                            android:text="最热门的"
                            android:textColor="@color/black"
                            android:textSize="@dimen/d_15sp" />

                        <com.guadou.lib_baselib.font_text_view.TextViewLight
                            android:id="@+id/tv_promotion_rewards_hottest_see_all"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginRight="@dimen/d_10dp"
                            android:padding="@dimen/d_5dp"
                            android:text="查看所有"
                            android:textColor="@color/dark_gray_text"
                            android:textSize="@dimen/d_13sp" />

                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/recycler_view_promotion_rewards_hottest"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:overScrollMode="never" />

                    <!--Food & Beverage-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:paddingTop="@dimen/d_12dp"
                        android:paddingBottom="@dimen/d_12dp">

                        <com.guadou.lib_baselib.font_text_view.TextViewBold
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:paddingLeft="@dimen/d_15dp"
                            android:text="食品与饮料"
                            android:textColor="@color/black"
                            android:textSize="@dimen/d_15sp" />

                        <com.guadou.lib_baselib.font_text_view.TextViewLight
                            android:id="@+id/tv_promotion_rewards_food_see_all"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginRight="@dimen/d_10dp"
                            android:padding="@dimen/d_5dp"
                            android:text="查看所有"
                            android:textColor="@color/dark_gray_text"
                            android:textSize="@dimen/d_13sp" />

                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/recycler_view_promotion_rewards_food"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:overScrollMode="never" />

                    <!--Best Offers in Singapore-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:paddingTop="@dimen/d_12dp"
                        android:paddingBottom="@dimen/d_13sp">

                        <com.guadou.lib_baselib.font_text_view.TextViewBold
                            android:id="@+id/tv_base_sell_text"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:paddingLeft="@dimen/d_15dp"
                            tools:text="中国最佳优惠"
                            android:text="中国最佳优惠"
                            android:textColor="@color/black"
                            android:textSize="@dimen/d_15sp" />

                        <com.guadou.lib_baselib.font_text_view.TextViewLight
                            android:id="@+id/tv_promotion_rewards_best_offer_see_all"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginRight="@dimen/d_10dp"
                            android:padding="@dimen/d_5dp"
                            android:text="查看所有"
                            android:textColor="@color/dark_gray_text"
                            android:textSize="@dimen/d_12sp" />

                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/recycler_view_promotion_rewards_offers"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:overScrollMode="never" />

                </LinearLayout>

            </androidx.core.widget.NestedScrollView>

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

    </androidx.constraintlayout.motion.widget.MotionLayout>

</layout>