<?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="cardInfo"
|
type="com.dayu.general.bean.net.CardReplaceInfo" />
|
</data>
|
|
<androidx.cardview.widget.CardView
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:layout_marginHorizontal="10dp"
|
android:layout_marginVertical="6dp"
|
app:cardCornerRadius="10dp"
|
app:cardElevation="3dp"
|
app:cardBackgroundColor="@color/white">
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:padding="12dp">
|
|
<!-- 顶部信息:卡号和状态 -->
|
<TextView
|
android:id="@+id/tv_card_label"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="卡号"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
android:textStyle="bold"
|
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
|
<TextView
|
android:id="@+id/tv_card_number"
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_marginStart="8dp"
|
android:layout_marginEnd="16dp"
|
android:text="@{cardInfo.cardNum}"
|
android:textColor="@color/colorPrimary"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
app:layout_constraintStart_toEndOf="@+id/tv_card_label"
|
app:layout_constraintTop_toTopOf="@+id/tv_card_label"
|
app:layout_constraintEnd_toStartOf="@+id/tv_status"
|
tools:text="123456789" />
|
|
<TextView
|
android:id="@+id/tv_status"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:background="@drawable/shape_status_bg"
|
android:paddingHorizontal="10dp"
|
android:paddingVertical="3dp"
|
android:text="@{cardInfo.stateName}"
|
android:textColor="@color/white"
|
android:textSize="12sp"
|
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
tools:text="已挂失" />
|
|
<!-- 分隔线 -->
|
<View
|
android:id="@+id/divider"
|
android:layout_width="match_parent"
|
android:layout_height="0.5dp"
|
android:layout_marginTop="12dp"
|
android:background="@color/light_grey"
|
app:layout_constraintTop_toBottomOf="@+id/tv_card_number" />
|
|
<!-- 客户信息 -->
|
<TextView
|
android:id="@+id/tv_client_label"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginTop="12dp"
|
android:text="客户"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/divider" />
|
|
<TextView
|
android:id="@+id/tv_client_name"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginStart="8dp"
|
android:text="@{cardInfo.clientName}"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
android:textStyle="bold"
|
app:layout_constraintStart_toEndOf="@+id/tv_client_label"
|
app:layout_constraintTop_toTopOf="@+id/tv_client_label"
|
tools:text="张三" />
|
|
<!-- 卡类型信息(交换到客户编号的位置) -->
|
<TextView
|
android:id="@+id/tv_card_type_label"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginStart="30dp"
|
android:text="卡类型"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
app:layout_constraintStart_toEndOf="@+id/tv_client_name"
|
app:layout_constraintTop_toTopOf="@+id/tv_client_name" />
|
|
<TextView
|
android:id="@+id/tv_card_type"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginStart="8dp"
|
android:text="@{cardInfo.cardType}"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
app:layout_constraintStart_toEndOf="@+id/tv_card_type_label"
|
app:layout_constraintTop_toTopOf="@+id/tv_card_type_label"
|
tools:text="普通卡" />
|
|
<!-- 客户编号信息(交换到卡类型的位置) -->
|
<TextView
|
android:id="@+id/tv_client_number_label"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginTop="8dp"
|
android:text="编号"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/tv_client_label" />
|
|
<TextView
|
android:id="@+id/tv_client_number"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginStart="8dp"
|
android:text="@{cardInfo.clientNum}"
|
android:textColor="@color/title_bar_text"
|
android:textSize="14sp"
|
app:layout_constraintStart_toEndOf="@+id/tv_client_number_label"
|
app:layout_constraintTop_toTopOf="@+id/tv_client_number_label"
|
tools:text="C12345" />
|
|
<!-- 余额信息(放大字体) -->
|
<TextView
|
android:id="@+id/tv_money_label"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginTop="12dp"
|
android:text="余额"
|
android:textColor="@color/colorAccent"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/tv_client_number_label"
|
app:layout_constraintVertical_bias="1.0" />
|
|
<TextView
|
android:id="@+id/tv_money"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:layout_marginStart="8dp"
|
android:text="@{cardInfo.money.concat(" 元")}"
|
android:textColor="@color/colorAccent"
|
android:textSize="20sp"
|
android:textStyle="bold"
|
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toTopOf="@+id/tv_money_label"
|
tools:text="100.00 元" />
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.cardview.widget.CardView>
|
</layout>
|