fix(agent): compact #90 task search
This commit is contained in:
@@ -11,8 +11,8 @@ android {
|
||||
applicationId = "cn.ilapage.goauto.agent"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 5
|
||||
versionName = "0.4.0"
|
||||
versionCode = 6
|
||||
versionName = "0.4.1"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -77,12 +77,14 @@ class TaskHistoryFragment : Fragment() {
|
||||
private fun buildSearch(): View {
|
||||
val context = requireContext()
|
||||
return context.card(context.cardColumn().apply {
|
||||
addView(context.label(if (collection) "采集任务编号" else "采购任务编号", 14f, context.getColor(R.color.agent_text), true))
|
||||
setPadding(context.dp(12), context.dp(8), context.dp(12), context.dp(8))
|
||||
val row = LinearLayout(context).apply { orientation = LinearLayout.HORIZONTAL; gravity = Gravity.CENTER_VERTICAL }
|
||||
searchInput = EditText(context).apply {
|
||||
hint = if (collection) "例如 35 或 #35" else "例如 12 或 CG-12"
|
||||
hint = if (collection) "输入编号,如 35 或 #35" else "输入编号,如 12 或 CG-12"
|
||||
contentDescription = if (collection) "采集任务编号" else "采购任务编号"
|
||||
setHintTextColor(context.getColor(R.color.agent_text_muted))
|
||||
setTextColor(context.getColor(R.color.agent_text))
|
||||
textSize = 14f
|
||||
setSingleLine(true)
|
||||
inputType = android.text.InputType.TYPE_CLASS_TEXT
|
||||
imeOptions = EditorInfo.IME_ACTION_SEARCH
|
||||
@@ -91,14 +93,17 @@ class TaskHistoryFragment : Fragment() {
|
||||
if (action == EditorInfo.IME_ACTION_SEARCH) { search(); true } else false
|
||||
}
|
||||
}
|
||||
row.addView(searchInput, LinearLayout.LayoutParams(0, context.dp(52), 1f))
|
||||
row.addView(searchInput, LinearLayout.LayoutParams(0, context.dp(48), 1f))
|
||||
row.addView(MaterialButton(context).apply {
|
||||
text = "搜索"
|
||||
textSize = 14f
|
||||
minimumHeight = context.dp(48)
|
||||
setOnClickListener { search() }
|
||||
}, LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, context.dp(52)).apply { marginStart = context.dp(8) })
|
||||
addView(row, row.fullWidth(8))
|
||||
})
|
||||
}, LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, context.dp(48)).apply { marginStart = context.dp(8) })
|
||||
addView(row, row.fullWidth())
|
||||
}).apply {
|
||||
(layoutParams as? LinearLayout.LayoutParams)?.bottomMargin = context.dp(8)
|
||||
}
|
||||
}
|
||||
|
||||
private fun buildFilters(): View {
|
||||
|
||||
Reference in New Issue
Block a user