feat(ui): 重构检验和喷涂活动界面
- 将 InspectionActivity 和 SprayingActivity 继承自 BaseListFormLayoutNormalActivity - 添加 RecyclerView 水平方向布局支持 - 实现 CommonPagedAdapter 来管理列表项 - 添加语音命令处理包括"驳回"、"拒绝"、"同意"、"通过"等操作 - 更新 activity_inspection.xml 和 activity_spraying.xml 布局文件 - 添加任务详情显示包括任务编号、供应商、创建时间等信息 - 创建 item_photo.xml 布局用于拍照功能 - 新增 bg_photo.xml 圆角边框样式 - 移除 bg_task_title_selected.xml 中的填充颜色 - 添加 InspectionVM 和 SprayingVM 视图模型来管理数据加载
这个提交包含在:
父节点
825b03106c
当前提交
8f1e067334
@ -1,16 +1,23 @@
|
||||
package com.nova.brain.glass.ui
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.nova.brain.glass.R
|
||||
import com.nova.brain.glass.databinding.ActivityFoBinding
|
||||
import com.nova.brain.glass.databinding.ActivityInspectionBinding
|
||||
import com.nova.brain.glass.databinding.ActivityReviewBinding
|
||||
import com.nova.brain.glass.helper.OfflineCmdListener
|
||||
import com.nova.brain.glass.helper.OfflineCmdServiceHelper
|
||||
import com.xuqm.base.ui.BaseActivity
|
||||
import com.nova.brain.glass.model.ItemItem
|
||||
import com.nova.brain.glass.viewmodel.ItemListVM
|
||||
import com.xuqm.base.adapter.BasePagedAdapter
|
||||
import com.xuqm.base.adapter.CommonPagedAdapter
|
||||
import com.xuqm.base.adapter.ViewHolder
|
||||
import com.xuqm.base.ui.BaseListFormLayoutNormalActivity
|
||||
|
||||
class InspectionActivity : BaseActivity<ActivityInspectionBinding>() {
|
||||
class InspectionActivity : BaseListFormLayoutNormalActivity<ItemItem, ItemListVM, ActivityInspectionBinding>() {
|
||||
override fun getLayoutId(): Int =R.layout.activity_inspection
|
||||
override fun fullscreen(): Boolean = true
|
||||
|
||||
override fun getRecyclerOrientation(): Int = RecyclerView.HORIZONTAL
|
||||
|
||||
private val listener = object : OfflineCmdListener {
|
||||
override fun onOfflineCmd(cmd: String) {
|
||||
runOnUiThread {
|
||||
@ -18,6 +25,12 @@ class InspectionActivity : BaseActivity<ActivityInspectionBinding>() {
|
||||
"退出","返回","退回"->{
|
||||
finish()
|
||||
}
|
||||
"驳回","拒绝","不同意"->{
|
||||
finish()
|
||||
}
|
||||
"同意","通过"->{
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -31,4 +44,19 @@ class InspectionActivity : BaseActivity<ActivityInspectionBinding>() {
|
||||
super.onDestroy()
|
||||
OfflineCmdServiceHelper.removeOnLineListener(listener)
|
||||
}
|
||||
|
||||
private val adapter = object : CommonPagedAdapter<ItemItem>(R.layout.item_item) {
|
||||
override fun convert(holder: ViewHolder, item: ItemItem, position: Int) {
|
||||
holder
|
||||
.setText(R.id.text, item.text)
|
||||
.setClickListener(R.id.text) {
|
||||
when (item.text) {
|
||||
"同意" -> finish()
|
||||
"驳回" -> finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun adapter(): BasePagedAdapter<ItemItem> = adapter
|
||||
}
|
||||
|
||||
@ -1,15 +1,24 @@
|
||||
package com.nova.brain.glass.ui
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.nova.brain.glass.R
|
||||
import com.nova.brain.glass.databinding.ActivitySprayingBinding
|
||||
import com.nova.brain.glass.helper.OfflineCmdListener
|
||||
import com.nova.brain.glass.helper.OfflineCmdServiceHelper
|
||||
import com.xuqm.base.ui.BaseActivity
|
||||
import com.nova.brain.glass.model.ItemItem
|
||||
import com.nova.brain.glass.viewmodel.ItemListVM
|
||||
import com.nova.brain.glass.viewmodel.SprayingVM
|
||||
import com.xuqm.base.adapter.BasePagedAdapter
|
||||
import com.xuqm.base.adapter.CommonPagedAdapter
|
||||
import com.xuqm.base.adapter.ViewHolder
|
||||
import com.xuqm.base.ui.BaseListFormLayoutNormalActivity
|
||||
|
||||
class SprayingActivity : BaseActivity<ActivitySprayingBinding>() {
|
||||
class SprayingActivity : BaseListFormLayoutNormalActivity<ItemItem, SprayingVM, ActivitySprayingBinding>() {
|
||||
override fun getLayoutId(): Int = R.layout.activity_spraying
|
||||
override fun fullscreen(): Boolean = true
|
||||
|
||||
override fun getRecyclerOrientation(): Int = RecyclerView.HORIZONTAL
|
||||
|
||||
private val listener = object : OfflineCmdListener {
|
||||
override fun onOfflineCmd(cmd: String) {
|
||||
runOnUiThread {
|
||||
@ -31,4 +40,19 @@ class SprayingActivity : BaseActivity<ActivitySprayingBinding>() {
|
||||
super.onDestroy()
|
||||
OfflineCmdServiceHelper.removeOnLineListener(listener)
|
||||
}
|
||||
|
||||
private val adapter = object : CommonPagedAdapter<ItemItem>(R.layout.item_photo) {
|
||||
override fun convert(holder: ViewHolder, item: ItemItem, position: Int) {
|
||||
holder
|
||||
.setClickListener(R.id.photo) {
|
||||
when (item.text) {
|
||||
"拍照" -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun adapter(): BasePagedAdapter<ItemItem> = adapter
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.nova.brain.glass.viewmodel
|
||||
|
||||
import com.nova.brain.glass.model.ItemItem
|
||||
import com.nova.brain.glass.model.TaskItem
|
||||
import com.xuqm.base.viewmodel.BaseListViewModel
|
||||
import com.xuqm.base.viewmodel.callback.Response
|
||||
|
||||
class InspectionVM: BaseListViewModel<ItemItem>() {
|
||||
override fun loadData(
|
||||
page: Int,
|
||||
onResponse: Response<ItemItem>
|
||||
) {
|
||||
onResponse.onResponse(arrayListOf<ItemItem>().apply {
|
||||
add(ItemItem("拍照"))
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.nova.brain.glass.viewmodel
|
||||
|
||||
import com.nova.brain.glass.model.ItemItem
|
||||
import com.xuqm.base.viewmodel.BaseListViewModel
|
||||
import com.xuqm.base.viewmodel.callback.Response
|
||||
|
||||
class SprayingVM: BaseListViewModel<ItemItem>() {
|
||||
override fun loadData(
|
||||
page: Int,
|
||||
onResponse: Response<ItemItem>
|
||||
) {
|
||||
onResponse.onResponse(arrayListOf<ItemItem>().apply {
|
||||
add(ItemItem("拍照"))
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#ff40FF5E" />
|
||||
<corners android:radius="44dp" />
|
||||
</shape>
|
||||
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#1040FF5E" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#ff40FF5E" />
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -12,54 +12,94 @@
|
||||
android:id="@+id/tvTaskHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="130工序要求如下:"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:layout_marginTop="67dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:text="装配工序喷涂识别:您还有10项任务未完成!"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<TextView
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/content"
|
||||
android:layout_width="0dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:layout_height="300dp"
|
||||
android:text="采用手工铺贴,按操作规程CD1442要求进行铺贴,将铺层信息填写在表SAMC 31-71《零件铺层信息、生产记录表》中,并扫描上传。 1)I型表面胶膜铺贴最大搭接6mm或对接最大间隙1.5mm。按投影线及工装余量刻线进行铺贴。 2)织物铺层的方向公差为±5°,铺贴中允许搭接13mm~25mm或对接间隙≤1.5mm,拼缝错开至少25mm,同向铺层之间可以每隔4层重复拼缝的错开位置。按投影线及工装余量刻线进行铺贴,加强层铺贴位置公差为投影位置±2.5mm。"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:lineHeight="20sp"
|
||||
android:textSize="16sp"
|
||||
android:background="@drawable/bg_task_title_selected"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTaskHeader" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTaskHeader">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:background="@drawable/bg_item"
|
||||
android:textSize="16sp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="3dp"
|
||||
android:text="驳回"
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginVertical="3dp"
|
||||
android:gravity="center"
|
||||
android:text="任务1:管线编号与机身喷码核对"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#ff40FF5E" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="任务编号:20293989-001"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="制造供应商:中航成飞民用飞机有限责任公司"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:text="任务创建时间:2026-03-09 16:00:00"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/baseRecyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/content" />
|
||||
app:layout_constraintTop_toBottomOf="@id/content" />
|
||||
<TextView
|
||||
android:id="@+id/agree"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/baseRecyclerView"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:gravity="center"
|
||||
android:text="单击或语音输入“开始”,进入下一步"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:background="@drawable/bg_item"
|
||||
android:textSize="16sp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:paddingVertical="3dp"
|
||||
android:text="同意"
|
||||
app:layout_constraintStart_toEndOf="@+id/reject"
|
||||
app:layout_constraintTop_toBottomOf="@+id/content" />
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main"
|
||||
@ -11,56 +12,94 @@
|
||||
android:id="@+id/tvTaskHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="67dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:text="130喷涂工序要求如下:"
|
||||
android:text="装配工序喷涂识别:您还有10项任务未完成!"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:lineHeight="20sp"
|
||||
android:text="按照喷涂工艺卡要求完成表面清洁、遮蔽、防护、喷涂和固化,记录喷涂批次、环境参数和作业时间,并将过程结果上传。"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="16sp"
|
||||
android:background="@drawable/bg_task_title_selected"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTaskHeader" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTaskHeader">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="3dp"
|
||||
android:text="驳回"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="16sp"
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginVertical="3dp"
|
||||
android:gravity="center"
|
||||
android:text="任务1:管线编号与机身喷码核对"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#ff40FF5E" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="任务编号:20293989-001"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="制造供应商:中航成飞民用飞机有限责任公司"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:text="任务创建时间:2026-03-09 16:00:00"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/baseRecyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/content" />
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/content" />
|
||||
<TextView
|
||||
android:id="@+id/agree"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_item"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="3dp"
|
||||
android:text="同意"
|
||||
app:layout_constraintTop_toBottomOf="@+id/baseRecyclerView"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:gravity="center"
|
||||
android:text="单击或语音输入“开始”,进入下一步"
|
||||
android:textColor="#ff40FF5E"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toEndOf="@+id/reject"
|
||||
app:layout_constraintTop_toBottomOf="@+id/content" />
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="88dp"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/photo"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_photo"
|
||||
android:layout_height="88dp">
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="24.5dp"
|
||||
android:src="@mipmap/paizhao"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="#4AFE59"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="开始任务"/>
|
||||
|
||||
</LinearLayout>
|
||||
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 1.1 KiB |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 574 B |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 1.4 KiB |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 2.6 KiB |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 3.3 KiB |
正在加载...
在新工单中引用
屏蔽一个用户