feat: opt layout ui

This commit is contained in:
2025-11-26 11:52:40 +08:00
parent 8a30f0079a
commit a01b17dd8f
9 changed files with 748 additions and 226 deletions

View File

@@ -21,7 +21,8 @@
"Bash(xmllint:*)",
"Bash(xargs cat:*)",
"mcp__chrome-devtools__evaluate_script",
"WebSearch"
"WebSearch",
"Bash(chmod:*)"
],
"deny": [],
"ask": []

View File

@@ -152,4 +152,146 @@ fun setTextAllCaps(layout: PadDataLayout, textAllCaps: Boolean) {
} else {
layout.et.filters = emptyArray<InputFilter>()
}
}
// ========== PadDataLayoutNew BindingAdapters ==========
@BindingAdapter(
"type",
"title",
"titleLength",
"hint",
"required",
"icon",
requireAll = false
)
fun setDataLayoutDataNew(
dataLayout: PadDataLayoutNew,
type: DataLayoutType?,
title: String?,
titleLength: Int?,
hint: String?,
required: Boolean?,
icon: Any?,
) {
type?.let {
dataLayout.type = it
}
title?.let {
dataLayout.tvTitle.text = title
}
titleLength?.let {
dataLayout.titleLength = titleLength
}
required?.let {
dataLayout.required = it
}
hint?.let {
dataLayout.hint = hint
}
dataLayout.icon = icon
}
@BindingAdapter(
"value",
requireAll = false
)
fun setSearchLayoutDataValueNew(
layout: PadDataLayoutNew,
value: String?,
) {
value?.let {
layout.value = value
}
}
@BindingAdapter(
"enable",
requireAll = false
)
fun setSearchLayoutDataEnableNew(
layout: PadDataLayoutNew,
enable: Boolean?,
) {
enable?.let {
layout.enable = enable
}
}
@BindingAdapter(
"list",
requireAll = false
)
fun setSearchLayoutDataListNew(
layout: PadDataLayoutNew,
list: List<KeyValue>?,
) {
list?.let {
layout.list = list
}
}
@BindingAdapter(
"inputHeight",
requireAll = false
)
fun setSearchLayoutInputHeightNew(
layout: PadDataLayoutNew,
inputHeight: Int?,
) {
inputHeight?.let {
ViewUtils.setHeight(layout.llContainer, SizeUtils.dp2px(it.toFloat()))
layout.et.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE)
layout.et.gravity = Gravity.TOP
layout.et.isSingleLine = false
layout.et.isHorizontalScrollBarEnabled = false
ViewUtils.setPadding(layout.et, SizeUtils.dp2px(10f))
}
}
/**
* 设置最大长度
* 仅对Input类型有效
*/
@BindingAdapter(
"maxLength",
requireAll = false
)
fun setSearchLayoutMaxLengthNew(
layout: PadDataLayoutNew,
maxLength: Int?,
) {
maxLength?.let {
EditTextUtils.setMaxLength(layout.et, maxLength)
}
}
@InverseBindingAdapter(attribute = "value", event = "valueAttrChanged")
fun getDataLayoutValueNew(dataLayout: PadDataLayoutNew): String {
return dataLayout.value
}
@BindingAdapter("valueAttrChanged", requireAll = false)
fun setDataLayoutValueAttrChangedNew(dataLayout: PadDataLayoutNew, listener: InverseBindingListener) {
dataLayout.onChangeListener = listener
}
@BindingAdapter("setOnIconClickListener", requireAll = false)
fun setOnIconClickListenerNew(layout: PadDataLayoutNew, listener: View.OnClickListener) {
layout.iv.setOnClickListener(listener)
}
@BindingAdapter("setRefreshCallBack", requireAll = false)
fun setRefreshCallBackNew(layout: PadDataLayoutNew, listener: (() -> Unit)?) {
layout.refreshCallBack = listener
}
@BindingAdapter("setTextAllCaps", requireAll = false)
fun setTextAllCapsNew(layout: PadDataLayoutNew, textAllCaps: Boolean) {
if (textAllCaps) {
layout.et.filters = arrayOf<InputFilter>(InputFilter.AllCaps())
} else {
layout.et.filters = emptyArray<InputFilter>()
}
}

View File

@@ -0,0 +1,246 @@
package com.lukouguoji.module_base.ui.weight.data.layout
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.EditText
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.Spinner
import android.widget.TextView
import androidx.core.widget.doOnTextChanged
import androidx.databinding.InverseBindingListener
import androidx.databinding.ObservableArrayList
import androidx.databinding.ObservableBoolean
import androidx.databinding.ObservableField
import androidx.databinding.ObservableInt
import com.lukouguoji.module_base.R
import com.lukouguoji.module_base.adapter.bindAdapter
import com.lukouguoji.module_base.adapter.bindOnSelected
import com.lukouguoji.module_base.adapter.completeSpace
import com.lukouguoji.module_base.adapter.loadImage
import com.lukouguoji.module_base.adapter.setSelectedItem
import com.lukouguoji.module_base.adapter.visible
import com.lukouguoji.module_base.interfaces.IOnFocusChangeListener
import com.lukouguoji.module_base.interfaces.IOnSpinnerSelected
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.getActivity
import com.lukouguoji.module_base.ktx.loge
import com.lukouguoji.module_base.util.Common
import dev.utils.app.info.KeyValue
import dev.utils.common.ReflectUtils
import java.util.Calendar
import kotlin.properties.Delegates
class PadDataLayoutNew : FrameLayout {
constructor(context: Context?) : super(context!!)
constructor(context: Context?, attrs: AttributeSet?) : super(context!!, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
context!!,
attrs,
defStyleAttr
)
var onChangeListener: InverseBindingListener? = null
var llContainer: LinearLayout by Delegates.notNull()
var ll: LinearLayout by Delegates.notNull()
var tvTitle: TextView by Delegates.notNull()
var tvM: TextView by Delegates.notNull()
var tv: TextView by Delegates.notNull()
var tvSpinner: TextView by Delegates.notNull()
var et: EditText by Delegates.notNull()
var spinner: Spinner by Delegates.notNull()
var iv: ImageView by Delegates.notNull()
var type = DataLayoutType.INPUT
set(value) {
field = value
setForType()
}
var enable = true
set(value) {
field = value
setForEnable()
}
var titleLength = 0
set(value) {
field = value
if (value > 0) {
completeSpace(tvTitle, value, false)
}
}
var value = ""
set(value) {
if (field == value) {
return
}
field = value
onValueSet()
onChangeListener?.onChange()
}
var show = ""
var title = ""
set(value) {
field = value
tvTitle.text = value
}
var hint = ""
set(value) {
field = value
et.hint = value
bindAdapter(spinner, list, hint)
}
var required = false
set(value) {
field = value
tvM.visibility = if (value) VISIBLE else INVISIBLE
}
var list = emptyList<KeyValue>()
set(value) {
field = value
bindAdapter(spinner, value, hint)
onValueSet()
}
var icon: Any? = null
set(value) {
field = value
visible(iv, value)
loadImage(iv, value)
}
/**
* 刷新事件回调
*/
var refreshCallBack: (() -> Unit)? = {}
// 选择日期
private val dateClick: (v: View) -> Unit = {
if (enable) {
Common.onYearMonthDay(context.getActivity(), value) { year, month, day ->
val calendar = Calendar.getInstance()
calendar.set(year, month - 1, day)
value = calendar.time.formatDate()
refreshCallBack?.invoke()
}
}
}
init {
initView()
}
private fun initView() {
val view = inflate(context, R.layout.layout_pad_data_new, this)
llContainer = view.findViewById(R.id.ll_container)
ll = view.findViewById(R.id.ll)
tvTitle = view.findViewById(R.id.tv_title)
tvM = view.findViewById(R.id.tv_m)
tv = view.findViewById(R.id.tv)
tvSpinner = view.findViewById(R.id.tv_spinner)
et = view.findViewById(R.id.et)
spinner = view.findViewById(R.id.spinner)
iv = view.findViewById(R.id.iv)
et.doOnTextChanged { text, _, _, _ ->
value = text.toString()
}
bindOnSelected(spinner, object : IOnSpinnerSelected {
override fun onSelected(position: Int) {
value = list.getOrNull(position)?.value ?: ""
refreshCallBack?.invoke()
}
})
// 监听输入框焦点变化
com.lukouguoji.module_base.adapter.setOnFocusChangeListener(
et, object : IOnFocusChangeListener {
override fun onFocusChange(hasFocus: Boolean) {
if (!hasFocus) {
refreshCallBack?.invoke()
}
}
})
setForType()
}
private fun setForEnable() {
ll.isEnabled = enable
et.isEnabled = enable
spinner.isEnabled = enable
tv.isEnabled = enable
setForType()
onValueSet()
}
private fun setForType() {
when (type) {
DataLayoutType.INPUT -> {
et.visibility = VISIBLE
spinner.visibility = GONE
tvSpinner.visibility = GONE
tv.visibility = GONE
setOnClickListener(null)
}
DataLayoutType.SPINNER -> {
et.visibility = GONE
tv.visibility = GONE
if (enable) {
spinner.visibility = VISIBLE
tvSpinner.visibility = GONE
} else {
tvSpinner.visibility = VISIBLE
spinner.visibility = GONE
}
setOnClickListener(null)
}
DataLayoutType.DATE -> {
tv.visibility = VISIBLE
et.visibility = GONE
spinner.visibility = GONE
tvSpinner.visibility = GONE
setOnClickListener(dateClick)
}
}
}
private fun onValueSet() {
if (et.text.toString() != value) {
et.setText(value)
}
if (tv.text.toString() != value) {
tv.text = value
}
tvSpinner.text = list.find { b -> b.value == value }?.key ?: value
if (value.isNotEmpty() && list.isNotEmpty()) {
val index = list.indexOfFirst { b -> b.value == value }
if (index >= 0) {
spinner.post {
spinner.setSelection(index)
}
}
}
}
internal fun setOnValueChangeListener(listener: InverseBindingListener) {
if (onChangeListener == null) {
this.onChangeListener = listener
}
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_data_layout_new_s" android:state_enabled="true" />
<item android:drawable="@drawable/bg_data_layout_new_readonly" android:state_enabled="false" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f2f2f2"/>
<corners android:radius="5dp"/>
<stroke android:width="1px" android:color="#e4e4e4"/>
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<stroke android:width="1dp" android:color="#e4e4e4"/>
<corners android:radius="5dp"/>
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="8.7dp"
android:height="6dp"
android:drawable="@drawable/img_sp_down"
android:gravity="center_vertical|right"
android:right="10dp" />
</layer-list>

View File

@@ -0,0 +1,94 @@
<?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:id="@+id/ll_container"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="5dp"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="标题:"
android:textColor="@color/text_gray"
tools:text="标题" />
<LinearLayout
android:id="@+id/ll"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/bg_data_layout_new"
android:gravity="center_vertical">
<EditText
android:id="@+id/et"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:paddingStart="10dp"
android:textColor="@color/text_normal"
android:textColorHint="@color/text_gray"
android:textSize="14sp" />
<Spinner
android:id="@+id/spinner"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_spinner_pda_new"
android:overlapAnchor="false"
android:spinnerMode="dropdown" />
<TextView
android:id="@+id/tv"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="10dp"
android:textColor="@color/text_normal"
android:textColorHint="@color/text_gray_l"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_spinner"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_spinner_pda_new"
android:gravity="center_vertical"
android:paddingStart="10dp"
android:textColor="@color/text_normal"
android:textColorHint="@color/text_gray"
android:textSize="14sp" />
<ImageView
android:id="@+id/iv"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/scan_code"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/tv_m"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="*"
android:textColor="@color/red"
android:textSize="16sp"
android:visibility="invisible" />
</LinearLayout>

View File

@@ -73,261 +73,274 @@
<!-- 内容区域 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true"
android:padding="10dp">
android:layout_height="wrap_content"
android:fillViewport="true">
<!-- 白色圆角卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="15dp">
<!-- 运单信息标题 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:text="运单信息"
android:textColor="@color/color_33"
android:textSize="18sp"
android:textStyle="bold" />
<!-- 第一行:运单号、预配件数、预配重量、特码 -->
<!-- 白色圆角卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"运单号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.wbNo}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"预配件数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.pc)}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"预配重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.weight)}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"特码"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.spCode}' />
</LinearLayout>
<!-- 第二行:航班日期、航班号、航程、预计起飞 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"航班日期"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.fdate}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"航班号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.fno}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"航程"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.range}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"预计起飞"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.scheduledTackOff}' />
</LinearLayout>
<!-- 第三行:代理人、业务类型、车牌号 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"代理人"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.agentName}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"业务类型:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.businessName}' />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
enable="@{false}"
title='@{"车牌号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.carNumber}' />
</LinearLayout>
<!-- 品名(英) -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
enable="@{false}"
title='@{"品名(英)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.goods}' />
<!-- 品名(中) -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
enable="@{false}"
title='@{"品名(中)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.goodsCn}' />
<!-- 附件 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
android:background="@drawable/bg_white_radius_8"
android:orientation="vertical"
android:padding="15dp">
<!-- 运单信息标题 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="附件:"
android:textColor="@color/text_gray"
android:textSize="14sp"
android:minWidth="60dp" />
android:layout_marginBottom="15dp"
android:text="运单信息"
android:textColor="@color/color_33"
android:textSize="16sp"
android:textStyle="bold" />
<HorizontalScrollView
android:layout_width="0dp"
<!-- 第一行:运单号、预配件数、预配重量、特码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scrollbars="none">
android:orientation="horizontal">
<LinearLayout
android:id="@+id/attachContainer"
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"运单号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.wbNo}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"预配件数"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.pc)}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"预配重量"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{String.valueOf(viewModel.dataBean.weight)}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"特码"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.spCode}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<!-- 第二行:航班日期、航班号、航程、预计起飞 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"航班日期"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.fdate}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"航班号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.fno}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"航程"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.range}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"预计起飞"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.scheduledTackOff}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<!-- 第三行:代理人、业务类型、车牌号 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"代理人"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.agentName}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"业务类型:"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.businessName}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"车牌号"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.carNumber}'
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<!-- 品名(英) -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"品名(英)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.goods}'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />
<!-- 品名(中) -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{false}"
title='@{"品名(中)"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.goodsCn}'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />
<!-- 附件 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
android:minWidth="80dp"
android:text="附件:"
android:textColor="@color/text_gray"
android:textSize="14sp" />
</HorizontalScrollView>
<HorizontalScrollView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scrollbars="none">
<LinearLayout
android:id="@+id/attachContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</HorizontalScrollView>
</LinearLayout>
<!-- 备注 -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{true}"
inputHeight="@{80}"
title='@{"备注"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.remark}'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />
</LinearLayout>
<!-- 备注 -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
<!-- 底部操作按钮 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
enable="@{false}"
inputHeight="@{80}"
title='@{"备注"}'
titleLength="@{5}"
type="@{DataLayoutType.INPUT}"
value='@{viewModel.dataBean.remark}' />
android:layout_height="56dp"
android:layout_marginTop="24dp"
android:gravity="center"
android:paddingHorizontal="15dp">
<!-- 退回按钮 -->
<TextView
style="@style/tv_bottom_btn"
android:layout_width="120dp"
android:layout_marginEnd="20dp"
android:onClick="@{()-> viewModel.auditReject()}"
android:text="退回" />
<!-- 通过按钮 -->
<TextView
style="@style/tv_bottom_btn"
android:layout_width="120dp"
android:onClick="@{()-> viewModel.auditPass()}"
android:text="通过" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<!-- 底部操作按钮 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/color_bottom_layout"
android:gravity="center"
android:paddingHorizontal="15dp">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<!-- 退回按钮 -->
<TextView
style="@style/tv_bottom_btn"
android:layout_marginEnd="20dp"
android:onClick="@{()-> viewModel.auditReject()}"
android:text="退回" />
<!-- 通过按钮 -->
<TextView
style="@style/tv_bottom_btn"
android:onClick="@{()-> viewModel.auditPass()}"
android:text="通过" />
</LinearLayout>
</LinearLayout>
</layout>