feat: ui opt
This commit is contained in:
@@ -18,4 +18,18 @@ data class GjcCheckInRecord(
|
|||||||
var weight: Double = 0.0, // 运抵重量
|
var weight: Double = 0.0, // 运抵重量
|
||||||
var volume: Double = 0.0, // 运抵体积
|
var volume: Double = 0.0, // 运抵体积
|
||||||
var whId: Long = 0 // GJC_WAREHOUSE.ID
|
var whId: Long = 0 // GJC_WAREHOUSE.ID
|
||||||
)
|
) {
|
||||||
|
// 件数的字符串表示(用于双向绑定)
|
||||||
|
var pcStr: String
|
||||||
|
get() = if (pc == 0L) "" else pc.toString()
|
||||||
|
set(value) {
|
||||||
|
pc = value.toLongOrNull() ?: 0L
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重量的字符串表示(用于双向绑定)
|
||||||
|
var weightStr: String
|
||||||
|
get() = if (weight == 0.0) "" else weight.toString()
|
||||||
|
set(value) {
|
||||||
|
weight = value.toDoubleOrNull() ?: 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -119,6 +119,12 @@ class PadDataLayoutNew : FrameLayout {
|
|||||||
loadImage(iv, value)
|
loadImage(iv, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var inputType: Int = android.text.InputType.TYPE_CLASS_TEXT
|
||||||
|
set(value) {
|
||||||
|
field = value
|
||||||
|
et.inputType = value
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新事件回调
|
* 刷新事件回调
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.lukouguoji.gjc.holder
|
package com.lukouguoji.gjc.holder
|
||||||
|
|
||||||
import android.text.Editable
|
|
||||||
import android.text.TextWatcher
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.lukouguoji.gjc.databinding.ItemGjcCheckInRecordBinding
|
import com.lukouguoji.gjc.databinding.ItemGjcCheckInRecordBinding
|
||||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
@@ -14,8 +12,6 @@ class GjcCheckInRecordViewHolder(view: View) :
|
|||||||
BaseViewHolder<GjcCheckInRecord, ItemGjcCheckInRecordBinding>(view) {
|
BaseViewHolder<GjcCheckInRecord, ItemGjcCheckInRecordBinding>(view) {
|
||||||
|
|
||||||
private var isEditMode: Boolean = false
|
private var isEditMode: Boolean = false
|
||||||
private var pcTextWatcher: TextWatcher? = null
|
|
||||||
private var weightTextWatcher: TextWatcher? = null
|
|
||||||
|
|
||||||
fun updateEditMode(editMode: Boolean) {
|
fun updateEditMode(editMode: Boolean) {
|
||||||
this.isEditMode = editMode
|
this.isEditMode = editMode
|
||||||
@@ -26,32 +22,6 @@ class GjcCheckInRecordViewHolder(view: View) :
|
|||||||
binding.record = record
|
binding.record = record
|
||||||
binding.isEditMode = isEditMode
|
binding.isEditMode = isEditMode
|
||||||
binding.position = position // 传入位置用于显示序号
|
binding.position = position // 传入位置用于显示序号
|
||||||
|
|
||||||
// 移除旧的监听器
|
|
||||||
pcTextWatcher?.let { binding.etPc.removeTextChangedListener(it) }
|
|
||||||
weightTextWatcher?.let { binding.etWeight.removeTextChangedListener(it) }
|
|
||||||
|
|
||||||
// 在编辑模式下监听EditText输入
|
|
||||||
if (isEditMode) {
|
|
||||||
pcTextWatcher = object : TextWatcher {
|
|
||||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
|
|
||||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
|
||||||
override fun afterTextChanged(s: Editable?) {
|
|
||||||
record.pc = s?.toString()?.toLongOrNull() ?: 0L
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.etPc.addTextChangedListener(pcTextWatcher)
|
|
||||||
|
|
||||||
weightTextWatcher = object : TextWatcher {
|
|
||||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
|
|
||||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
|
||||||
override fun afterTextChanged(s: Editable?) {
|
|
||||||
record.weight = s?.toString()?.toDoubleOrNull() ?: 0.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.etWeight.addTextChangedListener(weightTextWatcher)
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,145 +22,205 @@
|
|||||||
|
|
||||||
<include layout="@layout/title_tool_bar" />
|
<include layout="@layout/title_tool_bar" />
|
||||||
|
|
||||||
<!-- 第一部分:运单信息区域 -->
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="15dp"
|
android:layout_margin="15dp"
|
||||||
android:background="@drawable/bg_white_radius_8"
|
android:background="@drawable/bg_white_radius_8"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="15dp"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:text="运单信息"
|
||||||
|
android:textColor="@color/color_33"
|
||||||
|
android:textSize="17sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.divider.MaterialDivider
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 第一部分:运单信息区域 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="15dp">
|
||||||
|
|
||||||
|
<!-- 运单号 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="运单号:"
|
||||||
|
android:textColor="@color/text_gray"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.waybillNo}"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 预配件数 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="预配件数:"
|
||||||
|
android:textColor="@color/text_gray"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.prePc}"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 预配重量 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="预配重量:"
|
||||||
|
android:textColor="@color/text_gray"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.preWeight}"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 品名(中) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="品名(中):"
|
||||||
|
android:textColor="@color/text_gray"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.goodsName}"
|
||||||
|
android:textColor="@color/text_normal"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginHorizontal="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_white_radius_8"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="15dp"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:text="称重信息"
|
||||||
|
android:textColor="@color/color_33"
|
||||||
|
android:textSize="17sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.divider.MaterialDivider
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
|
<!-- 第二部分:计重记录列表 -->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="15dp"
|
||||||
|
android:paddingEnd="15dp"
|
||||||
|
tools:listitem="@layout/item_gjc_check_in_record" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 取消+保存按钮组(编辑模式,居中) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginHorizontal="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="15dp">
|
android:visibility="@{viewModel.isEditMode ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
<!-- 运单号 -->
|
<!-- 取消按钮 -->
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:id="@+id/btnCancel"
|
||||||
android:layout_height="wrap_content"
|
style="@style/tv_bottom_btn"
|
||||||
android:layout_weight="1"
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="horizontal">
|
android:onClick="@{() -> viewModel.onCancelClick()}"
|
||||||
|
android:text="取消" />
|
||||||
|
|
||||||
<TextView
|
<!-- 保存按钮 -->
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/btnSave"
|
||||||
android:text="运单号:"
|
style="@style/tv_bottom_btn"
|
||||||
android:textColor="@color/text_gray"
|
android:onClick="@{() -> viewModel.onSaveClick()}"
|
||||||
android:textSize="16sp" />
|
android:text="保存" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.waybillNo}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 预配件数 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="预配件数:"
|
|
||||||
android:textColor="@color/text_gray"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.prePc}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 预配重量 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="预配重量:"
|
|
||||||
android:textColor="@color/text_gray"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.preWeight}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 品名(中) -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="品名(中):"
|
|
||||||
android:textColor="@color/text_gray"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.goodsName}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 称重信息标题 -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:text="称重信息"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<!-- 第二部分:计重记录列表 -->
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recyclerView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
tools:listitem="@layout/item_gjc_check_in_record"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:paddingEnd="15dp" />
|
|
||||||
|
|
||||||
<!-- 第三部分:底部统计与按钮区域 -->
|
<!-- 第三部分:底部统计与按钮区域 -->
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="64dp"
|
||||||
android:layout_margin="15dp"
|
android:background="@color/white"
|
||||||
android:background="@drawable/bg_white_radius_8"
|
android:gravity="center_vertical"
|
||||||
android:padding="15dp">
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="15dp">
|
||||||
|
|
||||||
<!-- 统计信息(左侧) -->
|
<!-- 统计信息(左侧) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/statsLayout"
|
android:id="@+id/statsLayout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- 总件数 -->
|
<!-- 总件数 -->
|
||||||
@@ -191,42 +251,21 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<!-- 修改按钮(只读模式,右侧) -->
|
<!-- 修改按钮(只读模式,右侧) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/btnModify"
|
android:id="@+id/btnModify"
|
||||||
style="@style/tv_bottom_btn"
|
style="@style/tv_bottom_btn"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:onClick="@{() -> viewModel.onModifyClick()}"
|
android:onClick="@{() -> viewModel.onModifyClick()}"
|
||||||
android:text="修改"
|
android:text="修改"
|
||||||
android:visibility="@{viewModel.isEditMode ? View.GONE : View.VISIBLE}" />
|
android:visibility="@{viewModel.isEditMode ? View.GONE : View.VISIBLE}" />
|
||||||
|
|
||||||
<!-- 取消+保存按钮组(编辑模式,居中) -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="@{viewModel.isEditMode ? View.VISIBLE : View.GONE}">
|
|
||||||
|
|
||||||
<!-- 取消按钮 -->
|
</LinearLayout>
|
||||||
<TextView
|
|
||||||
android:id="@+id/btnCancel"
|
|
||||||
style="@style/tv_bottom_btn"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:onClick="@{() -> viewModel.onCancelClick()}"
|
|
||||||
android:text="取消" />
|
|
||||||
|
|
||||||
<!-- 保存按钮 -->
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/btnSave"
|
|
||||||
style="@style/tv_bottom_btn"
|
|
||||||
android:onClick="@{() -> viewModel.onSaveClick()}"
|
|
||||||
android:text="保存" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<import type="com.lukouguoji.module_base.ui.weight.data.layout.DataLayoutType" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="record"
|
name="record"
|
||||||
type="com.lukouguoji.module_base.bean.GjcCheckInRecord" />
|
type="com.lukouguoji.module_base.bean.GjcCheckInRecord" />
|
||||||
@@ -39,128 +41,56 @@
|
|||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<!-- 件数字段 -->
|
<!-- 件数字段 -->
|
||||||
<LinearLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="horizontal">
|
enable="@{isEditMode}"
|
||||||
|
hint="@{`件数`}"
|
||||||
<TextView
|
inputType="@{android.text.InputType.TYPE_CLASS_NUMBER}"
|
||||||
android:layout_width="wrap_content"
|
title="@{`件数`}"
|
||||||
android:layout_height="wrap_content"
|
titleLength="@{5}"
|
||||||
android:text="件数 "
|
type="@{DataLayoutType.INPUT}"
|
||||||
android:textColor="@color/text_gray"
|
value="@={record.pcStr}" />
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<!-- 非编辑模式:TextView -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{String.valueOf(record.pc)}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="@{isEditMode ? View.GONE : View.VISIBLE}" />
|
|
||||||
|
|
||||||
<!-- 编辑模式:EditText -->
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/etPc"
|
|
||||||
android:layout_width="80dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/bg_white_radius_8"
|
|
||||||
android:hint="件数"
|
|
||||||
android:inputType="number"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:text="@{String.valueOf(record.pc)}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="@{isEditMode ? View.VISIBLE : View.GONE}" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 重量字段 -->
|
<!-- 重量字段 -->
|
||||||
<LinearLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="horizontal">
|
enable="@{isEditMode}"
|
||||||
|
hint="@{`重量`}"
|
||||||
<TextView
|
inputType="@{android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL}"
|
||||||
android:layout_width="wrap_content"
|
title="@{`重量`}"
|
||||||
android:layout_height="wrap_content"
|
titleLength="@{5}"
|
||||||
android:text="重量 "
|
type="@{DataLayoutType.INPUT}"
|
||||||
android:textColor="@color/text_gray"
|
value="@={record.weightStr}" />
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<!-- 非编辑模式:TextView -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{String.valueOf(record.weight)}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="@{isEditMode ? View.GONE : View.VISIBLE}" />
|
|
||||||
|
|
||||||
<!-- 编辑模式:EditText -->
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/etWeight"
|
|
||||||
android:layout_width="80dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/bg_white_radius_8"
|
|
||||||
android:hint="重量"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:text="@{String.valueOf(record.weight)}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="@{isEditMode ? View.VISIBLE : View.GONE}" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 托盘自重字段(只读) -->
|
<!-- 托盘自重字段(只读) -->
|
||||||
<LinearLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="horizontal">
|
enable="@{false}"
|
||||||
|
title="@{`托盘自重`}"
|
||||||
<TextView
|
titleLength="@{5}"
|
||||||
android:layout_width="wrap_content"
|
type="@{DataLayoutType.INPUT}"
|
||||||
android:layout_height="wrap_content"
|
value="@{`100`}" />
|
||||||
android:text="托盘自重 "
|
|
||||||
android:textColor="@color/text_gray"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="100"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 计重时间字段(只读) -->
|
<!-- 计重时间字段(只读) -->
|
||||||
<LinearLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_weight="1.5"
|
android:layout_weight="1.5"
|
||||||
android:orientation="horizontal">
|
enable="@{false}"
|
||||||
|
title="@{`计重时间`}"
|
||||||
<TextView
|
titleLength="@{5}"
|
||||||
android:layout_width="wrap_content"
|
type="@{DataLayoutType.INPUT}"
|
||||||
android:layout_height="wrap_content"
|
value="@{record.opDate}" />
|
||||||
android:text="计重时间 "
|
|
||||||
android:textColor="@color/text_gray"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{record.opDate}"
|
|
||||||
android:textColor="@color/text_normal"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user