<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <data>

        <variable
            name="item"
            type="com.example.beijing_daxing.been.Stock" />

    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:background='@{item.state.equals("Y")?@color/green:@color/item_bg}'
        android:orientation="horizontal">

        <TextView
            android:id="@+id/item_index"
            style="@style/item_text_style"
            android:layout_width="40dp"
            android:layout_height="match_parent"
            android:text='@{String.valueOf(item.index)}' />

        <View
            android:layout_width="2dp"
            android:layout_height="match_parent"
            android:background="@color/white" />


        <TextView
            android:layout_width="100dp"
            android:layout_height="match_parent"
            style="@style/item_text_style"
            android:text="@{item.locationCode}" />

        <TextView
            style="@style/item_text_style"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:minHeight="45dp"
            android:gravity="left"
            android:text="@{item.epcCode}" />


        <View
            android:layout_width="2dp"
            android:layout_height="match_parent"
            android:background="@color/white" />

        <TextView
            android:id="@+id/item_buttom"
            style="@style/item_text_style"
            android:layout_width="63dp"
            android:layout_height="match_parent"
            android:text='@{item.state.equals("Y")?"已扫描":"未扫描"}'
            android:textColor='@{item.state.equals("Y")?@color/black:@color/red}' />


    </LinearLayout>
</layout>