style(layout): 优化布局文件结构和属性配置
- 统一调整了 activity_setting.xml 中各个 LinearLayout 的属性顺序 - 为 fragment_seasoning_config.xml 和 fragment_vector_collection.xml 添加了工具忽略属性 - 重新排列了 list_item_scale22_row.xml 和 list_item_scale_row.xml 的命名空间和属性顺序 - 在 list_type_scale1.xml 中调整了组件的布局属性顺序 - 为设置页面添加了数据库查看和秤数据监控功能的可见性控制 - 修复了布局文件中的硬编码文本警告问题
This commit is contained in:
@@ -46,7 +46,8 @@ class SettingActivity : BaseActivity() {
|
||||
}, rightIconActon = {
|
||||
it.visible()
|
||||
it.clickWithDebounce {
|
||||
startActivity<MasterScaleActivity>()
|
||||
binding.llDbInspect.visible()
|
||||
binding.llScaleObserve.visible()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -79,6 +80,9 @@ class SettingActivity : BaseActivity() {
|
||||
binding.llDbInspect.clickWithDebounce {
|
||||
SingleFragmentActivity.start(this, SingleFragmentActivity.PageType.DB_INSPECT)
|
||||
}
|
||||
binding.llScaleObserve.clickWithDebounce {
|
||||
startActivity<MasterScaleActivity>()
|
||||
}
|
||||
}
|
||||
|
||||
private fun openCollectPage() {
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
<?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"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/bg_color"
|
||||
android:orientation="vertical">
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llCookMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="30dp"
|
||||
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:clipToOutline="true">
|
||||
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"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black333" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentMode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="当前:制作模式"
|
||||
android:textSize="26sp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black999" />
|
||||
android:textColor="@color/black999"
|
||||
android:textSize="26sp"
|
||||
tools:text="当前:制作模式" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
@@ -51,23 +51,23 @@
|
||||
android:id="@+id/llSeasoningConfig"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
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:clipToOutline="true">
|
||||
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"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black333" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
@@ -82,23 +82,23 @@
|
||||
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="50dp"
|
||||
android:background="@drawable/shape_white_dc_15_corners"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:clipToOutline="true">
|
||||
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"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/black333" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
@@ -113,23 +113,56 @@
|
||||
android:id="@+id/llDbInspect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
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:clipToOutline="true">
|
||||
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"
|
||||
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:textColor="@color/black333" />
|
||||
android:layout_weight="1"
|
||||
android:text="秤数据监控"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="5dp"
|
||||
tools:background="@color/bg_color">
|
||||
tools:background="@color/bg_color"
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 单个秤格子:秤地址 + 调料名 + 重量 + 状态 -->
|
||||
<?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="wrap_content"
|
||||
android:background="@drawable/shape_scale_cell"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="4dp"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/shape_scale_cell"
|
||||
android:clipToOutline="true">
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAddress"
|
||||
@@ -26,7 +27,7 @@
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWeight"
|
||||
@@ -34,7 +35,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/home_title"/>
|
||||
android:textColor="@color/home_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvState"
|
||||
|
||||
@@ -3,15 +3,16 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="340dp"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/shape_scale_cell"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:clipToOutline="true">
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<!-- 秤编号 -->
|
||||
<TextView
|
||||
@@ -26,10 +27,10 @@
|
||||
android:id="@+id/tvName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold"
|
||||
android:text="-" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 重量 -->
|
||||
<TextView
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 1个秤设备的卡片布局 -->
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- 1个秤设备的卡片布局 -->
|
||||
<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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="10dp">
|
||||
android:paddingTop="10dp"
|
||||
tools:ignore="HardcodedText,UnusedAttribute">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDeviceIp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/home_title"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="IP:192.168.1.100" />
|
||||
|
||||
<TextView
|
||||
@@ -30,58 +30,58 @@
|
||||
android:id="@+id/llScaleContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:background="@drawable/shape_scale_cell"
|
||||
android:clipToOutline="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/shape_scale_cell">
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAddr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/home_sub_title"
|
||||
android:textSize="18sp"
|
||||
tools:text="秤 1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
android:text="-"
|
||||
android:textColor="@color/black"
|
||||
android:text="-" />
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWeight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="22sp"
|
||||
android:includeFontPadding="false"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/home_title"
|
||||
android:textSize="22sp"
|
||||
tools:text="100.0 g" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvState"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/home_sub_title"
|
||||
android:textSize="18sp"
|
||||
tools:text="稳定" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <com.google.android.material.divider.MaterialDivider-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:background="@color/gray_eb"-->
|
||||
<!-- android:layout_marginTop="10dp" />-->
|
||||
<!-- <com.google.android.material.divider.MaterialDivider-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:background="@color/gray_eb"-->
|
||||
<!-- android:layout_marginTop="10dp" />-->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user