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

    <data>

        <import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />

        <variable
            name="viewModel"
            type="com.lukouguoji.aerologic.page.car.chart.CarChartViewModel" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/backgroud_gray"
        android:orientation="vertical">

        <include layout="@layout/title_tool_bar" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="10dp"
            android:layout_marginTop="10dp"
            android:gravity="center_vertical">

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"请选择位置"}'
                list="@{viewModel.locationList}"
                type="@{SearchLayoutType.SPINNER}"
                value="@={viewModel.location}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                setRefreshCallBack="@{viewModel::getData}"
                android:layout_weight="1" />

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="5">

                <ImageView
                    style="@style/iv_search_action"
                    android:onClick="@{()-> viewModel.getData()}"
                    android:src="@drawable/img_search" />

            </LinearLayout>

        </LinearLayout>

        <com.github.mikephil.charting.charts.BarChart
            android:id="@+id/bar_chart"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_margin="15dp"
            android:layout_weight="1" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/color_bottom_layout"
            android:gravity="center_vertical"
            android:paddingHorizontal="15dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text='@{"合计：" + viewModel.count +"辆"}'
                android:textColor="@color/white"
                android:textSize="18sp"
                android:textStyle="bold" />

        </LinearLayout>
    </LinearLayout>
</layout>