feat: opt layout ui
This commit is contained in:
@@ -21,7 +21,8 @@
|
|||||||
"Bash(xmllint:*)",
|
"Bash(xmllint:*)",
|
||||||
"Bash(xargs cat:*)",
|
"Bash(xargs cat:*)",
|
||||||
"mcp__chrome-devtools__evaluate_script",
|
"mcp__chrome-devtools__evaluate_script",
|
||||||
"WebSearch"
|
"WebSearch",
|
||||||
|
"Bash(chmod:*)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
@@ -153,3 +153,145 @@ fun setTextAllCaps(layout: PadDataLayout, textAllCaps: Boolean) {
|
|||||||
layout.et.filters = emptyArray<InputFilter>()
|
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>()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
module_base/src/main/res/drawable/bg_data_layout_new.xml
Normal file
5
module_base/src/main/res/drawable/bg_data_layout_new.xml
Normal 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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
9
module_base/src/main/res/drawable/bg_spinner_pda_new.xml
Normal file
9
module_base/src/main/res/drawable/bg_spinner_pda_new.xml
Normal 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>
|
||||||
94
module_base/src/main/res/layout/layout_pad_data_new.xml
Normal file
94
module_base/src/main/res/layout/layout_pad_data_new.xml
Normal 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>
|
||||||
@@ -73,10 +73,15 @@
|
|||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:fillViewport="true">
|
||||||
android:fillViewport="true"
|
|
||||||
android:padding="10dp">
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="15dp">
|
||||||
|
|
||||||
|
|
||||||
<!-- 白色圆角卡片 -->
|
<!-- 白色圆角卡片 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -93,7 +98,7 @@
|
|||||||
android:layout_marginBottom="15dp"
|
android:layout_marginBottom="15dp"
|
||||||
android:text="运单信息"
|
android:text="运单信息"
|
||||||
android:textColor="@color/color_33"
|
android:textColor="@color/color_33"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<!-- 第一行:运单号、预配件数、预配重量、特码 -->
|
<!-- 第一行:运单号、预配件数、预配重量、特码 -->
|
||||||
@@ -102,45 +107,45 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"运单号"}'
|
title='@{"运单号"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.wbNo}' />
|
value='@{viewModel.dataBean.wbNo}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"预配件数"}'
|
title='@{"预配件数"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{String.valueOf(viewModel.dataBean.pc)}' />
|
value='@{String.valueOf(viewModel.dataBean.pc)}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"预配重量"}'
|
title='@{"预配重量"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{String.valueOf(viewModel.dataBean.weight)}' />
|
value='@{String.valueOf(viewModel.dataBean.weight)}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"特码"}'
|
title='@{"特码"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.spCode}' />
|
value='@{viewModel.dataBean.spCode}'
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -148,48 +153,48 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="8dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"航班日期"}'
|
title='@{"航班日期"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.fdate}' />
|
value='@{viewModel.dataBean.fdate}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"航班号"}'
|
title='@{"航班号"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.fno}' />
|
value='@{viewModel.dataBean.fno}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"航程"}'
|
title='@{"航程"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.range}' />
|
value='@{viewModel.dataBean.range}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"预计起飞"}'
|
title='@{"预计起飞"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.scheduledTackOff}' />
|
value='@{viewModel.dataBean.scheduledTackOff}'
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -197,77 +202,84 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="8dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"代理人"}'
|
title='@{"代理人"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.agentName}' />
|
value='@{viewModel.dataBean.agentName}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"业务类型:"}'
|
title='@{"业务类型:"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.businessName}' />
|
value='@{viewModel.dataBean.businessName}'
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"车牌号"}'
|
title='@{"车牌号"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.carNumber}' />
|
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>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 品名(英) -->
|
<!-- 品名(英) -->
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"品名(英)"}'
|
title='@{"品名(英)"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.goods}' />
|
value='@{viewModel.dataBean.goods}'
|
||||||
|
|
||||||
<!-- 品名(中) -->
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="8dp" />
|
||||||
|
|
||||||
|
<!-- 品名(中) -->
|
||||||
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
enable="@{false}"
|
enable="@{false}"
|
||||||
title='@{"品名(中)"}'
|
title='@{"品名(中)"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.goodsCn}' />
|
value='@{viewModel.dataBean.goodsCn}'
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp" />
|
||||||
|
|
||||||
<!-- 附件 -->
|
<!-- 附件 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="42dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="8dp"
|
||||||
android:orientation="horizontal">
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="5dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="80dp"
|
||||||
android:text="附件:"
|
android:text="附件:"
|
||||||
android:textColor="@color/text_gray"
|
android:textColor="@color/text_gray"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp" />
|
||||||
android:minWidth="60dp" />
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -286,37 +298,31 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:layout_width="match_parent"
|
enable="@{true}"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
enable="@{false}"
|
|
||||||
inputHeight="@{80}"
|
inputHeight="@{80}"
|
||||||
title='@{"备注"}'
|
title='@{"备注"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@{viewModel.dataBean.remark}' />
|
value='@{viewModel.dataBean.remark}'
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- 底部操作按钮 -->
|
<!-- 底部操作按钮 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="56dp"
|
||||||
android:background="@color/color_bottom_layout"
|
android:layout_marginTop="24dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingHorizontal="15dp">
|
android:paddingHorizontal="15dp">
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<!-- 退回按钮 -->
|
<!-- 退回按钮 -->
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/tv_bottom_btn"
|
style="@style/tv_bottom_btn"
|
||||||
|
android:layout_width="120dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:onClick="@{()-> viewModel.auditReject()}"
|
android:onClick="@{()-> viewModel.auditReject()}"
|
||||||
android:text="退回" />
|
android:text="退回" />
|
||||||
@@ -324,10 +330,17 @@
|
|||||||
<!-- 通过按钮 -->
|
<!-- 通过按钮 -->
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/tv_bottom_btn"
|
style="@style/tv_bottom_btn"
|
||||||
|
android:layout_width="120dp"
|
||||||
android:onClick="@{()-> viewModel.auditPass()}"
|
android:onClick="@{()-> viewModel.auditPass()}"
|
||||||
android:text="通过" />
|
android:text="通过" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user