item UI 美化
This commit is contained in:
parent
6dd6502c5a
commit
435faca163
|
|
@ -7,7 +7,6 @@ import androidx.recyclerview.widget.DiffUtil
|
||||||
import androidx.recyclerview.widget.ListAdapter
|
import androidx.recyclerview.widget.ListAdapter
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.gamedog.vididin.beans.RecordCash
|
import com.gamedog.vididin.beans.RecordCash
|
||||||
import com.gamedog.vididin.beans.TransactionStatus
|
|
||||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordCashItemBinding as ViewBinding
|
import com.gamedog.vididin.databinding.FragmentWithdrawRecordCashItemBinding as ViewBinding
|
||||||
|
|
||||||
class RecordCashRvAdapter : ListAdapter<RecordCash, RecordCashRvAdapter.ViewHolder>(DiffCallback()) {
|
class RecordCashRvAdapter : ListAdapter<RecordCash, RecordCashRvAdapter.ViewHolder>(DiffCallback()) {
|
||||||
|
|
@ -24,18 +23,11 @@ class RecordCashRvAdapter : ListAdapter<RecordCash, RecordCashRvAdapter.ViewHold
|
||||||
inner class ViewHolder(private val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root) {
|
inner class ViewHolder(private val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root) {
|
||||||
fun bind(transaction: RecordCash) {
|
fun bind(transaction: RecordCash) {
|
||||||
binding.tvDate.text = transaction.dateTime
|
binding.tvDate.text = transaction.dateTime
|
||||||
binding.tvStatus.text = transaction.statusText
|
binding.tvTitle.text = transaction.statusText
|
||||||
binding.tvDescription.text = transaction.description
|
binding.tvDescription.text = transaction.description
|
||||||
binding.tvAmount.text = transaction.amount
|
binding.tvAmount.text = transaction.amount
|
||||||
binding.tvAmount.setTextColor(ContextCompat.getColor(binding.root.context, transaction.amountColor))
|
binding.tvAmount.setTextColor(ContextCompat.getColor(binding.root.context, transaction.amountColor))
|
||||||
|
|
||||||
// 设置状态图标
|
|
||||||
binding.tvStatusIcon.text = when (transaction.status) {
|
|
||||||
TransactionStatus.SUCCESS -> "✔"
|
|
||||||
TransactionStatus.FAILED -> "!"
|
|
||||||
TransactionStatus.PROCESSING -> "⟳"
|
|
||||||
TransactionStatus.REDEEM -> "↗"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import androidx.recyclerview.widget.DiffUtil
|
||||||
import androidx.recyclerview.widget.ListAdapter
|
import androidx.recyclerview.widget.ListAdapter
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.gamedog.vididin.beans.RecordGold
|
import com.gamedog.vididin.beans.RecordGold
|
||||||
import com.gamedog.vididin.beans.TransactionStatus
|
|
||||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordGoldItemBinding as ViewBinding
|
import com.gamedog.vididin.databinding.FragmentWithdrawRecordGoldItemBinding as ViewBinding
|
||||||
|
|
||||||
class RecordGoldRvAdapter : ListAdapter<RecordGold, RecordGoldRvAdapter.ViewHolder>(DiffCallback()) {
|
class RecordGoldRvAdapter : ListAdapter<RecordGold, RecordGoldRvAdapter.ViewHolder>(DiffCallback()) {
|
||||||
|
|
@ -24,18 +23,10 @@ class RecordGoldRvAdapter : ListAdapter<RecordGold, RecordGoldRvAdapter.ViewHold
|
||||||
inner class ViewHolder(private val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root) {
|
inner class ViewHolder(private val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root) {
|
||||||
fun bind(transaction: RecordGold) {
|
fun bind(transaction: RecordGold) {
|
||||||
binding.tvDate.text = transaction.dateTime
|
binding.tvDate.text = transaction.dateTime
|
||||||
binding.tvStatus.text = transaction.statusText
|
binding.tvTitle.text = transaction.statusText
|
||||||
binding.tvDescription.text = transaction.description
|
binding.tvDescription.text = transaction.description
|
||||||
binding.tvAmount.text = transaction.amount
|
binding.tvAmount.text = transaction.amount
|
||||||
binding.tvAmount.setTextColor(ContextCompat.getColor(binding.root.context, transaction.amountColor))
|
binding.tvAmount.setTextColor(ContextCompat.getColor(binding.root.context, transaction.amountColor))
|
||||||
|
|
||||||
// 设置状态图标
|
|
||||||
binding.tvStatusIcon.text = when (transaction.status) {
|
|
||||||
TransactionStatus.SUCCESS -> "✔"
|
|
||||||
TransactionStatus.FAILED -> "!"
|
|
||||||
TransactionStatus.PROCESSING -> "⟳"
|
|
||||||
TransactionStatus.REDEEM -> "↗"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape android:shape="rectangle"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke android:width="2dp" android:color="#fff2f2f2" />
|
||||||
|
<solid android:color="@color/red_e0" />
|
||||||
|
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape android:shape="rectangle"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke android:width="2dp" android:color="#fff2f2f2" />
|
||||||
|
<solid android:color="@color/transparent" />
|
||||||
|
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
|
|
@ -2,30 +2,34 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:padding="12dp">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvDate"
|
android:id="@+id/tvDate"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="12dp"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
android:text="2025/10/31 17:30"
|
android:text="2025/10/31 17:30"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/gray6" />
|
android:textColor="@color/gray6" />
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="4dp">
|
android:padding="12dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:background="@drawable/bg_cash_record_item_">
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/tvStatusIcon"
|
android:id="@+id/iv_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="30dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="30dp"
|
||||||
android:text="✔"
|
android:src="@mipmap/icon_fail"
|
||||||
android:textSize="14sp"
|
android:scaleType="centerCrop"
|
||||||
android:textColor="@color/green_39"
|
|
||||||
android:layout_marginEnd="8dp" />
|
android:layout_marginEnd="8dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -33,23 +37,23 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvStatus"
|
android:id="@+id/tv_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Sucesso"
|
android:text="title"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/gray3" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_description"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:text="description"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/black" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvDescription"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Você solicitou o saque com sucesso!"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="@color/gray6" />
|
android:textColor="@color/gray6" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -57,9 +61,8 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="-R$ 0,1"
|
android:text="-R$ 0,1"
|
||||||
android:textSize="14sp"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/red_5c" />
|
android:textColor="@color/red_0b" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -2,30 +2,33 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:padding="12dp">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvDate"
|
android:id="@+id/tvDate"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="12dp"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
android:text="2025/10/31 17:30"
|
android:text="2025/10/31 17:30"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/gray6" />
|
android:textColor="@color/gray6" />
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="4dp">
|
android:padding="12dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
|
android:background="@drawable/bg_gold_record_item_">
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/tvStatusIcon"
|
android:id="@+id/iv_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="30dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="30dp"
|
||||||
android:text="✔"
|
android:src="@mipmap/icon_notify"
|
||||||
android:textSize="14sp"
|
android:scaleType="centerCrop"
|
||||||
android:textColor="@color/green_39"
|
|
||||||
android:layout_marginEnd="8dp" />
|
android:layout_marginEnd="8dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -34,31 +37,40 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvStatus"
|
android:id="@+id/tv_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Sucesso"
|
android:text="title"
|
||||||
android:textSize="14sp"
|
android:textSize="15sp"
|
||||||
android:textColor="@color/black" />
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/gray3" />
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvDescription"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Você solicitou o saque com sucesso!"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="@color/gray6" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvAmount"
|
android:id="@+id/tvAmount"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
android:text="-R$ 0,1"
|
android:text="-R$ 0,1"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="@color/red_0b" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_description"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="description"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/red_5c" />
|
android:textColor="@color/gray6" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,5 +96,6 @@
|
||||||
<color name="red_28">#FFFF2828</color>
|
<color name="red_28">#FFFF2828</color>
|
||||||
<color name="red_9c">#FFFF9C7C</color>
|
<color name="red_9c">#FFFF9C7C</color>
|
||||||
<color name="yellow_0b">#FFFF740B</color>
|
<color name="yellow_0b">#FFFF740B</color>
|
||||||
|
<color name="red_e0">#ffffe9e0</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue