回采页面
This commit is contained in:
@@ -55,6 +55,9 @@
|
||||
<activity android:name=".ui.tunneling.activity.AddWorkingFaceActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name=".ui.mining.activity.MiningActivity" />
|
||||
<activity android:name=".ui.mining.activity.MiningFaceStatisticsActivity" />
|
||||
<activity android:name=".ui.mining.activity.MiningFaceDetailActivity" />
|
||||
<activity android:name=".ui.mining.activity.AddMiningFaceActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingFaceBinding
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.ui.mining.activity.MiningActivity
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.toJsonString
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
class MiningWorkingFaceAdapter(var list: MutableList<MiningWorkingFaceEntity>) :
|
||||
BaseQuickAdapter<MiningWorkingFaceEntity, MiningWorkingFaceAdapter.VH>(
|
||||
R.layout.list_item_tunnel_working_face, list
|
||||
) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "TunnelWorkingFaceAdapter"
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val binding = ListItemTunnelWorkingFaceBinding.inflate(inflater, parent, false)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: MiningWorkingFaceEntity
|
||||
) {
|
||||
holder.binding.let { binding ->
|
||||
binding.includeHeader.root.isEnabled = false
|
||||
binding.tvWorkingFaceName.text = item.surfaceName
|
||||
binding.llFaceRecord.let {
|
||||
if (item.isExpandRecord) it.visible() else it.gone()
|
||||
}
|
||||
binding.ivFlagEdit.let {
|
||||
if (item.dataState == "1") it.visible() else it.gone()
|
||||
}
|
||||
binding.ivExpandRecord.setImageResource(
|
||||
if (item.isExpandRecord) R.drawable.ic_arrow_down_white else R.drawable.ic_arrow_right_gray
|
||||
)
|
||||
binding.ivExpandRecord.tag = item.isExpandRecord.toString()
|
||||
binding.rvFaceRecord.let { rv ->
|
||||
rv.layoutManager = LinearLayoutManager(context)
|
||||
if (item.records == null) {
|
||||
item.records = mutableListOf()
|
||||
}
|
||||
val size = item.records!!.size
|
||||
binding.includeHeader.root.let { header ->
|
||||
if (size > 0) header.visible()
|
||||
else header.gone()
|
||||
}
|
||||
rv.updateLayoutParams {
|
||||
height = if (size >= 3)
|
||||
ScreenUtil.dp2px(150F)
|
||||
else
|
||||
RecyclerView.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
rv.isVerticalScrollBarEnabled = size >= 3
|
||||
rv.isVerticalFadingEdgeEnabled = size < 3
|
||||
rv.overScrollMode = if (size >= 3) View.OVER_SCROLL_IF_CONTENT_SCROLLS else View.OVER_SCROLL_NEVER
|
||||
rv.adapter = MiningWorkingFaceRecordAdapter(item.records!!).apply {
|
||||
setOnItemClickListener { adapter, view, recordPosition ->
|
||||
// if (recordPosition == 0) {
|
||||
// //0为头部表示,不需要点击操作
|
||||
// return@setOnItemClickListener
|
||||
// }
|
||||
Log.d(TAG, "convert: ${item.records!![recordPosition].toJsonString()}")
|
||||
// context.let { ctx ->
|
||||
// if (ctx is MiningActivity) {
|
||||
// ctx.toActivity(WorkingFaceRecordActivity::class.java, Bundle().apply {
|
||||
// putString(WorkingFaceRecordActivity.FACE_NAME, item.surfaceName)
|
||||
// putParcelable(
|
||||
// WorkingFaceRecordActivity.FACE_RECORD,
|
||||
// item.records!![recordPosition]
|
||||
// )
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class VH(var binding: ListItemTunnelWorkingFaceBinding) : BaseViewHolder(binding.root)
|
||||
|
||||
init {
|
||||
addChildClickViewIds(
|
||||
R.id.start_record,
|
||||
R.id.ivExpandRecord,
|
||||
R.id.llWorkingFace
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import androidx.core.graphics.toColorInt
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingFaceRecordBinding
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
class MiningWorkingFaceRecordAdapter(var list: MutableList<MiningWorkingFaceRecordEntity>) :
|
||||
BaseQuickAdapter<MiningWorkingFaceRecordEntity, MiningWorkingFaceRecordAdapter.VH>(
|
||||
R.layout.list_item_tunnel_working_face_record, list
|
||||
) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val binding = ListItemTunnelWorkingFaceRecordBinding.inflate(inflater, parent, false)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: MiningWorkingFaceRecordEntity
|
||||
) {
|
||||
val position = holder.layoutPosition
|
||||
holder.binding.let {
|
||||
// if (position == 0) {
|
||||
// it.time.setTextColor(Color.WHITE)
|
||||
// it.time.textSize = 14f
|
||||
// it.record.setTextColor(Color.WHITE)
|
||||
// it.record.textSize = 14f
|
||||
// it.operation.setTextColor(Color.WHITE)
|
||||
// it.operation.textSize = 14f
|
||||
// } else {
|
||||
it.time.setTextColor("#FF6A6F87".toColorInt())
|
||||
it.time.textSize = 12f
|
||||
it.record.setTextColor("#FF6A6F87".toColorInt())
|
||||
it.record.textSize = 12f
|
||||
it.operation.setTextColor("#FFA3FEA6".toColorInt())
|
||||
it.operation.textSize = 12f
|
||||
// }
|
||||
it.time.text = item.workingDate
|
||||
it.record.text = item.recordPerson
|
||||
it.operation.text = if (item.operationType == "1") "查看" else "操作"
|
||||
it.divider.visibility =
|
||||
if (position == list.size - 1) View.GONE else View.VISIBLE
|
||||
|
||||
|
||||
it.ivFlagEdit.let {
|
||||
if (item.dataState == "1") it.visible() else it.gone()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inner class VH(var binding: ListItemTunnelWorkingFaceRecordBinding) :
|
||||
BaseViewHolder(binding.root)
|
||||
|
||||
}
|
||||
+4
-6
@@ -15,6 +15,8 @@ import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingItemBinding
|
||||
import com.zmkg.coaloperation.db.entity.tunnel.TunnelRoofLithologyEntity
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
import com.zmkg.coaloperation.utils.formatDecimalString
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
class TunnelWorkingItemAdapter(data: MutableList<TunnelWorkingItem>) :
|
||||
BaseQuickAdapter<TunnelWorkingItem, TunnelWorkingItemAdapter.VH>(
|
||||
@@ -43,12 +45,8 @@ class TunnelWorkingItemAdapter(data: MutableList<TunnelWorkingItem>) :
|
||||
loadRecordData(holder.binding, item)
|
||||
}
|
||||
val position = holder.layoutPosition
|
||||
holder.binding.divider.let {
|
||||
if (position == data.size - 1) {
|
||||
it.visibility = View.GONE
|
||||
} else {
|
||||
it.visibility = View.VISIBLE
|
||||
}
|
||||
holder.binding.divider.run {
|
||||
if (position == data.size - 1) gone() else visible()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.zmkg.coaloperation.adapter.common
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ListItemMiningDisasterWarningBinding
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
class DisasterAdapter(list: MutableList<TunnelWorkingItem>) :
|
||||
BaseQuickAdapter<TunnelWorkingItem, DisasterAdapter.VH>(
|
||||
R.layout.list_item_mining_disaster_warning,
|
||||
list
|
||||
) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val binding = ListItemMiningDisasterWarningBinding.inflate(
|
||||
LayoutInflater.from(context), parent, false
|
||||
)
|
||||
return VH(binding)
|
||||
}
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: TunnelWorkingItem
|
||||
) {
|
||||
holder.binding.let {
|
||||
it.tvDisasterName.text = item.name
|
||||
it.tvDisasterValue.text = item.value
|
||||
it.divider.run {
|
||||
if (holder.layoutPosition == data.size - 1) gone() else visible()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class VH(var binding: ListItemMiningDisasterWarningBinding) : BaseViewHolder(binding.root)
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.zmkg.coaloperation.db.entity.mining
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.time.LocalDateTime
|
||||
|
||||
/**
|
||||
* 回采工作面-顶板岩性数据表
|
||||
*/
|
||||
@Parcelize
|
||||
@Entity(tableName = "mining_roof_lithology")
|
||||
class MiningRoofLithologyEntity (
|
||||
|
||||
/**
|
||||
* 岩性Id
|
||||
*/
|
||||
@PrimaryKey
|
||||
var lithologyId: Long = 0,
|
||||
|
||||
/**
|
||||
* 岩性类型名称
|
||||
*/
|
||||
var lithologyType: String = "",
|
||||
|
||||
/**
|
||||
* 岩性值结束
|
||||
*/
|
||||
var positionEnd: String = "",
|
||||
|
||||
/**
|
||||
* 岩性值起始
|
||||
*/
|
||||
var positionStart: String = "",
|
||||
|
||||
/**
|
||||
* 工作面id
|
||||
*/
|
||||
var surfaceId: Long = 0,
|
||||
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
var recordId: Long = 0,
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
var createTime: String? = "",
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
var updateTime: String? = DateTimeUtil.formatDateTime(LocalDateTime.now()),
|
||||
|
||||
/**
|
||||
* 数据状态:0-默认值,原始数据,1-已修改数据
|
||||
*/
|
||||
var dataState: String = "0"
|
||||
): Parcelable {
|
||||
@Ignore
|
||||
constructor():this(lithologyId = 0)
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
package com.zmkg.coaloperation.db.entity.mining
|
||||
|
||||
//import androidx.room.ColumnInfo
|
||||
import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.time.LocalDateTime
|
||||
|
||||
/**
|
||||
* 回采工作面表对应字段
|
||||
*/
|
||||
@Parcelize
|
||||
@Entity(tableName = "mining_working_face")
|
||||
class MiningWorkingFaceEntity(
|
||||
// @PrimaryKey(name = "faceId") val id: Int = 0
|
||||
/**
|
||||
* 工作面id,本地新增数据使用时间戳保证唯一性
|
||||
*/
|
||||
@PrimaryKey
|
||||
var surfaceId: Long = 0,
|
||||
|
||||
var userId: String = "",
|
||||
|
||||
/**
|
||||
* 工作面名称
|
||||
*/
|
||||
var surfaceName: String? = "",
|
||||
|
||||
/**
|
||||
* 总进尺
|
||||
*/
|
||||
var totalFootage: String? = "",
|
||||
|
||||
/**
|
||||
* 累计进尺
|
||||
*/
|
||||
var accumulativeFootage: String? = "",
|
||||
|
||||
/**
|
||||
* 剩余进尺
|
||||
*/
|
||||
var remainingFootage: String? = "",
|
||||
|
||||
/**
|
||||
* 所属煤层编号
|
||||
*/
|
||||
var seamId: Long? = 0,
|
||||
|
||||
/**
|
||||
* 所属煤层名称
|
||||
*/
|
||||
var seamName: String? = "",
|
||||
|
||||
/**
|
||||
* 所属采区域编号
|
||||
*/
|
||||
var areaId: Long? = 0,
|
||||
|
||||
/**
|
||||
* 所属采区域
|
||||
*/
|
||||
var areaName: String? = "",
|
||||
|
||||
/**
|
||||
* 工作面方位角
|
||||
*/
|
||||
var surfaceAzimuth: String? = "",
|
||||
|
||||
/**
|
||||
* 工作面巷高
|
||||
*/
|
||||
var surfaceHeight: String? = "",
|
||||
|
||||
/**
|
||||
* 工作面巷宽
|
||||
*/
|
||||
var surfaceWidth: String? = "",
|
||||
|
||||
/**
|
||||
* 巷道性质
|
||||
*/
|
||||
var tunnelNature: String? = "",
|
||||
|
||||
/**
|
||||
* 计划工期开始日期
|
||||
*/
|
||||
var planStartDate: String? = "",
|
||||
|
||||
/**
|
||||
* 计划工期结束日期
|
||||
*/
|
||||
var planEndDate: String? = "",
|
||||
|
||||
/**
|
||||
* 地质类型
|
||||
*/
|
||||
var geologicalType: String? = "",
|
||||
|
||||
/**
|
||||
* 水文地质类型
|
||||
*/
|
||||
var hydrogeologicalType: String? = "",
|
||||
|
||||
/**
|
||||
* 煤层发火性
|
||||
*/
|
||||
var seamIgnition: String? = "",
|
||||
|
||||
/**
|
||||
* 瓦斯含量
|
||||
*/
|
||||
var seamGas: String? = "",
|
||||
|
||||
/**
|
||||
* 冲击地压危险性
|
||||
*/
|
||||
var seamBumpPressure: String? = "",
|
||||
|
||||
/**
|
||||
* 支护形式
|
||||
*/
|
||||
var surfaceSupportForm: String? = "",
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
var createTime: String? = "",
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
var updateTime: String? = DateTimeUtil.formatDateTime(LocalDateTime.now()),
|
||||
|
||||
/**
|
||||
* 数据状态:0-默认值,原始数据,1-已修改数据
|
||||
*/
|
||||
var dataState: String = "0",
|
||||
|
||||
@Ignore
|
||||
var records: MutableList<MiningWorkingFaceRecordEntity>? = null,
|
||||
|
||||
@Ignore
|
||||
var latestRecord: MiningWorkingFaceRecordEntity? = null,
|
||||
|
||||
@Ignore
|
||||
var isExpandRecord: Boolean = false
|
||||
): Parcelable
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.zmkg.coaloperation.db.entity.mining
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.time.LocalDateTime
|
||||
|
||||
@Parcelize
|
||||
@Entity(tableName = "mining_working_face_record")
|
||||
data class MiningWorkingFaceRecordEntity (
|
||||
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
@PrimaryKey
|
||||
var recordId: Long = 0,
|
||||
|
||||
/**
|
||||
* 工作面id
|
||||
*/
|
||||
var surfaceId: Long = 0,
|
||||
|
||||
/**
|
||||
* 施工日期
|
||||
*/
|
||||
var workingDate: String? = null,
|
||||
|
||||
/**
|
||||
* 记录人
|
||||
*/
|
||||
var recordPerson: String? = null,
|
||||
|
||||
/**
|
||||
* 施工班次
|
||||
*/
|
||||
var teamShift: String? = null,
|
||||
|
||||
/**
|
||||
* 施工队伍id
|
||||
*/
|
||||
var teamId: String? = null,
|
||||
|
||||
/**
|
||||
* 施工队伍名称
|
||||
*/
|
||||
var teamName: String? = null,
|
||||
|
||||
/**
|
||||
* 带队班长
|
||||
*/
|
||||
var teamLeader: String? = null,
|
||||
|
||||
/**
|
||||
* 本班进尺
|
||||
*/
|
||||
var workingFootage: String? = null,
|
||||
|
||||
/**
|
||||
* 煤层倾角
|
||||
*/
|
||||
var seamDip: String? = null,
|
||||
|
||||
/**
|
||||
* 煤层高度
|
||||
*/
|
||||
var seamHeight: String? = null,
|
||||
/**
|
||||
* 涌水量
|
||||
*/
|
||||
var waterYield: String? = null,
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
var createTime: String? = "",
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
var updateTime: String? = DateTimeUtil.formatDateTime(LocalDateTime.now()),
|
||||
|
||||
/**
|
||||
* 数据状态:0-默认值,原始数据,1-已修改数据
|
||||
*/
|
||||
var dataState: String = "0",
|
||||
|
||||
/**
|
||||
* 工作面中昨日记录状态:0-默认值,非昨日记录,1-昨日记录
|
||||
*/
|
||||
var latestRecordState: String = "0",
|
||||
|
||||
@Ignore
|
||||
var mineWorkingLithologyList: MutableList<MiningRoofLithologyEntity>? = null,
|
||||
|
||||
@Ignore
|
||||
var operationType: String = "1"
|
||||
): Parcelable
|
||||
+335
@@ -0,0 +1,335 @@
|
||||
package com.zmkg.coaloperation.ui.mining.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bean.WorkOption
|
||||
import com.zmkg.coaloperation.databinding.ActivityAddMiningFaceBinding
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.ui.tunneling.activity.WorkingFaceDetailActivity
|
||||
import com.zmkg.coaloperation.utils.PickerUtil
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 工作面
|
||||
*/
|
||||
class AddMiningFaceActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityAddMiningFaceBinding>(R.layout.activity_add_mining_face) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AddMiningFaceActivity"
|
||||
const val WORK_FACE_TYPE = "WorkFaceType"
|
||||
const val FACE_WORK_DETAIL_DATA = "faceWorkDetailData"
|
||||
}
|
||||
|
||||
enum class WorkFaceType {
|
||||
ADD,//新增
|
||||
|
||||
EDIT,//修改
|
||||
|
||||
SEE//查看
|
||||
}
|
||||
|
||||
private var currentFaceType = WorkFaceType.ADD
|
||||
|
||||
// private val workingFaceViewModel: TunnelWorkingFaceViewModel by lazy {
|
||||
// ViewModelProvider(this)[TunnelWorkingFaceViewModel::class.java]
|
||||
// }
|
||||
private var faceDetail: MiningWorkingFaceEntity? = null
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
val stringExtra = intent.getStringExtra(WORK_FACE_TYPE)
|
||||
if (TextUtils.isEmpty(stringExtra)) {
|
||||
stringExtra == WorkFaceType.ADD.name
|
||||
}
|
||||
when (stringExtra) {
|
||||
WorkFaceType.ADD.name -> {
|
||||
currentFaceType = WorkFaceType.ADD
|
||||
mBinding.confirm.text = "确认新增"
|
||||
// mBinding.toolbarLay.titleTvName.text = "新增工作面"
|
||||
mBinding.toolbarLay.title = "新增工作面"
|
||||
// mBinding.expandLayout.gone()
|
||||
// mBinding.imgExpand.visible()
|
||||
}
|
||||
|
||||
WorkFaceType.EDIT.name -> {
|
||||
currentFaceType = WorkFaceType.EDIT
|
||||
mBinding.confirm.text = "确认修改"
|
||||
// mBinding.toolbarLay.titleTvName.text = "修改工作面"
|
||||
mBinding.toolbarLay.title = "修改工作面"
|
||||
// mBinding.expandLayout.visible()
|
||||
// mBinding.imgExpand.gone()
|
||||
faceDetail =
|
||||
intent.getParcelableExtra(WorkingFaceDetailActivity.Companion.FACE_WORK_DETAIL_DATA) as MiningWorkingFaceEntity?
|
||||
if (faceDetail == null) {
|
||||
showToast("未查询到工作面数据")
|
||||
return
|
||||
}
|
||||
faceDetail?.let {
|
||||
loadDetail(it)
|
||||
}
|
||||
}
|
||||
|
||||
WorkFaceType.SEE.name -> {
|
||||
currentFaceType = WorkFaceType.SEE
|
||||
}
|
||||
}
|
||||
|
||||
// mBinding.etPlanStartDate.let {
|
||||
// it.setOnClickListener { _ ->
|
||||
// showDatePicker(it)
|
||||
// }
|
||||
// }
|
||||
// mBinding.etPlannEndDate.let {
|
||||
// it.setOnClickListener { _ ->
|
||||
// showDatePicker(it)
|
||||
// }
|
||||
// }
|
||||
// mBinding.tvSeamName.setOnClickListener { v ->
|
||||
// PickerUtil.showOptionPicker(this, "请选择所属煤层", DictUtils.seamList) { option ->
|
||||
// mBinding.tvSeamName.text = option.name
|
||||
// mBinding.tvSeamName.tag = option.id
|
||||
// seamAreaList = DictUtils.areaMap[option.id] ?: mutableListOf()
|
||||
// }
|
||||
// }
|
||||
// mBinding.tvAreaName.setOnClickListener { v ->
|
||||
// if (seamAreaList.isEmpty()) {
|
||||
// showToast("请先选择所属煤层")
|
||||
// return@setOnClickListener
|
||||
// }
|
||||
// PickerUtil.showOptionPicker(this, "请选择所属采区域", seamAreaList) { option ->
|
||||
// mBinding.tvAreaName.text = option.name
|
||||
// mBinding.tvAreaName.tag = option.id
|
||||
// }
|
||||
// }
|
||||
// mBinding.tvTunnelNature.setOnClickListener { v ->
|
||||
// PickerUtil.showOptionPicker(
|
||||
// this,
|
||||
// "请选择巷道性质",
|
||||
// DictUtils.seamRoadWayList
|
||||
// ) { option ->
|
||||
// mBinding.tvTunnelNature.text = option.name
|
||||
// mBinding.tvTunnelNature.tag = option.id
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private var seamAreaList: MutableList<WorkOption> = mutableListOf()
|
||||
|
||||
private fun showDatePicker(tv: TextView) {
|
||||
tv.setOnClickListener {
|
||||
PickerUtil.showTimePicker(this, tv.text.toString().trim()) { date ->
|
||||
tv.text = date
|
||||
}
|
||||
}
|
||||
// val cal = Calendar.getInstance()
|
||||
// DatePickerDialog(
|
||||
// this,
|
||||
// { view, year, month, day ->
|
||||
// textView.text = "$year-${numToString(month + 1)}-${numToString(day)}"
|
||||
// },
|
||||
// cal.get(Calendar.YEAR),
|
||||
// cal.get(Calendar.MONTH),
|
||||
// cal.get(Calendar.DAY_OF_MONTH)
|
||||
// )
|
||||
// .show()
|
||||
}
|
||||
|
||||
private fun numToString(num: Int): String {
|
||||
return if (num < 10) "0${num}" else num.toString()
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
mBinding.apply {
|
||||
// addClickViews(imgExpand, confirm)
|
||||
}
|
||||
}
|
||||
|
||||
override fun createObserve() {
|
||||
super.createObserve()
|
||||
}
|
||||
|
||||
override fun processClick(v: View?) {
|
||||
when (v?.id) {
|
||||
// R.id.imgExpand -> {
|
||||
// if (mBinding.expandLayout.isGone) {
|
||||
// mBinding.expandLayout.visible()
|
||||
// mBinding.imgExpand.setImageResource(R.drawable.ic_arrow_up_white2)
|
||||
// } else {
|
||||
// mBinding.expandLayout.gone()
|
||||
// mBinding.imgExpand.setImageResource(R.drawable.ic_arrow_down_white2)
|
||||
// }
|
||||
// }
|
||||
|
||||
R.id.confirm -> {
|
||||
if (currentFaceType == WorkFaceType.ADD) {
|
||||
addNewFace()
|
||||
return
|
||||
}
|
||||
if (currentFaceType == WorkFaceType.EDIT) {
|
||||
editFace()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadDetail(it: MiningWorkingFaceEntity) {
|
||||
// mBinding.etWorkfaceName.setText(it.surfaceName)
|
||||
// mBinding.etTotalFootage.setText("${it.totalFootage}")
|
||||
// mBinding.tvSeamName.tag = it.seamId
|
||||
// mBinding.tvSeamName.text = it.seamName
|
||||
// mBinding.tvAreaName.tag = it.areaId
|
||||
// mBinding.tvAreaName.text = it.areaName
|
||||
// mBinding.etSurfaceAzimuth.setText(it.surfaceAzimuth)
|
||||
// mBinding.etSurfaceHeight.setText(it.surfaceHeight)
|
||||
// mBinding.etSurfaceWidth.setText(it.surfaceWidth)
|
||||
// mBinding.tvTunnelNature.text = it.tunnelNature
|
||||
//
|
||||
// mBinding.etPlanStartDate.text = it.planStartDate
|
||||
// mBinding.etPlannEndDate.text = it.planEndDate
|
||||
//
|
||||
// mBinding.etGeologicalType.setText(it.geologicalType)
|
||||
// mBinding.etHydrogeologicalType.setText(it.hydrogeologicalType)
|
||||
// mBinding.etSeamIgnition.setText(it.seamIgnition)
|
||||
// mBinding.etSeamGas.setText(it.seamGas)
|
||||
// mBinding.etSeamBumpPressure.setText(it.seamBumpPressure)
|
||||
// mBinding.etSurfaceSupportForm.setText(it.surfaceSupportForm)
|
||||
}
|
||||
|
||||
private fun addNewFace() {
|
||||
// val workingFaceName = mBinding.etWorkfaceName.text.toString().trim()
|
||||
// if (TextUtils.isEmpty(workingFaceName)) {
|
||||
// showToast("请输入工作面名称")
|
||||
// return
|
||||
// }
|
||||
// val totalFootageStr = mBinding.etTotalFootage.text.toString().trim()
|
||||
// if (TextUtils.isEmpty(totalFootageStr)) {
|
||||
// showToast("请输入总进尺")
|
||||
// return
|
||||
// }
|
||||
// try {
|
||||
// totalFootageStr.toDouble()
|
||||
// } catch (e: Exception) {
|
||||
// e.printStackTrace()
|
||||
// showToast("总进尺数据非数字格式,请确认")
|
||||
// return
|
||||
// }
|
||||
//// mViewModel.postTunnellingSurfaceAdd(
|
||||
//// TunnelingFaceAddBean(
|
||||
//// surfaceName = mBinding.etWorkfaceName.text.toString(),
|
||||
//// totalFootage = mBinding.etTotalFootage.text.toString()
|
||||
//// )
|
||||
//// )
|
||||
// val workingFaceEntity = TunnelWorkingFaceEntity().also {
|
||||
// it.surfaceId = System.currentTimeMillis()
|
||||
// it.surfaceName = workingFaceName
|
||||
// it.totalFootage = totalFootageStr
|
||||
//
|
||||
// it.seamName = mBinding.tvSeamName.text.toString().trim()
|
||||
// if (it.seamName!!.isNotBlank()) {
|
||||
// it.seamId = mBinding.tvSeamName.tag.toString().toLong()
|
||||
// }
|
||||
// it.areaName = mBinding.tvAreaName.text.toString().trim()
|
||||
// if (it.areaName!!.isNotBlank()) {
|
||||
// it.areaId = mBinding.tvAreaName.tag.toString().toLong()
|
||||
// }
|
||||
//
|
||||
// it.surfaceAzimuth = mBinding.etSurfaceAzimuth.text.toString().trim()
|
||||
// it.surfaceHeight = mBinding.etSurfaceHeight.text.toString().trim()
|
||||
// it.surfaceWidth = mBinding.etSurfaceWidth.text.toString().trim()
|
||||
// it.tunnelNature = mBinding.tvTunnelNature.text.toString().trim()
|
||||
// it.planStartDate = mBinding.etPlanStartDate.text.toString().trim()
|
||||
// it.planEndDate = mBinding.etPlannEndDate.text.toString().trim()
|
||||
// it.geologicalType = mBinding.etGeologicalType.text.toString().trim()
|
||||
// it.hydrogeologicalType = mBinding.etHydrogeologicalType.text.toString().trim()
|
||||
// it.seamIgnition = mBinding.etSeamIgnition.text.toString().trim()
|
||||
// it.seamGas = mBinding.etSeamGas.text.toString().trim()
|
||||
// it.seamBumpPressure = mBinding.etSeamBumpPressure.text.toString().trim()
|
||||
// it.surfaceSupportForm = mBinding.etSurfaceSupportForm.text.toString().trim()
|
||||
//
|
||||
// it.createTime = DateTimeUtil.formatDateTime(LocalDateTime.now())
|
||||
// it.dataState = "1"
|
||||
// }
|
||||
// workingFaceViewModel.insert(workingFaceEntity) {
|
||||
// showToast("工作面新增完成")
|
||||
// EventBus.getDefault().post(workingFaceEntity)
|
||||
// finish()
|
||||
// }
|
||||
}
|
||||
|
||||
private fun editFace() {
|
||||
// val workingFaceName = mBinding.etWorkfaceName.text.toString().trim()
|
||||
// if (TextUtils.isEmpty(workingFaceName)) {
|
||||
// showToast("请输入工作面名称")
|
||||
// return
|
||||
// }
|
||||
// val totalFootageStr = mBinding.etTotalFootage.text.toString().trim()
|
||||
// if (TextUtils.isEmpty(totalFootageStr)) {
|
||||
// showToast("请输入总进尺")
|
||||
// return
|
||||
// }
|
||||
// try {
|
||||
// totalFootageStr.toDouble()
|
||||
// } catch (e: Exception) {
|
||||
// e.printStackTrace()
|
||||
// showToast("总进尺数据非数字格式,请确认")
|
||||
// return
|
||||
// }
|
||||
// val workingFaceEntity = TunnelWorkingFaceEntity().also {
|
||||
// it.surfaceId = faceDetail!!.surfaceId
|
||||
// it.surfaceName = workingFaceName
|
||||
// it.totalFootage = totalFootageStr
|
||||
//
|
||||
// it.seamName = mBinding.tvSeamName.text.toString().trim()
|
||||
// if (it.seamName!!.isNotBlank()) {
|
||||
// it.seamId = string2num(mBinding.tvSeamName.tag.toString())
|
||||
// }
|
||||
// it.areaName = mBinding.tvAreaName.text.toString().trim()
|
||||
// if (it.areaName!!.isNotBlank()) {
|
||||
// it.areaId = string2num(mBinding.tvAreaName.tag.toString())
|
||||
// }
|
||||
//
|
||||
// it.surfaceAzimuth = mBinding.etSurfaceAzimuth.text.toString().trim()
|
||||
// it.surfaceHeight = mBinding.etSurfaceHeight.text.toString().trim()
|
||||
// it.surfaceWidth = mBinding.etSurfaceWidth.text.toString().trim()
|
||||
// it.tunnelNature = mBinding.tvTunnelNature.text.toString().trim()
|
||||
// it.planStartDate = mBinding.etPlanStartDate.text.toString().trim()
|
||||
// it.planEndDate = mBinding.etPlannEndDate.text.toString().trim()
|
||||
// it.geologicalType = mBinding.etGeologicalType.text.toString().trim()
|
||||
// it.hydrogeologicalType = mBinding.etHydrogeologicalType.text.toString().trim()
|
||||
// it.seamIgnition = mBinding.etSeamIgnition.text.toString().trim()
|
||||
// it.seamGas = mBinding.etSeamGas.text.toString().trim()
|
||||
// it.seamBumpPressure = mBinding.etSeamBumpPressure.text.toString().trim()
|
||||
// it.surfaceSupportForm = mBinding.etSurfaceSupportForm.text.toString().trim()
|
||||
//
|
||||
// it.createTime = DateTimeUtil.formatDateTime(LocalDateTime.now())
|
||||
// it.dataState = "1"
|
||||
// }
|
||||
// workingFaceViewModel.update(workingFaceEntity) {
|
||||
// showToast("工作面修改完成")
|
||||
// EventBus.getDefault().post(workingFaceEntity)
|
||||
// finish()
|
||||
// }
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: MiningWorkingFaceEntity) {
|
||||
|
||||
}
|
||||
|
||||
private fun string2num(text: String?): Long {
|
||||
return if (text.isNullOrBlank()) 0 else text.toLong()
|
||||
}
|
||||
|
||||
}
|
||||
+168
@@ -1,20 +1,113 @@
|
||||
package com.zmkg.coaloperation.ui.mining.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.MiningWorkingFaceAdapter
|
||||
import com.zmkg.coaloperation.adapter.MiningWorkingFaceRecordAdapter
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingFaceAdapter
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingFaceRecordAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.databinding.ActivityMiningBinding
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.db.entity.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.entity.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.ui.tunneling.activity.AddWorkingFaceRecordActivity
|
||||
import com.zmkg.coaloperation.ui.tunneling.activity.WorkingFaceStatisticsActivity
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 回采首页列表
|
||||
*/
|
||||
class MiningActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityMiningBinding>(R.layout.activity_mining) {
|
||||
|
||||
private val workingFaceList = mutableListOf<MiningWorkingFaceEntity>()
|
||||
|
||||
private val workingFaceAdapter: MiningWorkingFaceAdapter by lazy {
|
||||
MiningWorkingFaceAdapter(workingFaceList).apply {
|
||||
setOnItemChildClickListener { _, view, position ->
|
||||
if (view.id == R.id.llWorkingFace) {
|
||||
toActivity(MiningFaceStatisticsActivity::class.java, Bundle().apply {
|
||||
putParcelable(WorkingFaceStatisticsActivity.FACE_DETAIL, workingFaceList[position])
|
||||
})
|
||||
return@setOnItemChildClickListener
|
||||
}
|
||||
if (view.id == R.id.ivExpandRecord) {
|
||||
val expandState = view.tag.toString().toBooleanStrictOrNull() ?: false
|
||||
workingFaceList[position].isExpandRecord = expandState.not()
|
||||
if (workingFaceList[position].isExpandRecord) {
|
||||
getFaceRecord(position)
|
||||
} else {
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
return@setOnItemChildClickListener
|
||||
}
|
||||
if (view.id == R.id.start_record) {
|
||||
// toActivity(AddWorkingFaceRecordActivity::class.java, Bundle().apply {
|
||||
// putLong(
|
||||
// AddWorkingFaceRecordActivity.FACE_ID,
|
||||
// workingFaceList[position].surfaceId
|
||||
// )
|
||||
// putString(
|
||||
// AddWorkingFaceRecordActivity.FACE_NAME,
|
||||
// workingFaceList[position].surfaceName
|
||||
// )
|
||||
// putInt(AddWorkingFaceRecordActivity.SHOW_TYPE, 0)
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.title = "回采上报"
|
||||
mBinding.toolbarLay.rightText = "新增工作面"
|
||||
mBinding.rvMiningList.let {
|
||||
it.layoutManager = LinearLayoutManager(this)
|
||||
it.adapter = workingFaceAdapter
|
||||
}
|
||||
val surfaceId01 = System.currentTimeMillis()
|
||||
val surfaceId02 = System.currentTimeMillis()
|
||||
val surfaceId03 = System.currentTimeMillis()
|
||||
val recordList = mutableListOf<MiningWorkingFaceRecordEntity>()
|
||||
recordList.add(MiningWorkingFaceRecordEntity(
|
||||
recordId = System.currentTimeMillis(),
|
||||
surfaceId = surfaceId01,
|
||||
recordPerson = "张三",
|
||||
workingDate = "2025-09-19 10:50:15"
|
||||
))
|
||||
recordList.add(MiningWorkingFaceRecordEntity(
|
||||
recordId = System.currentTimeMillis(),
|
||||
surfaceId = surfaceId01,
|
||||
recordPerson = "李四",
|
||||
workingDate = "2025-09-19 15:10:39"
|
||||
))
|
||||
workingFaceList.add(MiningWorkingFaceEntity(
|
||||
surfaceId = surfaceId01,
|
||||
surfaceName = "250919回采工作面",
|
||||
totalFootage = "256",
|
||||
createTime = "2025-09-19 10:27:43",
|
||||
records = recordList
|
||||
))
|
||||
workingFaceList.add(MiningWorkingFaceEntity(
|
||||
surfaceId = surfaceId02,
|
||||
surfaceName = "250901回采工作面",
|
||||
totalFootage = "256",
|
||||
createTime = "2025-09-01 08:20:43"
|
||||
))
|
||||
workingFaceList.add(MiningWorkingFaceEntity(
|
||||
surfaceId = surfaceId03,
|
||||
surfaceName = "250810回采工作面",
|
||||
totalFootage = "256",
|
||||
createTime = "2025-09-19 09:09:03"
|
||||
))
|
||||
workingFaceAdapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
@@ -26,4 +119,79 @@ class MiningActivity :
|
||||
override fun processClick(v: View?) {
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun getFaceRecord(position: Int) {
|
||||
workingFaceList[position].records?.let {
|
||||
if (it.isNotEmpty()) {
|
||||
val recordAdapter = getRecordAdapter(position)
|
||||
recordAdapter.apply {
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
workingFaceAdapter.notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
// val surfaceId = workingFaceList[position].surfaceId
|
||||
// workingFaceRecordViewModel.getEntityList(surfaceId) { recordEntities ->
|
||||
// if (recordEntities.isNullOrEmpty()) {
|
||||
// workingFaceAdapter.notifyItemChanged(position)
|
||||
// return@getEntityList
|
||||
// }
|
||||
// val recordAdapter = getRecordAdapter(position)
|
||||
// recordAdapter.apply {
|
||||
// list.clear()
|
||||
//// list.add(FACE_RECORD_HEADER)
|
||||
// list.addAll(recordEntities)
|
||||
// notifyDataSetChanged()
|
||||
// }
|
||||
// workingFaceAdapter.notifyItemChanged(position)
|
||||
// }
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: MiningWorkingFaceEntity) {
|
||||
val index = workingFaceList.indexOfFirst { it.surfaceId == event.surfaceId }
|
||||
if (index == -1) {
|
||||
//新增工作面
|
||||
val insertIndex = 0
|
||||
workingFaceList.add(0,event)
|
||||
workingFaceAdapter.notifyItemInserted(insertIndex)
|
||||
workingFaceAdapter.notifyItemRangeChanged(insertIndex, insertIndex+1)
|
||||
return
|
||||
}
|
||||
//修改工作面
|
||||
// workingFaceViewModel.getEntityById(event.surfaceId) { entity ->
|
||||
// workingFaceList[index] = entity
|
||||
// workingFaceAdapter.notifyItemChanged(index)
|
||||
// }
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFaceRecordEvent(event: MiningWorkingFaceRecordEntity) {
|
||||
val position = workingFaceList.indexOfFirst { it.surfaceId == event.surfaceId }
|
||||
val faceEntity = workingFaceList[position]
|
||||
if (faceEntity.isExpandRecord.not()) {
|
||||
return
|
||||
}
|
||||
faceEntity.records?.let { records ->
|
||||
val index = records.indexOfFirst { it.recordId == event.recordId }
|
||||
if (index == -1) {
|
||||
records.add(0,event)
|
||||
} else {
|
||||
records[index] = event
|
||||
}
|
||||
}
|
||||
val recordAdapter = getRecordAdapter(position)
|
||||
recordAdapter.notifyDataSetChanged()
|
||||
|
||||
workingFaceAdapter.notifyItemChanged(position)
|
||||
}
|
||||
|
||||
@SuppressLint("SuspiciousIndentation")
|
||||
private fun getRecordAdapter(position:Int):MiningWorkingFaceRecordAdapter {
|
||||
val viewHolder =
|
||||
mBinding.rvMiningList.findViewHolderForLayoutPosition(position) as MiningWorkingFaceAdapter.VH
|
||||
return viewHolder.binding.rvFaceRecord.adapter as MiningWorkingFaceRecordAdapter
|
||||
}
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.zmkg.coaloperation.ui.mining.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingItemAdapter
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityMiningFaceDetailBinding
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceEntity
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 工作面详情
|
||||
*/
|
||||
class MiningFaceDetailActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityMiningFaceDetailBinding>(R.layout.activity_mining_face_detail) {
|
||||
companion object {
|
||||
const val FACE_WORK_DETAIL_DATA = "MiningFaceDetailActivity"
|
||||
}
|
||||
|
||||
private val list: MutableList<TunnelWorkingItem> = mutableListOf()
|
||||
|
||||
// private var detail:FaceWorkDetailBean?=null
|
||||
private var detail: MiningWorkingFaceEntity? = null
|
||||
private val adapter by lazy {
|
||||
TunnelWorkingItemAdapter(list)
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.vLine.visibility = View.GONE
|
||||
mBinding.toolbarLay.rightText = "修改"
|
||||
|
||||
mBinding.rvFaceList.let {
|
||||
it.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
it.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
detail = intent.getParcelableExtra(FACE_WORK_DETAIL_DATA)
|
||||
detail?.let {
|
||||
loadFaceDetail(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
toActivity(AddMiningFaceActivity::class.java, Bundle().apply {
|
||||
putString(AddMiningFaceActivity.Companion.WORK_FACE_TYPE, AddMiningFaceActivity.WorkFaceType.EDIT.name)
|
||||
// putSerializable(WorkFaceActivity.FACE_WORK_DETAIL_DATA, detail)
|
||||
putParcelable(AddMiningFaceActivity.Companion.FACE_WORK_DETAIL_DATA, detail)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun processClick(v: View?) {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun loadFaceDetail(it: MiningWorkingFaceEntity) {
|
||||
mBinding.toolbarLay.title = it.surfaceName
|
||||
list.clear()
|
||||
list.add(TunnelWorkingItem(name = "工作面名称", value = it.surfaceName))
|
||||
list.add(TunnelWorkingItem(name = "水平", value = "水平"))
|
||||
list.add(TunnelWorkingItem(name = "煤层", value = "煤层"))
|
||||
list.add(TunnelWorkingItem(name = "采区", value = "采区"))
|
||||
list.add(TunnelWorkingItem(name = "储量", value = "储量"))
|
||||
list.add(TunnelWorkingItem(name = "胶带巷安全出口宽度", value = "宽度"))
|
||||
list.add(TunnelWorkingItem(name = "回风巷安全出口宽度", value = "宽度"))
|
||||
list.add(TunnelWorkingItem(name = "走向长度", value = "长度"))
|
||||
list.add(TunnelWorkingItem(name = "倾向长度", value = "长度"))
|
||||
list.add(TunnelWorkingItem(name = "胶带巷长度", value = "长度"))
|
||||
list.add(TunnelWorkingItem(name = "回风巷长度", value = "长度"))
|
||||
list.add(TunnelWorkingItem(name = "切眼长度", value = "长度"))
|
||||
list.add(TunnelWorkingItem(name = "平均煤厚", value = "煤厚"))
|
||||
list.add(TunnelWorkingItem(name = "平均煤厚", value = "容积"))
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: MiningWorkingFaceEntity) {
|
||||
detail = event
|
||||
detail?.let {
|
||||
loadFaceDetail(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
+225
@@ -0,0 +1,225 @@
|
||||
package com.zmkg.coaloperation.ui.mining.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingItemAdapter
|
||||
import com.zmkg.coaloperation.adapter.common.DisasterAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityMiningFaceStatisticsBinding
|
||||
import com.zmkg.coaloperation.db.entity.mining.MiningWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
import com.zmkg.coaloperation.utils.formatDecimalString
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.roundedOneDecimalPlace
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* 工作面详情
|
||||
*/
|
||||
class MiningFaceStatisticsActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityMiningFaceStatisticsBinding>(R.layout.activity_mining_face_statistics) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "MiningFaceStatisticsActivity"
|
||||
const val FACE_DETAIL = "faceDetail"
|
||||
}
|
||||
|
||||
// private val workingFaceRecordViewModel: TunnelWorkingFaceRecordViewModel by lazy {
|
||||
// ViewModelProvider(this)[TunnelWorkingFaceRecordViewModel::class.java]
|
||||
// }
|
||||
//
|
||||
// private val roofLithologyViewModel: TunnelRoofLithologyViewModel by lazy {
|
||||
// ViewModelProvider(this)[TunnelRoofLithologyViewModel::class.java]
|
||||
// }
|
||||
// private val tunnelingRockNatureAdapter: TunnelingRockNatureAdapter by lazy {
|
||||
// TunnelingRockNatureAdapter(lithologyList)
|
||||
// }
|
||||
|
||||
// private val lithologyList:MutableList<TunnelRoofLithologyEntity> = mutableListOf()
|
||||
|
||||
private var faceDetail: MiningWorkingFaceEntity? = null
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.rightText = "查看详情"
|
||||
mBinding.toolbarLay.vLine.visibility = View.GONE
|
||||
// mBinding.rvRockNature.adapter = tunnelingRockNatureAdapter
|
||||
|
||||
mBinding.arcViewGreen.let {
|
||||
it.arcColor = "#30E0A1".toColorInt()
|
||||
it.startAngle = 0f
|
||||
it.sweepAngle = 360f
|
||||
it.strokeWidth = 12f
|
||||
it.radius = ScreenUtil.dp2px(122f - 12f) / 2f
|
||||
}
|
||||
|
||||
mBinding.arcViewRed.let {
|
||||
it.arcColor = "#FA2256".toColorInt()
|
||||
it.startAngle = -90f
|
||||
it.strokeWidth = 10f
|
||||
it.sweepAngle = 0f
|
||||
it.radius = ScreenUtil.dp2px(100f - 10f) / 2f
|
||||
}
|
||||
|
||||
mBinding.arcViewBlue.let {
|
||||
it.arcColor = "#246CF9".toColorInt()
|
||||
it.startAngle = -90f
|
||||
it.strokeWidth = 10f
|
||||
it.sweepAngle = 0f
|
||||
it.radius = ScreenUtil.dp2px(80f - 10f) / 2f
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
// val surfaceId = intent.getStringExtra("surfaceId")
|
||||
// if (TextUtils.isEmpty(surfaceId)) {
|
||||
// finish()
|
||||
// } else {
|
||||
// mViewModel.getTunnelingSurfaceDetail(surfaceId)
|
||||
// }
|
||||
faceDetail = intent.getParcelableExtra(FACE_DETAIL)
|
||||
|
||||
faceDetail?.let { detail ->
|
||||
loadFaceDetail()
|
||||
// workingFaceRecordViewModel.getLastEntity(detail.surfaceId) { record ->
|
||||
// record?.let {
|
||||
// mBinding.tvYesterdayLen.text = "${it.workingFootage?.formatDecimalString()}m"
|
||||
// mBinding.tvWorkingFaceAngle.text = "${it.seamDip?.formatDecimalString()}°"
|
||||
//// mBinding.tvMonthAccumulateLen.text = "${it.monthFootage}m"
|
||||
// mBinding.tvWorkingFaceWater.text = "${it.waterYield?.formatDecimalString()}"
|
||||
//
|
||||
// roofLithologyViewModel.getEntityList(it.recordId) { list ->
|
||||
// list?.let {
|
||||
// lithologyList.addAll(it)
|
||||
// tunnelingRockNatureAdapter.notifyDataSetChanged()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
toActivity(MiningFaceDetailActivity::class.java, Bundle().apply {
|
||||
putParcelable(MiningFaceDetailActivity.FACE_WORK_DETAIL_DATA, faceDetail)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun processClick(v: View?) {
|
||||
}
|
||||
|
||||
override fun createObserve() {
|
||||
super.createObserve()
|
||||
}
|
||||
|
||||
private fun stringToDouble(numText: String?): Double {
|
||||
if (numText.isNullOrEmpty() || numText.isBlank()) return 0.toDouble()
|
||||
return numText.toDouble()
|
||||
}
|
||||
|
||||
private fun loadFaceDetail() {
|
||||
val bean = faceDetail!!
|
||||
mBinding.apply {
|
||||
toolbarLay.title = bean.surfaceName
|
||||
bean.totalFootage = "6000"
|
||||
bean.accumulativeFootage = "1400.3"
|
||||
|
||||
val total = stringToDouble(bean.totalFootage)
|
||||
val accumulative = stringToDouble(bean.accumulativeFootage)
|
||||
val remaining = total - accumulative
|
||||
// val remaining = stringToDouble(bean.remainingFootage)
|
||||
bean.remainingFootage = "${remaining.roundedOneDecimalPlace()}"
|
||||
|
||||
tvLenTotal.text = "总进尺:${bean.totalFootage?.formatDecimalString()}/吨"
|
||||
tvLenAccumulate.text = "累计进尺:${bean.accumulativeFootage?.formatDecimalString()}/吨"
|
||||
tvLenRemain.text = "剩余进尺:${bean.remainingFootage?.formatDecimalString()}/吨"
|
||||
|
||||
//累计进尺占比
|
||||
var radio = 0
|
||||
|
||||
//累计进尺圆圈占比
|
||||
var arcViewRadio: Float
|
||||
|
||||
if (accumulative >= total) {
|
||||
radio = 100
|
||||
arcViewRadio = 360F
|
||||
} else if (accumulative <= 0) {
|
||||
radio = 0
|
||||
arcViewRadio = 0F
|
||||
} else {
|
||||
arcViewRadio = (accumulative * 100F / total).toFloat()
|
||||
radio = arcViewRadio.roundToInt()
|
||||
}
|
||||
|
||||
arcViewRed.let {
|
||||
it.sweepAngle = arcViewRadio
|
||||
}
|
||||
|
||||
arcViewBlue.let {
|
||||
it.sweepAngle = (360F - arcViewRadio)
|
||||
//* -1F
|
||||
}
|
||||
|
||||
|
||||
mBinding.tvCompleteRate.text = "$radio%"
|
||||
|
||||
// tvYesterdayLen.text = "${bean?.yesterdayFootage}m"
|
||||
// tvWorkingFaceAngle.text = "${bean?.latestRecord?.seamDip.orEmptyDefaultInt()}"
|
||||
// tvMonthAccumulateLen.text = "${bean?.monthFootage}m"
|
||||
// tvWorkingFaceWater.text = "${bean?.latestRecord?.waterYield.orEmptyDefaultInt()}m"
|
||||
|
||||
// val list = bean?.latestRecord?.mineWorkingLithologyList
|
||||
// if (list.isNullOrEmpty()) {
|
||||
// tvYesterdayRockType.visibility = View.GONE
|
||||
// } else {
|
||||
// tvYesterdayRockType.visibility = View.VISIBLE
|
||||
// tunnelingRockNatureAdapter.setNewInstance(list)
|
||||
// }
|
||||
|
||||
}
|
||||
val workingItemList = mutableListOf<TunnelWorkingItem>()
|
||||
workingItemList.add(TunnelWorkingItem(name = "昨日进尺", value = "123"))
|
||||
workingItemList.add(TunnelWorkingItem(name = "出煤量", value = "12"))
|
||||
workingItemList.add(TunnelWorkingItem(name = "胶运巷回采位置", value = "3"))
|
||||
workingItemList.add(TunnelWorkingItem(name = "胶运巷安全出口宽度", value = "23"))
|
||||
workingItemList.add(TunnelWorkingItem(name = "回风巷回采位置", value = "5"))
|
||||
workingItemList.add(TunnelWorkingItem(name = "回风巷安全出口宽度", value = "56"))
|
||||
mBinding.rvBaseList.let {
|
||||
it.layoutManager = LinearLayoutManager(this)
|
||||
it.adapter = TunnelWorkingItemAdapter(workingItemList)
|
||||
}
|
||||
|
||||
val disasterList = mutableListOf<TunnelWorkingItem>()
|
||||
disasterList.add(TunnelWorkingItem(name = "AAA", value = "80"))
|
||||
disasterList.add(TunnelWorkingItem(name = "BBB", value = "50"))
|
||||
disasterList.add(TunnelWorkingItem(name = "CCC", value = "135"))
|
||||
mBinding.rvDisasterList.let {
|
||||
it.layoutManager = LinearLayoutManager(this)
|
||||
it.adapter = DisasterAdapter(disasterList)
|
||||
}
|
||||
|
||||
mBinding.included.let {
|
||||
it.tvItemName.text="回采工作面涌水量"
|
||||
it.tvItemValue.text="3.6m³/h"
|
||||
it.divider.gone()
|
||||
it.root.setBackgroundResource(R.drawable.bg_stroke_gray)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: MiningWorkingFaceEntity) {
|
||||
faceDetail = event
|
||||
loadFaceDetail()
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -71,7 +71,7 @@ class WorkingFaceStatisticsActivity :
|
||||
it.startAngle = -90f
|
||||
it.strokeWidth = 10f
|
||||
it.sweepAngle = 0f
|
||||
it.radius = ScreenUtil.dp2px(100f - 10f) / 2f
|
||||
it.radius = ScreenUtil.dp2px(80f - 10f) / 2f
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.math.BigDecimal
|
||||
import java.math.RoundingMode
|
||||
|
||||
fun View.clickWithDebounce(delay: Long = 300, action: () -> Unit) {
|
||||
var job: Job? = null
|
||||
@@ -82,4 +84,8 @@ fun String.formatDecimalString(): String {
|
||||
}
|
||||
}
|
||||
|
||||
fun Double.roundedOneDecimalPlace(): Double {
|
||||
return BigDecimal(this).setScale(1, RoundingMode.HALF_UP).toDouble()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar_lay"
|
||||
layout="@layout/lay_title_right_bar" />
|
||||
<!-- app:title="@{@string/title_work_face}"-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvFaceList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@drawable/bg_stroke_gray"/>
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/imgExpand"-->
|
||||
<!-- android:layout_width="60dp"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:paddingStart="15dp"-->
|
||||
<!-- android:paddingEnd="15dp"-->
|
||||
<!-- android:layout_gravity="center_horizontal"-->
|
||||
<!-- android:src="@drawable/ic_arrow_down_white2"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- tools:ignore="ContentDescription"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
</LinearLayout>
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:text="确认新增"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
app:shapeCornersRadius="30dp"
|
||||
app:shapeSolidColor="#21A69A" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
tools:ignore="HardcodedText,TooManyViews">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar_lay"
|
||||
layout="@layout/lay_title_right_bar" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvFaceList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
tools:itemCount="20"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_tunnel_working_item"
|
||||
android:background="@drawable/bg_stroke_gray"/>
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
tools:ignore="HardcodedText,TooManyViews">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar_lay"
|
||||
layout="@layout/lay_title_right_bar" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:overScrollMode="never">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="进度信息"
|
||||
android:textColor="@color/white"
|
||||
app:drawableStartCompat="@drawable/line_green" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="152dp"
|
||||
android:background="@drawable/bg_stroke_gray">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLenTotal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
app:drawableStartCompat="@drawable/shape_flag_green"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvLenAccumulate"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="进度信息" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLenAccumulate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
app:drawableStartCompat="@drawable/shape_flag_red"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvLenRemain"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvLenTotal"
|
||||
tools:text="进度信息" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLenRemain"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
app:drawableStartCompat="@drawable/shape_flag_blue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvLenAccumulate"
|
||||
tools:text="进度信息" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="122dp"
|
||||
android:layout_height="122dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.zmkg.coaloperation.view.CircleArcView
|
||||
android:id="@+id/arcViewGreen"
|
||||
android:layout_width="122dp"
|
||||
android:layout_height="122dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CircleArcView
|
||||
android:id="@+id/arcViewRed"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CircleArcView
|
||||
android:id="@+id/arcViewBlue"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCompleteRate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
tools:text="64%" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="基础信息"
|
||||
android:textColor="@color/white"
|
||||
app:drawableStartCompat="@drawable/line_green" />
|
||||
|
||||
<com.zmkg.coaloperation.view.NestedRecyclerView
|
||||
android:id="@+id/rvBaseList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_stroke_gray"
|
||||
tools:itemCount="6"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_tunnel_working_item" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="隐蔽致灾预报"
|
||||
android:textColor="@color/white"
|
||||
app:drawableStartCompat="@drawable/line_green" />
|
||||
|
||||
<com.zmkg.coaloperation.view.NestedRecyclerView
|
||||
android:id="@+id/rvDisasterList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_stroke_gray"
|
||||
tools:itemCount="3"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_mining_disaster_warning" />
|
||||
|
||||
<include
|
||||
android:id="@+id/included"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_stroke_gray"
|
||||
layout="@layout/list_item_tunnel_working_item"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
@@ -469,6 +469,7 @@
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:maxWidth="80dp"
|
||||
android:minWidth="60dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
@@ -491,6 +492,8 @@
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:maxWidth="80dp"
|
||||
android:minWidth="60dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
@@ -535,6 +538,7 @@
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:maxWidth="80dp"
|
||||
android:minWidth="60dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
@@ -557,6 +561,8 @@
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:maxWidth="80dp"
|
||||
android:minWidth="60dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDisasterName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_solid_black"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:maxWidth="80dp"
|
||||
android:minWidth="60dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:text=""/>
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="距离回采位置"
|
||||
android:textColor="#6A6F87"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDisasterValue"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_solid_black"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:maxWidth="80dp"
|
||||
android:minWidth="60dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="m"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:dividerColor="#20222B" />
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
@@ -18,7 +18,7 @@
|
||||
android:id="@+id/tvItemName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
@@ -54,7 +54,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tvItemName"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user