feat: opt layout

This commit is contained in:
2025-12-12 10:39:45 +08:00
parent 82fc593497
commit 48abc944f0
2 changed files with 91 additions and 78 deletions

View File

@@ -123,12 +123,12 @@
<!-- 黄色标题栏 -->
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="36dp"
android:background="@drawable/bg_shouyun_dbcz"
android:gravity="center"
android:text="地磅称重"
android:textColor="@color/black"
android:textSize="20sp"
android:textSize="18sp"
android:textStyle="bold" />
<!-- 青色重量显示区域 -->
@@ -136,8 +136,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_shouyun_dbzl"
android:minHeight="150dp"
android:padding="8dp">
android:minHeight="60dp">
<TextView
android:id="@+id/tvWeight"

View File

@@ -3,9 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
<variable
name="viewModel"
type="com.lukouguoji.gjc.viewModel.IntExpAssembleStartViewModel" />
@@ -33,30 +37,27 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical">
<!-- 搜索框 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
hint='@{"请输入搜索内容"}'
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.searchText}" />
<!-- 组装信息和组装位置卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:padding="8dp">
android:layout_weight="3"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical">
<!-- 搜索框 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
hint='@{"请输入搜索内容"}'
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.searchText}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp" />
<!-- 组装信息标题 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:text="组装信息"
android:textColor="@color/text_normal"
android:textSize="16sp"
@@ -74,13 +75,25 @@
android:id="@+id/rv_assemble_info"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.6"
android:layout_marginBottom="16dp" />
android:layout_marginHorizontal="8dp"
android:layout_marginBottom="16dp"
android:layout_weight="0.6" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_weight="2"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="8dp">
<!-- 组装位置标题 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:text="组装位置"
android:textColor="@color/text_normal"
android:textSize="16sp"
@@ -98,41 +111,42 @@
android:id="@+id/rv_assemble_position"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="8dp"
android:layout_weight="0.4" />
</LinearLayout>
</LinearLayout>
<!-- ========== 右侧区域70%========== -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_weight="0.7"
android:layout_marginStart="10dp"
android:orientation="vertical">
<!-- 运单列表 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4"
android:layout_marginBottom="8dp"
android:layout_weight="0.4"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingHorizontal="8dp">
android:orientation="vertical">
<!-- 搜索框 -->
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
android:id="@+id/tvWbSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
hint='@{"请输入搜索内容"}'
icon="@{@drawable/img_search}"
setOnSearchListener="@{viewModel::loadWaitingAssembleWaybills}"
setSearchIconClickListener="@{viewModel::loadWaitingAssembleWaybills}"
type="@{SearchLayoutType.INPUT}"
value="@={viewModel.searchText}"
icon="@{@drawable/img_search}"
setSearchIconClickListener="@{viewModel::loadWaitingAssembleWaybills}"
setOnSearchListener="@{viewModel::loadWaitingAssembleWaybills}" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp" />
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
@@ -143,9 +157,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:orientation="horizontal"
android:background="@color/color_f2"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="8dp">
<!-- 序号 -->
@@ -160,8 +174,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="运单号"
android:gravity="center"
android:text="运单号"
android:textColor="@color/text_normal"
android:textSize="13sp" />
@@ -169,29 +183,29 @@
<TextView
android:layout_width="120dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="件数"
android:textColor="@color/text_normal"
android:textSize="13sp"
android:gravity="center" />
android:textSize="13sp" />
<!-- 重量 -->
<TextView
android:layout_width="120dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="重量"
android:textColor="@color/text_normal"
android:textSize="13sp"
android:gravity="center" />
android:textSize="13sp" />
<!-- 配载航班 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center"
android:text="配载航班"
android:textColor="@color/text_normal"
android:textSize="13sp"
android:gravity="center" />
android:textSize="13sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
@@ -232,36 +246,36 @@
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
required="@{false}"
title='@{"ULD编号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.uldInfo.uldNo}" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
value="@={viewModel.uldInfo.uldNo}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{true}"
title='@{"耗材重量:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.uldInfo.materialWeight}" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
value="@={viewModel.uldInfo.materialWeight}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
required="@{false}"
title='@{"ULD状态"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.uldInfo.uldStatus}" />
value="@={viewModel.uldInfo.uldStatus}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
@@ -295,37 +309,37 @@
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
required="@{false}"
title='@{"运单号:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.waybillInfo.waybillNo}" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
value="@={viewModel.waybillInfo.waybillNo}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
required="@{false}"
title='@{"运单件数:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.waybillInfo.waybillPieces}" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
value="@={viewModel.waybillInfo.waybillPieces}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
required="@{false}"
title='@{"运单重量:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.waybillInfo.waybillWeight}" />
value="@={viewModel.waybillInfo.waybillWeight}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
@@ -335,36 +349,36 @@
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{true}"
required="@{false}"
title='@{"组装件数:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.waybillInfo.assembleCount}" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
value="@={viewModel.waybillInfo.assembleCount}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{true}"
title='@{"组装重量:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.waybillInfo.assembleWeight}" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
value="@={viewModel.waybillInfo.assembleWeight}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
required="@{false}"
title='@{"操作人:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value="@={viewModel.waybillInfo.operator}" />
value="@={viewModel.waybillInfo.operator}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
@@ -373,8 +387,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:gravity="center"
android:layout_marginTop="8dp"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="16dp">