style(ui): 更新设置页面和调料列表界面样式

- 调整设置页面布局间距和背景样式
- 更换箭头图标资源文件
- 将调料列表改为网格布局显示
- 优化调料项目卡片样式和尺寸
- 修改RecyclerView为4列网格布局
This commit is contained in:
2026-04-29 10:10:57 +08:00
parent c2fd14cb6f
commit db839fd596
5 changed files with 35 additions and 25 deletions
@@ -147,11 +147,13 @@ class SubmitFoodActivity : BaseActivity() {
}
}
/** 初始化 RecyclerView2列 GridLayoutManager */
/** 初始化 RecyclerView24列 GridLayoutManager */
private fun setupRecyclerView() {
binding.rvSeasoning.itemAnimator = null
binding.rvSeasoning.layoutManager = GridLayoutManager(this, 2)
binding.rvSeasoning.adapter = seasoningAdapter
binding.rvSeasoning.let {
it.itemAnimator = null
it.layoutManager = GridLayoutManager(this, 4, GridLayoutManager.VERTICAL, false)
it.adapter = seasoningAdapter
}
}
/**
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+9 -9
View File
@@ -13,9 +13,9 @@
android:layout_height="120dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginTop="30dp"
android:layout_marginHorizontal="32dp"
android:background="@drawable/shape_white_e6_12_corners"
android:background="@drawable/shape_white_fb_15_corners2"
android:foreground="?android:attr/selectableItemBackground"
android:clipToOutline="true">
@@ -43,7 +43,7 @@
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_right2"
android:src="@drawable/ic_arrow_right3"
tools:ignore="ContentDescription" />
</LinearLayout>
@@ -54,8 +54,8 @@
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="32dp"
android:background="@drawable/shape_white_e6_12_corners"
android:layout_marginTop="50dp"
android:background="@drawable/shape_white_fb_15_corners2"
android:foreground="?android:attr/selectableItemBackground"
android:clipToOutline="true">
@@ -74,7 +74,7 @@
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_right2"
android:src="@drawable/ic_arrow_right3"
tools:ignore="ContentDescription" />
</LinearLayout>
@@ -85,8 +85,8 @@
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="32dp"
android:background="@drawable/shape_white_e6_12_corners"
android:layout_marginTop="50dp"
android:background="@drawable/shape_white_fb_15_corners2"
android:foreground="?android:attr/selectableItemBackground"
android:clipToOutline="true">
@@ -105,7 +105,7 @@
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_right2"
android:src="@drawable/ic_arrow_right3"
tools:ignore="ContentDescription" />
</LinearLayout>
@@ -33,8 +33,14 @@
android:layout_height="660dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginHorizontal="12dp"
android:overScrollMode="never" />
android:layout_marginHorizontal="20dp"
tools:itemCount="26"
app:spanCount="4"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
tools:listitem="@layout/item_seasoning_weight"
android:overScrollMode="never"
android:scrollbars="vertical"
android:scrollbarStyle="insideInset"/>
</LinearLayout>
@@ -2,19 +2,19 @@
<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:paddingHorizontal="16dp">
android:layout_height="110dp"
android:layout_marginHorizontal="5dp"
android:layout_marginVertical="5dp"
android:paddingHorizontal="10dp"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/shape_white_fb_15_corners2">
<!-- android:background="@drawable/shape_scale_cell"-->
<TextView
android:id="@+id/tvSeasoningName"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
@@ -26,8 +26,10 @@
android:id="@+id/tvSeasoningWeight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="6dp"
android:textColor="@color/dish_green"
android:ellipsize="end"
android:maxLines="1"
android:textSize="26sp"
android:textStyle="bold"
tools:text="100g" />