| | |
| | | package cn.flightfeather.thirdappmodule.module.inspection |
| | | |
| | | import android.arch.lifecycle.ViewModelProviders |
| | | import android.databinding.DataBindingUtil |
| | | import android.os.Bundle |
| | | import android.view.View |
| | | import android.widget.TextView |
| | | import cn.flightfeather.thirdappmodule.R |
| | | import cn.flightfeather.thirdappmodule.bean.entity.Scense |
| | | import cn.flightfeather.thirdappmodule.databinding.DialogSceneHistory2Binding |
| | | import cn.flightfeather.thirdappmodule.databinding.SceneHistoryViewModel |
| | | import cn.flightfeather.thirdappmodule.module.base.BaseActivity |
| | | import cn.flightfeather.thirdappmodule.module.task.SceneDetailViewModel |
| | | import kotlinx.android.synthetic.main.dialog_scene_history.* |
| | | import kotlinx.android.synthetic.main.fragment_analysis_over_view.* |
| | | |
| | | /** |
| | | * 场景历史情况提示界面 |
| | | * Date: 2025/10/27 |
| | | */ |
| | | class MenuSceneHistoryActivity : BaseActivity() { |
| | | inner class HistoryItemView(val title: String, val show: Boolean, val parentView: View, val titleView: TextView) |
| | | |
| | | // 传入的场景对象 |
| | | private var scene: Scense? = null |
| | | |
| | | override fun getLayoutId(): Int = R.layout.dialog_scene_history |
| | | // override fun getLayoutId(): Int = R.layout.dialog_scene_history_2 |
| | | override fun getLayoutId(): Int? = null |
| | | |
| | | lateinit var viewModel: MenuSceneHistoryViewModel |
| | | lateinit var viewModel: SceneHistoryViewModel |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | |
| | | viewModel = ViewModelProviders.of(this).get(SceneDetailViewModel::class.java) |
| | | viewModel = ViewModelProviders.of(this).get(SceneHistoryViewModel::class.java) |
| | | |
| | | scene = intent.getSerializableExtra("scene") as Scense? |
| | | |
| | | initUI() |
| | | initObserver() |
| | | initListener() |
| | | |
| | | viewModel.getSceneStatus { |
| | | scene?.let { viewModel.getSceneDetail(it) } |
| | | } |
| | | } |
| | | |
| | | private fun initUI() { |
| | | view_waiting.visibility = View.VISIBLE |
| | | scene?.let { |
| | | tv_status.text = StringBuilder(it.type + getString(R.string.scene_status)) |
| | | } |
| | | } |
| | | |
| | | private fun initObserver() { |
| | | |
| | | } |
| | | |
| | | private fun initListener() { |
| | | // 2025.10.31 场景风险提示 |
| | | val dialogSceneHistory2Binding = DataBindingUtil.setContentView<DialogSceneHistory2Binding>(this, R.layout.dialog_scene_history_2) |
| | | dialogSceneHistory2Binding.viewModel = viewModel |
| | | dialogSceneHistory2Binding.fabClose.setOnClickListener { this.finish() } |
| | | |
| | | |
| | | |
| | | fab_close.setOnClickListener { |
| | | this.finish() |
| | | } |
| | | // viewModel.getSceneStatus { |
| | | // scene?.let { viewModel.getSceneDetail(it) } |
| | | // } |
| | | } |
| | | } |