|
|
@@ -1,23 +1,54 @@
|
|
|
package com.grkj.iscs.view.fragment
|
|
|
|
|
|
+import android.widget.ImageView
|
|
|
+import com.grkj.iscs.R
|
|
|
import com.grkj.iscs.databinding.FragmentStepBinding
|
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
|
import com.grkj.iscs.view.iview.IStepView
|
|
|
import com.grkj.iscs.view.presenter.StepPresenter
|
|
|
+import com.zhy.adapter.recyclerview.CommonAdapter
|
|
|
+import com.zhy.adapter.recyclerview.base.ViewHolder
|
|
|
|
|
|
/**
|
|
|
* 作业票执行步骤页 - 八大步骤
|
|
|
*/
|
|
|
class StepFragment : BaseMvpFragment<IStepView, StepPresenter, FragmentStepBinding>() {
|
|
|
|
|
|
+ private lateinit var mStepList: MutableList<StepBO>
|
|
|
+
|
|
|
override val viewBinding: FragmentStepBinding
|
|
|
get() = FragmentStepBinding.inflate(layoutInflater)
|
|
|
|
|
|
override fun initView() {
|
|
|
-
|
|
|
+ mStepList = mutableListOf(
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.recognize_work_content), false, 1),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.power_isolation_way), false, 2),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.notice_worker), false, 3),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.shutdown), false, 4),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.unlock_and_restore_switch), false, 8),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.check_before_unlocking), false, 7),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.ensure_power_isolation), false, 6),
|
|
|
+ StepBO(R.mipmap.icon1, getString(R.string.lock_and_hang_a_sign), false, 5)
|
|
|
+ )
|
|
|
+ mBinding?.rvStep?.adapter = object : CommonAdapter<StepBO>(requireContext(), R.layout.item_rv_step, mStepList) {
|
|
|
+ override fun convert(holder: ViewHolder, step: StepBO, position: Int) {
|
|
|
+ if (step.index == 4) {
|
|
|
+ holder.setVisible(R.id.iv_arrow_right, false)
|
|
|
+ holder.setVisible(R.id.iv_arrow_bottom, true)
|
|
|
+ } else if (step.index == 5) {
|
|
|
+ holder.setVisible(R.id.iv_arrow_right, false)
|
|
|
+ } else if (step.index > 5) {
|
|
|
+ holder.getView<ImageView>(R.id.iv_arrow_right).rotation = 180f
|
|
|
+ }
|
|
|
+ holder.setText(R.id.tv_index, step.index.toString())
|
|
|
+ holder.setText(R.id.tv_status, if (step.isDone) getString(R.string.executed) else getString(R.string.not_executed))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun initPresenter(): StepPresenter {
|
|
|
return StepPresenter()
|
|
|
}
|
|
|
+
|
|
|
+ data class StepBO(val pic: Int, val title: String, val isDone: Boolean = false, val index: Int)
|
|
|
}
|