refactor(ui): 将设置页面由多个 LinearLayout 重构为 RecyclerView 实现
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,328 +5,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/bg_color"
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llCookMode"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvSettings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="菜品模式"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentMode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black999"
|
||||
android:textSize="26sp"
|
||||
tools:text="当前:制作模式" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llSeasoningConfig"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="调料区设置"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llFoodCollect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="食材采集"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llDbInspect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="数据库查看"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llScaleObserve"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="秤数据监控"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llEnvSwitch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="切换环境"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llClearData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="数据清除"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llTestSeasoning"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:text="测试调料拿取"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <!– 底部导航菜单 –>-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/bottomMenu"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:background="@android:color/transparent"-->
|
||||
<!-- android:layout_marginTop="10dp"-->
|
||||
<!-- android:layout_marginBottom="10dp"-->
|
||||
<!-- android:layout_marginStart="15dp"-->
|
||||
<!-- android:layout_marginEnd="15dp"-->
|
||||
<!-- android:elevation="8dp">-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatButton-->
|
||||
<!-- android:id="@+id/btnDeviceConfig"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="70dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:text="设备切换"-->
|
||||
<!-- android:textSize="28sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:background="@android:color/transparent" />-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatButton-->
|
||||
<!-- android:id="@+id/btnSeasoningConfig"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="70dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:text="调料配置"-->
|
||||
<!-- android:textSize="26sp"-->
|
||||
<!-- android:background="@android:color/transparent" />-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatButton-->
|
||||
<!-- android:id="@+id/btnFoodCollect"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="70dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:text="采集食材"-->
|
||||
<!-- android:textSize="26sp"-->
|
||||
<!-- android:background="@android:color/transparent" />-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatButton-->
|
||||
<!-- android:id="@+id/btnScaleMonitor"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="70dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:text="秤数据监控"-->
|
||||
<!-- android:textSize="26sp"-->
|
||||
<!-- android:visibility="visible"-->
|
||||
<!-- android:background="@android:color/transparent" />-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <!– Fragment 容器 –>-->
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/fragmentContainer"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="30dp"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_setting"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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="120dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="菜品模式" />
|
||||
|
||||
<!-- 副标题,仅部分项目展示(如菜品模式的当前状态) -->
|
||||
<TextView
|
||||
android:id="@+id/tvSubtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black999"
|
||||
android:textSize="26sp"
|
||||
android:visibility="gone"
|
||||
tools:text="当前:制作模式"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right3"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user