3 Commits
Author SHA1 Message Date
lvmeng 425f485b95 feat(ui): 将加载动画图标替换为 VectorDrawable,清理无用代码 2026-04-28 11:56:28 +08:00
lvmeng 264198463c style(ui): 优化界面布局和颜色配置
- 修改 RecyclerView 高度设置以改进布局
- 更新颜色值,移除 alpha 通道简化颜色定义
- 重构调味配置界面布局,提升视觉效果
- 调整项目条目样式,包括文字颜色和字体粗细
- 更新分割线为 Material Divider 组件
- 统一调整文本颜色和大小以增强可读性
- 优化调味网格适配器中的文字颜色显示
- 调整布局间距和尺寸参数以改善界面美观
- 优化重量数据显示,增加小数位数控制功能
2026-04-28 10:49:10 +08:00
lvmeng 89fa681722 style(ui): 优化食材识别页面界面布局和交互体验
- 将内边距设置从统一padding改为水平和底部独立设置
- 增加卡片圆角大小从8dp到12dp提升视觉效果
- 为商品列表添加白色圆角背景提升美观性
- 调整滚动条垂直边距和顶部间距
- 将选中食材和重量显示区域包裹在圆角容器中
- 添加食材名称文本的最大行数和省略效果
- 统一按钮边距使用水平和垂直边距设置
- 动态调整RecyclerView父容器高度适配内容
- 注释掉食材搜索弹窗的默认商品名称传递
- 在食材搜索弹窗中预设测试数据便于调试
2026-04-28 09:25:31 +08:00
21 changed files with 225 additions and 156 deletions
@@ -103,8 +103,9 @@ class Seasoning18GridAdapter(
holder.b.root.setBackgroundResource(R.drawable.shape_scale_cell)
val normal = ContextCompat.getColor(holder.b.root.context, R.color.home_title)
val sub = ContextCompat.getColor(holder.b.root.context, R.color.home_sub_title)
val black = ContextCompat.getColor(holder.b.root.context, R.color.black)
holder.b.tvAddress.setTextColor(sub)
holder.b.tvName.setTextColor(sub)
holder.b.tvName.setTextColor(black)
holder.b.tvWeight.setTextColor(normal)
holder.b.tvState.setTextColor(sub)
}
@@ -109,8 +109,9 @@ class Seasoning22GridAdapter(
holder.b.root.setBackgroundResource(R.drawable.shape_scale_cell)
val normal = ContextCompat.getColor(holder.b.root.context, R.color.home_title)
val sub = ContextCompat.getColor(holder.b.root.context, R.color.home_sub_title)
val black = ContextCompat.getColor(holder.b.root.context, R.color.black)
holder.b.tvAddress.setTextColor(sub)
holder.b.tvName.setTextColor(sub)
holder.b.tvName.setTextColor(black)
holder.b.tvWeight.setTextColor(normal)
holder.b.tvState.setTextColor(sub)
}
@@ -6,6 +6,7 @@ import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.shuwei.dish.match.databinding.ItemSeasoningWeightBinding
import com.shuwei.dish.match.utils.ext.roundedDecimalPlace
/**
* 调料使用重量列表 Adapter
@@ -50,7 +51,8 @@ class SeasoningWeightAdapter : BaseQuickAdapter<SeasoningWeightAdapter.Item, Sea
override fun onBindViewHolder(holder: VH, position: Int, item: Item?) {
item ?: return
holder.binding.tvSeasoningName.text = item.goodsName
holder.binding.tvSeasoningWeight.text = "${item.useWeight}g"
val showWeight = "${item.useWeight.roundedDecimalPlace(1)}g"
holder.binding.tvSeasoningWeight.text = showWeight
}
inner class VH(var binding: ItemSeasoningWeightBinding) : QuickViewHolder(binding.root)
@@ -134,14 +134,3 @@ open class CommonDialog(
}
}
}
open class SafeDialog(activity: Activity, @StyleRes themeResId: Int) :
Dialog(activity, themeResId) {
private val weakContext = WeakReference(activity)
override fun show() {
weakContext.get()?.let {
if (!it.isFinishing && !it.isDestroyed) super.show()
}
}
}
@@ -40,12 +40,24 @@ class FoodSearchDialog(
) : BottomSheetDialog(activity, R.style.BottomSheet) {
private val binding = DialogFoodSearchBinding.inflate(LayoutInflater.from(activity))
private val list = mutableListOf<CookFoodGoodsEntity>()
private val list = mutableListOf<CookFoodGoodsEntity>().apply {
add(CookFoodGoodsEntity(goodsId = "200001", goodsName = "土豆丝"))
add(CookFoodGoodsEntity(goodsId = "200002", goodsName = "土豆片"))
add(CookFoodGoodsEntity(goodsId = "200003", goodsName = "土豆丁"))
add(CookFoodGoodsEntity(goodsId = "200004", goodsName = "胡萝卜丝"))
add(CookFoodGoodsEntity(goodsId = "200005", goodsName = "胡萝卜片"))
add(CookFoodGoodsEntity(goodsId = "200006", goodsName = "胡萝卜丁"))
add(CookFoodGoodsEntity(goodsId = "200007", goodsName = "黄瓜丝"))
add(CookFoodGoodsEntity(goodsId = "200008", goodsName = "黄瓜片"))
add(CookFoodGoodsEntity(goodsId = "200009", goodsName = "黄瓜丁"))
add(CookFoodGoodsEntity(goodsId = "200010", goodsName = "洋葱丝"))
add(CookFoodGoodsEntity(goodsId = "200011", goodsName = "洋葱丁"))
}
private val adapter = GoodsInfoSearchAdapter(list).apply {
setOnItemClickListener { _, _, position ->
list[position].isClicked = true
notifyItemChanged(position)
Handler(Looper.getMainLooper()).postDelayed({
binding.root.postDelayed({
onItemSelected(list[position])
dismiss()
}, 300)
@@ -18,6 +18,8 @@ import com.shuwei.dish.match.utils.ext.clickWithDebounce
import com.shuwei.dish.match.utils.ext.gone
import com.shuwei.dish.match.utils.ext.visible
import androidx.core.net.toUri
import androidx.core.view.updateLayoutParams
import com.shuwei.dish.match.utils.ext.dp
/**
* 食材识别结果页面
@@ -134,6 +136,7 @@ class FoodRecognizeActivity : BaseActivity() {
initData()
initRecyclerView()
updateRvParentLayoutHeight()
initClickListeners()
onBackPressedDispatcher.addCallback(this) {
@@ -187,6 +190,15 @@ class FoodRecognizeActivity : BaseActivity() {
updateListVisibility()
}
/**
* 更新RecyclerView父布局高度
*/
private fun updateRvParentLayoutHeight() {
binding.flListContainer.updateLayoutParams {
height = if (adapter.items.size > 2) 260.dp else 130.dp
}
}
/**
* 根据列表是否有数据控制 RecyclerView 显隐
*/
@@ -249,10 +261,10 @@ class FoodRecognizeActivity : BaseActivity() {
private fun initClickListeners() {
// 更换食材:打开食材搜索弹窗
binding.btnChangeFood.clickWithDebounce {
val currentName = list.getOrNull(selectedPosition)?.goodsName
// val currentName = list.getOrNull(selectedPosition)?.goodsName
FoodSearchDialog(
activity = this,
defGoodsName = currentName,
// defGoodsName = currentName,
onItemSelected = { item -> updateSelectedFood(item) }
).show()
}
@@ -276,6 +288,7 @@ class FoodRecognizeActivity : BaseActivity() {
selectedPosition = 0
}
adapter.notifyDataSetChanged()
updateRvParentLayoutHeight()
binding.tvSelectedFood.text = item.goodsName ?: "-"
updateListVisibility()
binding.recyclerView.post { updateScrollIndicator() }
@@ -2,13 +2,10 @@ package com.shuwei.dish.match.ui
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.os.SystemClock
import android.view.KeyEvent
import android.view.animation.RotateAnimation
import androidx.activity.addCallback
import androidx.core.graphics.toColorInt
import androidx.lifecycle.lifecycleScope
import com.shuwei.dish.match.base.BaseActivity
import com.shuwei.dish.match.base.BaseApp
@@ -21,7 +18,6 @@ import com.shuwei.dish.match.utils.AddressUtil
import com.shuwei.dish.match.utils.AppUtil
import com.shuwei.dish.match.utils.NetworkUtils
import com.shuwei.dish.match.utils.SpTool
import com.shuwei.dish.match.utils.Weigher2
import com.shuwei.dish.match.utils.WeightUtil
import com.shuwei.dish.match.utils.ext.gone
import com.shuwei.dish.match.utils.ext.startActivity
@@ -40,6 +40,8 @@ class SeasoningConfigFragment : BaseFragment<FragmentSeasoningConfigBinding>() {
/** 高亮自动恢复时间(毫秒) */
private const val HIGHLIGHT_DURATION_MS = 5_000L
private const val RV_LEFT_RIGHT_SPACE = 10
}
override fun inflateBinding(
@@ -54,7 +56,7 @@ class SeasoningConfigFragment : BaseFragment<FragmentSeasoningConfigBinding>() {
private val adapter18 by lazy {
Seasoning18GridAdapter(
showNameOnly = true,
leftRightSpace = 20.dp
leftRightSpace = 1.dp * RV_LEFT_RIGHT_SPACE
)
}
@@ -245,7 +247,7 @@ class SeasoningConfigFragment : BaseFragment<FragmentSeasoningConfigBinding>() {
// }
private val size by lazy { SizeTool.getFlexLayoutSize(20.dp) }
private val size by lazy { SizeTool.getFlexLayoutSize(1.dp * RV_LEFT_RIGHT_SPACE) }
/** 构建上层(22格)Adapter,需要先计算格子尺寸 */
private fun buildAdapter22(): Seasoning22GridAdapter {
+52
View File
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="240dp"
android:height="240dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<!-- 由小到大排列的圆点,构成旋转加载指示器 -->
<path
android:fillColor="#262626"
android:pathData="M876.864,782.592c3.264,0 6.272,-3.2 6.272,-6.656c0,-3.456 -3.008,-6.592 -6.272,-6.592c-3.264,0 -6.272,3.2 -6.272,6.592c0,3.456 3.008,6.656 6.272,6.656z" />
<path
android:fillColor="#262626"
android:pathData="M736.32,935.936c2.304,2.432 5.568,3.84 8.768,3.84a12.16,12.16 0,0 0,8.832 -3.84a13.76,13.76 0,0 0,0 -18.56a12.224,12.224 0,0 0,-8.832 -3.84a12.16,12.16 0,0 0,-8.768 3.84a13.696,13.696 0,0 0,0 18.56z" />
<path
android:fillColor="#262626"
android:pathData="M552.32,1018.24c3.456,3.648 8.32,5.76 13.184,5.76a18.368,18.368 0,0 0,13.184 -5.76a20.608,20.608 0,0 0,0 -27.968a18.368,18.368 0,0 0,-13.184 -5.824a18.368,18.368 0,0 0,-13.184 5.76a20.608,20.608 0,0 0,0 28.032z" />
<path
android:fillColor="#262626"
android:pathData="M353.984,1012.48c4.608,4.8 11.072,7.68 17.6,7.68a24.448,24.448 0,0 0,17.536 -7.68a27.456,27.456 0,0 0,0 -37.248a24.448,24.448 0,0 0,-17.536 -7.68a24.448,24.448 0,0 0,-17.6 7.68a27.52,27.52 0,0 0,0 37.184z" />
<path
android:fillColor="#262626"
android:pathData="M178.304,920.64c5.76,6.08 13.824,9.6 21.952,9.6a30.592,30.592 0,0 0,22.016 -9.6a34.368,34.368 0,0 0,0 -46.592a30.592,30.592 0,0 0,-22.016 -9.6a30.592,30.592 0,0 0,-21.952 9.6a34.368,34.368 0,0 0,0 46.592z" />
<path
android:fillColor="#262626"
android:pathData="M57.152,761.28c6.912,7.36 16.64,11.648 26.368,11.648a36.736,36.736 0,0 0,26.432 -11.584a41.28,41.28 0,0 0,0 -55.936a36.736,36.736 0,0 0,-26.432 -11.584a36.8,36.8 0,0 0,-26.368 11.52a41.28,41.28 0,0 0,0 56z" />
<path
android:fillColor="#262626"
android:pathData="M12.736,564.672a42.88,42.88 0,0 0,30.784 13.44a42.88,42.88 0,0 0,30.784 -13.44a48.128,48.128 0,0 0,0 -65.216a42.88,42.88 0,0 0,-30.72 -13.44a42.88,42.88 0,0 0,-30.848 13.44a48.128,48.128 0,0 0,0 65.216z" />
<path
android:fillColor="#262626"
android:pathData="M52.544,369.28a48.96,48.96 0,0 0,35.2 15.36a48.96,48.96 0,0 0,35.2 -15.36a54.976,54.976 0,0 0,0 -74.56a48.96,48.96 0,0 0,-35.2 -15.424a48.96,48.96 0,0 0,-35.2 15.424a54.976,54.976 0,0 0,0 74.56z" />
<path
android:fillColor="#262626"
android:pathData="M168.32,212.48c10.368,11.008 24.96,17.408 39.68,17.408c14.592,0 29.184,-6.4 39.552,-17.408a61.888,61.888 0,0 0,0 -83.84a55.104,55.104 0,0 0,-39.616 -17.408c-14.656,0 -29.248,6.4 -39.616,17.408a61.888,61.888 0,0 0,0 83.84z" />
<path
android:fillColor="#262626"
android:pathData="M337.344,124.8c11.52,12.16 27.712,19.264 43.968,19.264c16.256,0 32.448,-7.04 43.968,-19.264a68.672,68.672 0,0 0,0 -93.184a61.248,61.248 0,0 0,-43.968 -19.264a61.248,61.248 0,0 0,-43.968 19.264a68.736,68.736 0,0 0,0 93.184z" />
<path
android:fillColor="#262626"
android:pathData="M526.976,123.712c12.672,13.44 30.528,21.248 48.448,21.248s35.712,-7.808 48.384,-21.248a75.584,75.584 0,0 0,0 -102.464A67.392,67.392 0,0 0,575.36 0c-17.92,0 -35.776,7.808 -48.448,21.248a75.584,75.584 0,0 0,0 102.464z" />
<path
android:fillColor="#262626"
android:pathData="M700.8,210.304c13.824,14.592 33.28,23.104 52.736,23.104c19.584,0 39.04,-8.512 52.8,-23.104a82.432,82.432 0,0 0,0 -111.744a73.472,73.472 0,0 0,-52.8 -23.168c-19.52,0 -38.912,8.512 -52.736,23.168a82.432,82.432 0,0 0,0 111.744z" />
<path
android:fillColor="#262626"
android:pathData="M824.832,368.832c14.976,15.872 36.032,25.088 57.216,25.088c21.12,0 42.24,-9.216 57.152,-25.088a89.344,89.344 0,0 0,0 -121.088a79.616,79.616 0,0 0,-57.152 -25.088c-21.184,0 -42.24,9.216 -57.216,25.088a89.344,89.344 0,0 0,0 121.088z" />
<path
android:fillColor="#262626"
android:pathData="M875.264,572.864c16.128,17.088 38.784,27.008 61.632,27.008c22.784,0 45.44,-9.92 61.568,-27.008a96.256,96.256 0,0 0,0 -130.432a85.76,85.76 0,0 0,-61.568 -27.072c-22.848,0 -45.44,9.984 -61.632,27.072a96.192,96.192 0,0 0,0 130.432z" />
</vector>
@@ -2,7 +2,7 @@
<!-- 秤格子背景:白色底 + 灰色描边 + 圆角,与页面蓝色背景形成对比 -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/gray_d6" />
@@ -45,8 +45,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvCollectedFood"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:overScrollMode="never"
tools:itemCount="5"
tools:listitem="@layout/list_item_collected_food" />
@@ -5,7 +5,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:paddingHorizontal="16dp"
android:paddingBottom="16dp"
tools:background="@color/white">
<!-- 食材照片,权重占满剩余空间 -->
@@ -15,7 +16,7 @@
android:layout_weight="1"
app:cardBackgroundColor="@color/white"
app:cardElevation="0dp"
app:cardCornerRadius="8dp">
app:cardCornerRadius="12dp">
<ImageView
android:id="@+id/ivFoodPhoto"
@@ -44,6 +45,7 @@
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:itemCount="4"
android:background="@drawable/shape_white_12_corners"
tools:listitem="@layout/list_item_search_goods_info"
tools:visibility="visible" />
@@ -53,6 +55,7 @@
android:layout_height="match_parent"
android:layout_gravity="end|top"
android:layout_marginEnd="2dp"
android:layout_marginVertical="5dp"
android:background="@drawable/scrollbar_track_food_recognize"
android:visibility="gone" />
@@ -61,19 +64,29 @@
android:layout_width="6dp"
android:layout_height="24dp"
android:layout_gravity="end|top"
android:layout_marginTop="5dp"
android:layout_marginEnd="1dp"
android:background="@drawable/scrollbar_thumb_food_recognize"
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@drawable/shape_white_12_corners"
android:orientation="vertical">
<!-- 选中的食材名称 -->
<TextView
android:id="@+id/tvSelectedFood"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginTop="12dp"
android:layout_marginHorizontal="15dp"
android:gravity="center"
android:text="-"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/black333"
android:textSize="32sp" />
@@ -82,7 +95,7 @@
android:id="@+id/tvWeight"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginTop="8dp"
android:layout_marginHorizontal="15dp"
android:background="@drawable/shape_white_12_corners"
android:gravity="center"
android:text="0.0 g"
@@ -95,6 +108,7 @@
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginTop="30dp"
android:layout_marginHorizontal="15dp"
android:background="@drawable/shape_green_bg"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
@@ -108,8 +122,8 @@
android:id="@+id/btnCancel"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:layout_marginVertical="30dp"
android:layout_marginHorizontal="15dp"
android:background="@drawable/shape_white_12_corners"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
@@ -118,5 +132,6 @@
android:textSize="32sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
+3 -3
View File
@@ -75,9 +75,9 @@
<!-- 加载动画 -->
<ImageView
android:id="@+id/ivLoading"
android:layout_width="160dp"
android:layout_height="160dp"
android:src="@drawable/loading_spinner"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@drawable/loading"
android:contentDescription="加载中" />
<!-- 倒计时文字 -->
@@ -67,7 +67,7 @@
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="700dp"
android:layout_marginTop="10dp"
app:srlEnableOverScrollDrag="false">
@@ -1,43 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:paddingBottom="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_white_30_corners"
android:orientation="vertical">
android:orientation="vertical"
android:paddingHorizontal="5dp"
tools:background="@color/bg_color">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="106dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:background="@drawable/bg_bottom_line">
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:text="调料区设置"
android:textColor="@color/black"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_gravity="center"
android:text="点击分格配置调料"
android:textColor="@color/gray_b4"
android:textSize="28sp" />
android:includeFontPadding="false"
android:textColor="@color/white"
android:textSize="20sp" />
</FrameLayout>
<TextView
@@ -45,7 +26,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="6dp"
android:layout_marginBottom="12dp"
android:text="上层调料区"
android:textColor="@color/home_title"
android:textSize="28sp"
@@ -62,7 +43,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="6dp"
android:layout_marginBottom="12dp"
android:text="下层调料区"
android:textColor="@color/home_title"
android:textSize="28sp"
@@ -79,7 +60,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="6dp"
android:layout_marginBottom="12dp"
android:text="油盆配置区"
android:textColor="@color/home_title"
android:textSize="28sp"
@@ -92,12 +73,11 @@
android:layout_marginHorizontal="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_scale_cell"
android:clipToOutline="true"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="-"
android:foreground="?android:attr/selectableItemBackground"
android:clipToOutline="true"
android:textColor="@color/home_title"
android:textSize="28sp" />
</LinearLayout>
</LinearLayout>
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp"
android:background="@drawable/shape_scale_cell"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@drawable/shape_scale_cell"
android:paddingHorizontal="16dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp">
android:paddingHorizontal="16dp">
<TextView
android:id="@+id/tvSeasoningName"
@@ -16,15 +17,19 @@
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black666"
android:textSize="24sp" />
android:textColor="@color/black"
android:textSize="24sp"
android:textStyle="bold"
tools:text="土豆丝" />
<TextView
android:id="@+id/tvSeasoningWeight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:textColor="@color/black"
android:textSize="24sp" />
android:textColor="@color/dish_green"
android:textSize="26sp"
android:textStyle="bold"
tools:text="100g" />
</LinearLayout>
@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:background="@color/white"
android:orientation="vertical">
@@ -11,7 +12,6 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="32dp"
android:paddingVertical="24dp">
<!-- 食材名称和采集数量 -->
@@ -19,6 +19,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="64dp"
android:orientation="vertical">
<TextView
@@ -43,18 +44,19 @@
<!-- 删除按钮 -->
<ImageView
android:id="@+id/ivDelete"
android:layout_width="100dp"
android:layout_height="100dp"
android:padding="25dp"
android:layout_width="110dp"
android:layout_height="110dp"
android:padding="32dp"
android:layout_marginEnd="32dp"
android:src="@drawable/ic_close_red"
tools:ignore="ContentDescription" />
</LinearLayout>
<!-- 分割线 -->
<View
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="32dp"
android:background="#FFE8EDF2" />
android:layout_marginHorizontal="64dp"
app:dividerColor="#FFE8EDF2" />
</LinearLayout>
@@ -25,7 +25,8 @@
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/home_sub_title" />
android:textColor="@color/black"
android:textStyle="bold"/>
<TextView
android:id="@+id/tvWeight"
@@ -33,8 +34,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/home_title"
android:textStyle="bold" />
android:textColor="@color/home_title"/>
<TextView
android:id="@+id/tvState"
@@ -18,7 +18,7 @@
android:id="@+id/tvScaleLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/home_sub_title"
android:textColor="@color/black"
android:textSize="18sp"
tools:text="秤 1" />
@@ -26,8 +26,9 @@
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/home_sub_title"
android:textSize="22sp"
android:textColor="@color/black"
android:textSize="26sp"
android:textStyle="bold"
android:text="-" />
<!-- 重量 -->
@@ -37,8 +38,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/home_title"
android:textSize="26sp"
android:textStyle="bold"
android:textSize="22sp"
tools:text="235.5 g" />
<!-- 状态 -->
+4 -4
View File
@@ -51,17 +51,17 @@
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22sp"
android:textSize="26sp"
android:textStyle="bold"
android:includeFontPadding="false"
android:textColor="@color/home_sub_title"
android:textColor="@color/black"
android:text="-" />
<TextView
android:id="@+id/tvWeight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="26sp"
android:textStyle="bold"
android:textSize="22sp"
android:includeFontPadding="false"
android:layout_marginVertical="5dp"
android:textColor="@color/home_title"
+2 -2
View File
@@ -5,8 +5,8 @@
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="black">#000000</color>
<color name="white">#FFFFFF</color>
<color name="bg_color">#F0F5FF</color>
<color name="home_title">#FF000A2D</color>