<?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="goodsBean"
            type="com.datarecovery.master.data.api.bean.MemberGoodsBean" />

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

        <import type="com.atmob.common.text.TextUtil" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="12dp">


        <ImageView
            android:id="@+id/iv_bg"
            imageDraw="@{goodsBean.select ? @drawable/bg_member_goods_type_selected : @drawable/bg_member_goods_type_normal}"
            android:layout_width="@{(float)SizeUtil.getScreenWidth() * 0.4388888888888889f, default=wrap_content}"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="474:426"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/space1"
            tools:src="@drawable/bg_member_goods_type_normal" />

        <Space
            android:id="@+id/space1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="@+id/tv_member_buy_tag"
            app:layout_constraintStart_toStartOf="@+id/tv_member_buy_tag"
            app:layout_constraintTop_toTopOf="@+id/tv_member_buy_tag" />

        <TextView
            android:id="@+id/tv_member_buy_tag"
            isInvisible="@{!goodsBean.popular}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_member_tag"
            android:drawablePadding="2dp"
            android:paddingHorizontal="10dp"
            android:paddingVertical="4dp"
            android:text="@string/member_buy_tag_txt"
            android:textColor="@color/white"
            android:textSize="12sp"
            android:textStyle="bold"
            app:drawableStartCompat="@drawable/icon_hot"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{goodsBean.name}"
            android:textColor="#404040"
            android:textSize="15sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@id/iv_bg"
            app:layout_constraintEnd_toEndOf="@+id/iv_bg"
            app:layout_constraintStart_toStartOf="@id/iv_bg"
            app:layout_constraintTop_toTopOf="@id/iv_bg"
            app:layout_constraintVertical_bias="0.1416666666666667"
            tools:text="微信信息恢复" />

        <TextView
            android:id="@+id/tv_member_buy_price_unit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/rmb"
            android:textColor="@{goodsBean.select ? @color/member_buy_price_text_selected : @color/member_buy_price_text_normal}"
            android:textSize="20sp"
            android:textStyle="bold"
            app:layout_constraintBaseline_toBaselineOf="@id/tv_member_buy_price"
            app:layout_constraintHorizontal_chainStyle="packed"
            app:layout_constraintLeft_toLeftOf="@+id/iv_bg"
            app:layout_constraintRight_toLeftOf="@+id/tv_member_buy_price"
            tools:textColor="#404040" />

        <TextView
            android:id="@+id/tv_member_buy_price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{TextUtil.formatFloatWithout0End(goodsBean.RMBAmount, 2)}"
            android:textColor="@{goodsBean.select ? @color/member_buy_price_text_selected : @color/member_buy_price_text_normal}"
            android:textSize="40sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@id/iv_bg"
            app:layout_constraintLeft_toRightOf="@+id/tv_member_buy_price_unit"
            app:layout_constraintRight_toRightOf="@+id/iv_bg"
            app:layout_constraintTop_toTopOf="@id/iv_bg"
            app:layout_constraintVertical_bias="0.4526315789473684"
            tools:text="66"
            tools:textColor="#404040" />

        <TextView
            deleteLine="@{Boolean.TRUE}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{@string/member_price(TextUtil.formatFloatWithout0End(goodsBean.originalAmount, 1))}"
            android:textColor="@{goodsBean.select ? @color/member_original_price_text_selected : @color/member_original_price_text_normal}"
            android:textSize="12sp"
            app:layout_constraintBottom_toBottomOf="@id/iv_bg"
            app:layout_constraintEnd_toEndOf="@id/iv_bg"
            app:layout_constraintStart_toStartOf="@id/iv_bg"
            app:layout_constraintTop_toTopOf="@id/iv_bg"
            app:layout_constraintVertical_bias="0.752"
            tools:text="￥299" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{goodsBean.description}"
            android:textColor="#7C4B00"
            android:textSize="12sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@id/iv_bg"
            app:layout_constraintEnd_toEndOf="@id/iv_bg"
            app:layout_constraintStart_toStartOf="@id/iv_bg"
            app:layout_constraintTop_toTopOf="@id/iv_bg"
            app:layout_constraintVertical_bias="0.936"
            tools:text="单个功能恢复" />


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