优化订单显示档口机标识;优化当前菜品信息的问题;
This commit is contained in:
@@ -2,6 +2,7 @@ package com.sw.dualscreen.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
@@ -31,13 +32,15 @@ class FoodOrderAdapter(list: MutableList<FoodItem>) :
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: VH, position: Int, item: FoodItem?) {
|
||||
val binding = holder.binding
|
||||
setTextColor(binding.tvFoodName, binding.tvPriceNorm, binding.tvWeight, binding.tvAmount)
|
||||
item?.let {
|
||||
binding.tvFoodName.text = it.foodName
|
||||
binding.tvFoodName.setTextColor(if (it.isLocalData) Color.GREEN else "#FF33446A".toColorInt())
|
||||
if (it.orderFrom == 2) {
|
||||
binding.tvPriceNorm.text = if (it.specName.isNullOrBlank()) "${it.specWeight}克" else "${it.specName}/${it.specWeight}克"
|
||||
} else {
|
||||
val foodPrice = it.foodPrice.format2String(2)
|
||||
binding.tvPriceNorm.text = "${foodPrice}/${it.num}克"
|
||||
binding.tvPriceNorm.text = "${foodPrice}/100克"
|
||||
}
|
||||
//if (it.specName.isNullOrBlank().not()) {
|
||||
// binding.tvPriceFlag.text = "[${it.specName}]"
|
||||
@@ -48,7 +51,6 @@ class FoodOrderAdapter(list: MutableList<FoodItem>) :
|
||||
if (it.orderFrom == 2) visible() else gone()
|
||||
}
|
||||
}
|
||||
setTextColor(binding.tvFoodName, binding.tvPriceNorm, binding.tvWeight, binding.tvAmount)
|
||||
binding.root.updateLayoutParams<RecyclerView.LayoutParams> {
|
||||
topMargin = 2.dp
|
||||
bottomMargin = 2.dp
|
||||
|
||||
Reference in New Issue
Block a user