fix(ui): 修复调料列表布局切换功能
- 将布局容器从 LinearLayout 改为 FrameLayout 以支持更好的定位控制 - 调整标题文本的尺寸和对齐方式,设置固定高度 50dp - 更新切换按钮的内边距并调整其在父容器中的位置 - 更改切换按钮的图标资源名称从 ic_switch_box 为 ic_layout_list - 优化布局切换逻辑,图标始终显示目标布局样式 - 在切换时动态更新按钮图标以反映当前布局模式
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
android:background="@drawable/shape_white_30_corners"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="22dp"
|
||||
@@ -26,11 +26,11 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:text="@string/seasoning"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="start"
|
||||
android:textColor="@color/black666"
|
||||
android:textSize="28sp" />
|
||||
|
||||
@@ -38,12 +38,13 @@
|
||||
android:id="@+id/ivSeasoningLayoutToggle"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:layout_gravity="end"
|
||||
android:contentDescription="切换布局"
|
||||
android:src="@drawable/ic_switch_box"
|
||||
android:src="@drawable/ic_layout_list"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless" />
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvSeasoning"
|
||||
|
||||
Reference in New Issue
Block a user