refactor(setting): 重构设置页面界面和功能结构
- 将底部导航菜单替换为三个独立的功能卡片布局 - 添加餐品模式、调料区设置和食材采样功能入口 - 移除原有的Fragment容器和标签页切换逻辑 - 更新CollectFragment以使用新的SingleFragmentActivity架构 - 修改相机权限检查逻辑并添加权限拒绝提示对话框 - 简化DeviceConfigFragment和SeasoningConfigFragment的依赖导入 - 在设置页面添加当前模式显示和跳转功能 - 重构调料配置页面的日志记录和高亮逻辑
This commit is contained in:
@@ -1,77 +1,165 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:background="@color/bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 底部导航菜单 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomMenu"
|
||||
android:id="@+id/ll_cook_mode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
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">
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:background="@drawable/shape_scale_cell">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btnDeviceConfig"
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="设备切换"
|
||||
android:textSize="28sp"
|
||||
android:text="餐品模式"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@android:color/transparent" />
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black333" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btnSeasoningConfig"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_weight="1"
|
||||
android:text="调料配置"
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentMode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools: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/btnDeviceRole"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="70dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:text="设备角色:子设备"-->
|
||||
<!-- android:textSize="22sp"-->
|
||||
<!-- 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" />
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black999" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right2"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Fragment 容器 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
<LinearLayout
|
||||
android:id="@+id/llSeasoningConfig"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@drawable/shape_scale_cell">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="调料区设置"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black333" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right2"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llFoodCollect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@drawable/shape_scale_cell">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="食材采样"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black333" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_arrow_right2"
|
||||
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" />-->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user