.idea/libraries/Gradle__com_android_databinding_adapters_4_2_0_aar.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Gradle: com.android.databinding:adapters:4.2.0@aar"> <CLASSES> <root url="jar://$USER_HOME$/.gradle/caches/transforms-3/77362f090f3736827f6496ac41c054b9/transformed/adapters-4.2.0/jars/classes.jar!/" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-3/77362f090f3736827f6496ac41c054b9/transformed/adapters-4.2.0/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-3/77362f090f3736827f6496ac41c054b9/transformed/adapters-4.2.0/AndroidManifest.xml" /> </CLASSES> <JAVADOC /> <SOURCES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.databinding/adapters/4.2.0/57135f758b69caf36461e12e37a9437899ac9681/adapters-4.2.0-sources.jar!/" /> </SOURCES> </library> </component> .idea/libraries/Gradle__com_android_databinding_baseLibrary_4_2_0.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Gradle: com.android.databinding:baseLibrary:4.2.0"> <CLASSES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.databinding/baseLibrary/4.2.0/60a87775da182d9d6156d6e0fd7da74a9aced2ed/baseLibrary-4.2.0.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.databinding/baseLibrary/4.2.0/721f959dffa8f516abc493e31a2416821d52e041/baseLibrary-4.2.0-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.databinding/baseLibrary/4.2.0/f719fafa4a07e0cf70dc4f868214a4b14c22ca3a/baseLibrary-4.2.0-sources.jar!/" /> </SOURCES> </library> </component> .idea/libraries/Gradle__com_android_databinding_library_4_2_0_aar.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Gradle: com.android.databinding:library:4.2.0@aar"> <CLASSES> <root url="jar://$USER_HOME$/.gradle/caches/transforms-3/515aec787bd894183db38a3d7db71513/transformed/library-4.2.0/jars/classes.jar!/" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-3/515aec787bd894183db38a3d7db71513/transformed/library-4.2.0/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-3/515aec787bd894183db38a3d7db71513/transformed/library-4.2.0/AndroidManifest.xml" /> </CLASSES> <JAVADOC /> <SOURCES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.databinding/library/4.2.0/539bf2f876e2165951cfa398bafe2b01c46fdb35/library-4.2.0-sources.jar!/" /> </SOURCES> </library> </component> .idea/libraries/Gradle__com_android_databinding_viewbinding_4_2_0_aar.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Gradle: com.android.databinding:viewbinding:4.2.0@aar"> <CLASSES> <root url="jar://$USER_HOME$/.gradle/caches/transforms-3/ff08e615976def9f0c8d9eb7219771c6/transformed/viewbinding-4.2.0/jars/classes.jar!/" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-3/ff08e615976def9f0c8d9eb7219771c6/transformed/viewbinding-4.2.0/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-3/ff08e615976def9f0c8d9eb7219771c6/transformed/viewbinding-4.2.0/AndroidManifest.xml" /> </CLASSES> <JAVADOC /> <SOURCES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.databinding/viewbinding/4.2.0/d152d79d617c68782e49416ebab745215327e5fc/viewbinding-4.2.0-sources.jar!/" /> </SOURCES> </library> </component> .idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_8_0.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Gradle: com.squareup.okhttp3:okhttp:3.8.0"> <CLASSES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.8.0/5a11f020cce2d11eb71ba916700600e18c4547e7/okhttp-3.8.0.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.8.0/4b6ef933f65760047e694e1495a9853ca594a695/okhttp-3.8.0-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.8.0/db21293949e200f08d5325e8a8eefdcc9134b752/okhttp-3.8.0-sources.jar!/" /> </SOURCES> </library> </component> .idea/libraries/Gradle__com_squareup_okio_okio_1_13_0.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Gradle: com.squareup.okio:okio:1.13.0"> <CLASSES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/d4275e004f2d6e405f3ad866cc64131a17e3b60e/okio-1.13.0-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/f4c91e12121af963e3ef76e81c82aa75ba6e8533/okio-1.13.0-sources.jar!/" /> </SOURCES> </library> </component> .idea/misc.xml
@@ -141,6 +141,7 @@ <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_night_work_empty.xml" value="0.3338541666666667" /> <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_recycler_view_refresh.xml" value="0.3338541666666667" /> <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_scene_history.xml" value="0.3338541666666667" /> <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_scenseinfo.xml" value="0.3338541666666667" /> <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_search.xml" value="0.21145833333333333" /> <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_search_2.xml" value="0.5" /> <entry key="..\:/AndroidStudioProjects/supervision_online/branches/customer_pollution_scene/app/src/main/res/layout/layout_search_bar.xml" value="0.21145833333333333" /> app/src/main/java/cn/flightfeather/thirdappmodule/databinding/SceneHistoryViewModel.kt
@@ -1,7 +1,9 @@ package cn.flightfeather.thirdappmodule.databinding import android.arch.lifecycle.MutableLiveData import android.view.View import cn.flightfeather.thirdappmodule.bean.vo.DPChangeInfo import cn.flightfeather.thirdappmodule.bean.vo.DPProblemRecurrence import cn.flightfeather.thirdappmodule.bean.vo.QueryOptSingle import cn.flightfeather.thirdappmodule.common.net.ResultCallBack import cn.flightfeather.thirdappmodule.module.base.BaseViewModel @@ -9,6 +11,7 @@ import cn.flightfeather.thirdappmodule.util.DateUtil import org.jetbrains.anko.toast import java.util.* import kotlin.math.round /** * åºæ¯å岿 åµ @@ -16,16 +19,40 @@ * Date: 2025/10/30 */ class SceneHistoryViewModel : BaseViewModel() { companion object { const val CHANGE_PER = 0.8 } private val dataProdSingleSceneRepository = DataProdSingleSceneRepository.instance // ä¸ä¸ªææ´æ¹çæå·®çæ åµ var worstChangeInfo = MutableLiveData<DPChangeInfo>() fun getChangeInfoList(sceneId: String) { var changeInfoTxt = MutableLiveData<String>() var changeEfficiencyTxt = MutableLiveData<String>() // é®é¢å¤åæ åµ // var problemRecurrenceList = MutableLiveData<List<DPProblemRecurrence>>() var worstProblemRecurrence = MutableLiveData<DPProblemRecurrence>() // fun fetchChangeInfoList(sceneId: String) { val queryOpts = getQueryOptSingleList(sceneId) dataProdSingleSceneRepository.getChangeInfoList(queryOpts, object : ResultCallBack<List<DPChangeInfo>> { override fun onSuccess(result: List<DPChangeInfo>?) { if (!result.isNullOrEmpty()) { changeInfoTxt.value = result.mapIndexed { i, info -> // çéåå¨é®é¢ï¼å¹¶ä¸æ´æ¹çå°äº80%çæä»½ if (info.subTasks.isNullOrEmpty() && info.changePer >= CHANGE_PER) { "" } else { val time = DateUtil.parseYearMonth(queryOpts[i].startTime) ?: return@mapIndexed "" val cal = Calendar.getInstance().apply { setTime(time) } "${cal.get(Calendar.MONTH) + 1}ææ´æ¹ç为${round(info.changePer * 100)}%" } }.filter { it.isNotBlank() }.joinToString("ï¼") + "ï¼æ´æ¹çè¾ä½ï¼éå 强ç管ã" worstChangeInfo.value = result[0] } } @@ -36,6 +63,44 @@ }) } fun fetchProblemRecurrence(sceneId:String) { // è·ååä¸ä¸ªæçå çè®°å½ val queryOpt = QueryOptSingle().apply { this.sceneId = sceneId val now = Calendar.getInstance().apply { set(Calendar.DAY_OF_MONTH, 1) set(Calendar.HOUR_OF_DAY, 0) set(Calendar.MINUTE, 0) set(Calendar.SECOND, 0) } // å¾å°ä¸ææåä¸å¤© now.add(Calendar.SECOND, -1) endTime = DateUtil.getDateStr(now.time) // å¾å°å4个æç¬¬ä¸å¤© now.apply { set(Calendar.DAY_OF_MONTH, 1) set(Calendar.HOUR_OF_DAY, 0) set(Calendar.MINUTE, 0) set(Calendar.SECOND, 0) } now.add(Calendar.MONTH, 2) startTime = DateUtil.getDateStr(now.time) } dataProdSingleSceneRepository.getProblemRecurrence(queryOpt, object : ResultCallBack<List<DPProblemRecurrence>> { override fun onSuccess(result: List<DPProblemRecurrence>?) { if (!result.isNullOrEmpty()) { worstProblemRecurrence.value = result[0] } } override fun onFailure() { application.toast("è·åé®é¢å¤åæ åµå¤±è´¥") } }) } private fun getQueryOptSingleList(sceneId: String): List<QueryOptSingle> { val queryOpts = mutableListOf<QueryOptSingle>() app/src/main/java/cn/flightfeather/thirdappmodule/httpservice/DataProdSingleSceneService.kt
@@ -37,5 +37,5 @@ @POST("dataProd/singleScene/problemRecurrence/get") fun getProblemRecurrence( @Body queryOptSingle: QueryOptSingle ): Observable<Response<BaseResponse<DPProblemRecurrence>>> ): Observable<Response<BaseResponse<List<DPProblemRecurrence>>>> } app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseActivity.kt
@@ -40,7 +40,7 @@ } catch (e: Exception) { e.printStackTrace() } setContentView(getLayoutId()) getLayoutId()?.let { setContentView(it) } rootView = findViewById<ViewGroup>(android.R.id.content).getChildAt(0) as ViewGroup } @@ -62,7 +62,7 @@ } abstract fun getLayoutId(): Int abstract fun getLayoutId(): Int? /** * æå±activityä¸èªå¨æ¾ç¤ºè½¯é®ççæ¹æ³ app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity.kt
@@ -1,16 +1,15 @@ package cn.flightfeather.thirdappmodule.module.inspection import android.arch.lifecycle.Observer import android.arch.lifecycle.ViewModelProviders import android.databinding.DataBindingUtil import android.os.Bundle import android.support.v4.content.ContextCompat 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 kotlinx.android.synthetic.main.dialog_scene_history.* import kotlinx.android.synthetic.main.fragment_analysis_over_view.* /** * åºæ¯å岿 åµæç¤ºçé¢ @@ -22,115 +21,26 @@ // ä¼ å ¥çåºæ¯å¯¹è±¡ 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(MenuSceneHistoryViewModel::class.java) viewModel = ViewModelProviders.of(this).get(SceneHistoryViewModel::class.java) scene = intent.getSerializableExtra("scene") as Scense? initUI() initObserver() initListener() // 2025.10.31 åºæ¯é£é©æç¤º val dialogSceneHistory2Binding = DataBindingUtil.setContentView<DialogSceneHistory2Binding>(this, R.layout.dialog_scene_history_2) dialogSceneHistory2Binding.viewModel = viewModel dialogSceneHistory2Binding.fabClose.setOnClickListener { this.finish() } // viewModel.getSceneStatus { // scene?.let { viewModel.getSceneDetail(it) } // } } private fun initUI() { // ç»è®¡é¡¹ç® val itemList = listOf( HistoryItemView("ç°åºè¯å", true, cl_1, tv_title_1), HistoryItemView("å ¸åå·¥å°", true, cl_2, tv_title_2), HistoryItemView("éç¹åºå", true, cl_3, tv_title_3), HistoryItemView("èåæ§æ³", true, cl_4, tv_title_4), HistoryItemView("æ´æ¹æç", true, cl_5, tv_title_5), HistoryItemView("é®é¢å¤å", true, cl_6, tv_title_6), HistoryItemView("æ½å·¥é¶æ®µ", true, cl_7, tv_title_7), HistoryItemView("çæµæ°æ®", true, cl_8, tv_title_8), HistoryItemView("åºæ¥å·¡æ¥", false, cl_9, tv_title_9) ) // æ¾ç¤º å è½½å¾æ view_waiting.visibility = View.GONE // æ ¹æ®é ç½®æ¾ç¤ºå¯¹åºç项ç®ï¼å¹¶èªå¨å¹é åºå· var index = 1 itemList.forEach { item -> if (item.show) { val title = "${index}. ${item.title}" item.parentView.visibility = View.VISIBLE item.titleView.text = title index++ } else { item.parentView.visibility = View.GONE } } // æ¾ç¤º åºæ¯åç§° scene?.let { tv_title.text = it.name } } private fun initObserver() { // åå²è¯ä¼°æ åµ viewModel.evaluationList.observe(this, Observer { }) // å ¸ååºæ¯æ åµ viewModel.typicalScene.observe(this, Observer { }) tv_title_2.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // éç¹åºåï¼å¨å½æ§ç¹ã叿§ç¹å¨è¾¹ï¼ viewModel.keyArea.observe(this, Observer { }) tv_title_3.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // èåæ§æ³ viewModel.jointLawEnforcement.observe(this, Observer { }) tv_title_4.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) tv_summary_4.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) // æ´æ¹æç viewModel.changeRate.observe(this, Observer { }) tv_title_5.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // é®é¢å¤å viewModel.problemRecurrence.observe(this, Observer { }) tv_title_6.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // æ½å·¥é¶æ®µ viewModel.constructionPhase.observe(this, Observer { }) tv_title_7.setTextColor(ContextCompat.getColor(this, R.color.main_color_2)) // å¨çº¿çæµæ°æ® viewModel.monitorData.observe(this, Observer { }) tv_title_8.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) tv_summary_8.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) // åºæ¥å·¡æ¥ viewModel.emergencyInspection.observe(this, Observer { }) tv_title_9.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) } private fun initListener() { fab_close.setOnClickListener { this.finish() } } } app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity_backup.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,136 @@ package cn.flightfeather.thirdappmodule.module.inspection import android.arch.lifecycle.Observer import android.arch.lifecycle.ViewModelProviders import android.os.Bundle import android.support.v4.content.ContextCompat import android.view.View import android.widget.TextView import cn.flightfeather.thirdappmodule.R import cn.flightfeather.thirdappmodule.bean.entity.Scense import cn.flightfeather.thirdappmodule.module.base.BaseActivity import kotlinx.android.synthetic.main.dialog_scene_history.* import kotlinx.android.synthetic.main.fragment_analysis_over_view.* /** * åºæ¯å岿 åµæç¤ºçé¢ * Date: 2025/10/27 */ class MenuSceneHistoryActivity_backup : 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 lateinit var viewModel: MenuSceneHistoryViewModel override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) viewModel = ViewModelProviders.of(this).get(MenuSceneHistoryViewModel::class.java) scene = intent.getSerializableExtra("scene") as Scense? initUI() initObserver() initListener() // viewModel.getSceneStatus { // scene?.let { viewModel.getSceneDetail(it) } // } } private fun initUI() { // ç»è®¡é¡¹ç® val itemList = listOf( HistoryItemView("ç°åºè¯å", true, cl_1, tv_title_1), HistoryItemView("å ¸åå·¥å°", true, cl_2, tv_title_2), HistoryItemView("éç¹åºå", true, cl_3, tv_title_3), HistoryItemView("èåæ§æ³", true, cl_4, tv_title_4), HistoryItemView("æ´æ¹æç", true, cl_5, tv_title_5), HistoryItemView("é®é¢å¤å", true, cl_6, tv_title_6), HistoryItemView("æ½å·¥é¶æ®µ", true, cl_7, tv_title_7), HistoryItemView("çæµæ°æ®", true, cl_8, tv_title_8), HistoryItemView("åºæ¥å·¡æ¥", false, cl_9, tv_title_9) ) // æ¾ç¤º å è½½å¾æ view_waiting.visibility = View.GONE // æ ¹æ®é ç½®æ¾ç¤ºå¯¹åºç项ç®ï¼å¹¶èªå¨å¹é åºå· var index = 1 itemList.forEach { item -> if (item.show) { val title = "${index}. ${item.title}" item.parentView.visibility = View.VISIBLE item.titleView.text = title index++ } else { item.parentView.visibility = View.GONE } } // æ¾ç¤º åºæ¯åç§° scene?.let { tv_title.text = it.name } } private fun initObserver() { // åå²è¯ä¼°æ åµ viewModel.evaluationList.observe(this, Observer { }) // å ¸ååºæ¯æ åµ viewModel.typicalScene.observe(this, Observer { }) tv_title_2.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // éç¹åºåï¼å¨å½æ§ç¹ã叿§ç¹å¨è¾¹ï¼ viewModel.keyArea.observe(this, Observer { }) tv_title_3.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // èåæ§æ³ viewModel.jointLawEnforcement.observe(this, Observer { }) tv_title_4.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) tv_summary_4.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) // æ´æ¹æç viewModel.changeRate.observe(this, Observer { }) tv_title_5.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // é®é¢å¤å viewModel.problemRecurrence.observe(this, Observer { }) tv_title_6.setTextColor(ContextCompat.getColor(this, R.color.red_btn_bg_color)) // æ½å·¥é¶æ®µ viewModel.constructionPhase.observe(this, Observer { }) tv_title_7.setTextColor(ContextCompat.getColor(this, R.color.main_color_2)) // å¨çº¿çæµæ°æ® viewModel.monitorData.observe(this, Observer { }) tv_title_8.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) tv_summary_8.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) // åºæ¥å·¡æ¥ viewModel.emergencyInspection.observe(this, Observer { }) tv_title_9.setTextColor(ContextCompat.getColor(this, R.color.main_color_3)) } private fun initListener() { fab_close.setOnClickListener { this.finish() } } } app/src/main/java/cn/flightfeather/thirdappmodule/repository/DataProdSingleSceneRepository.kt
@@ -60,12 +60,12 @@ /** * é®é¢é夿 åµ */ fun getProblemRecurrence(queryOptSingle: QueryOptSingle, resultCallBack: ResultCallBack<DPProblemRecurrence>) { fun getProblemRecurrence(queryOptSingle: QueryOptSingle, resultCallBack: ResultCallBack<List<DPProblemRecurrence>>) { val service = retrofit.create(DataProdSingleSceneService::class.java).getProblemRecurrence(queryOptSingle) RetrofitFactory.executeResult(service, object : ResultObserver<BaseResponse<DPProblemRecurrence>>() { override fun onSuccess(result: BaseResponse<DPProblemRecurrence>?) { RetrofitFactory.executeResult(service, object : ResultObserver<BaseResponse<List<DPProblemRecurrence>>>() { override fun onSuccess(result: BaseResponse<List<DPProblemRecurrence>>?) { resultCallBack.onSuccess(result?.data) } app/src/main/java/cn/flightfeather/thirdappmodule/util/DateUtil.kt
@@ -151,13 +151,13 @@ return weekDays[index] } fun parseYearMonth(str: String): Date { try { return SimpleDateFormat("yyyy-MM", Locale.getDefault()).parse(str) fun parseYearMonth(str: String?): Date? { return try { SimpleDateFormat("yyyy-MM", Locale.getDefault()).parse(str) } catch (e: Exception) { e.printStackTrace() null } return Date() } fun parseYearToMin(str: String): Date { app/src/main/res/layout/dialog_scene_history_2.xml
@@ -1,167 +1,186 @@ <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <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" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> xmlns:tools="http://schemas.android.com/tools"> <android.support.v7.widget.CardView android:id="@+id/cv_dialog_main" <data > <import type="android.view.View" alias="View"/> <variable name="viewModel" type="cn.flightfeather.thirdappmodule.databinding.SceneHistoryViewModel" /> </data> <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="12dp" android:layout_marginTop="30dp" android:layout_marginRight="12dp" android:layout_marginBottom="40dp" app:cardCornerRadius="6dp" app:cardElevation="7dp"> android:orientation="vertical"> <ScrollView <android.support.v7.widget.CardView android:id="@+id/cv_dialog_main" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="30dp"> <LinearLayout android:layout_marginLeft="12dp" android:layout_marginTop="30dp" android:layout_marginRight="12dp" android:layout_marginBottom="40dp" app:cardCornerRadius="6dp" app:cardElevation="7dp"> <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> android:layout_height="match_parent" android:layout_marginBottom="30dp"> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/dimen16"> <ImageView android:id="@+id/img_risk_warn" android:layout_width="20dp" android:layout_height="20dp" android:src="@drawable/icon_task_alert" android:layout_marginBottom="@dimen/dimen4" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/tv_risk_warn" app:layout_constraintBottom_toBottomOf="@id/tv_risk_warn" android:contentDescription="é£é©æç¤º" /> <TextView android:id="@+id/tv_risk_warn" android:layout_width="0dp" android:layout_height="30dp" android:textColor="@color/red_btn_bg_color" android:textSize="@dimen/textSize_18" android:textStyle="bold" app:layout_constraintStart_toEndOf="@id/img_risk_warn" app:layout_constraintTop_toTopOf="parent" android:text="é£é©æç¤º" /> <TextView android:id="@+id/tv_change_rate" <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" android:paddingStart="20dp" android:paddingEnd="0dp" tools:text="æ´æ¹çæ åµï¼å¦ææ´æ¹çè¾ä½ï¼åä½ä¸ºé£é©æç¤ºå±ç¤º" app:layout_constraintTop_toBottomOf="@id/tv_risk_warn"/> <TextView android:id="@+id/tv_change_efficiency" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" android:paddingStart="20dp" android:paddingEnd="0dp" tools:text="æ´æ¹æçæ åµï¼æ´æ¹æçä¸ºè¦æ±æ´æ¹çæéï¼å¤©æ°ï¼é¤ä»¥å®é æ´æ¹çç¨æ¶ï¼å¤©æ°ï¼ï¼å¦ææçä½äº60%ï¼åä½ä¸ºé£é©æç¤ºå±ç¤º" app:layout_constraintTop_toBottomOf="@id/tv_change_rate"/> <TextView android:id="@+id/tv_problem_recurrence" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" android:paddingStart="20dp" android:paddingEnd="0dp" tools:text="é®é¢å¤åæ åµï¼è¥åä¸ä¸ªæå æç¸åç±»åçé®é¢åºç°ä¸¤æ¬¡å以䏿¶ï¼æéå±ç¤ºï¼å¹¶ç»åºå¯¹åºçæ´æ¹ç" app:layout_constraintTop_toBottomOf="@id/tv_change_efficiency"/> android:orientation="vertical"> </android.support.constraint.ConstraintLayout> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/dimen16"> <ImageView android:id="@+id/img_inspection_key_point" android:layout_width="20dp" android:layout_height="20dp" android:src="@drawable/icon_consult" android:layout_marginBottom="@dimen/dimen4" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/tv_risk_warn" app:layout_constraintBottom_toBottomOf="@id/tv_inspection_key_point" android:contentDescription="å·¡æ¥è¦ç¹" /> <TextView android:id="@+id/tv_inspection_key_point" android:layout_width="0dp" android:layout_height="30dp" android:textColor="@color/primary_text" android:textSize="@dimen/textSize_18" app:layout_constraintStart_toEndOf="@id/img_inspection_key_point" app:layout_constraintTop_toTopOf="parent" android:text="å·¡æ¥è¦ç¹" /> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="@{viewModel.worstChangeInfo == null ? View.GONE : View.VISIBLE}" android:padding="@dimen/dimen16"> <TextView android:id="@+id/tv_change_rate" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" android:paddingStart="20dp" android:paddingEnd="0dp" tools:text="å·¡æ¥è¦ç¹ï¼æ³¨æéè¦æ£æ¥çä½ç½®ã设å¤åé®é¢ç" app:layout_constraintTop_toBottomOf="@id/img_inspection_key_point"/> <ImageView android:id="@+id/img_risk_warn" android:layout_width="20dp" android:layout_height="20dp" android:layout_marginBottom="@dimen/dimen4" android:contentDescription="é£é©æç¤º" android:src="@drawable/icon_task_alert" app:layout_constraintBottom_toBottomOf="@id/tv_risk_warn" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/tv_risk_warn" /> </android.support.constraint.ConstraintLayout> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/dimen16"> <ImageView android:id="@+id/img_risk_warn" android:layout_width="20dp" android:layout_height="20dp" android:src="@drawable/ic_emergency" android:layout_marginBottom="@dimen/dimen4" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/tv_risk_warn" app:layout_constraintBottom_toBottomOf="@id/tv_risk_warn" android:contentDescription="åºæ¥å·¡æ¥" /> <TextView android:id="@+id/tv_risk_warn" android:layout_width="0dp" android:layout_height="30dp" android:text="é£é©æç¤º" android:textColor="@color/red_btn_bg_color" android:textSize="@dimen/textSize_18" android:textStyle="bold" app:layout_constraintStart_toEndOf="@id/img_risk_warn" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/tv_risk_warn" android:layout_width="0dp" android:layout_height="30dp" android:textColor="@color/primary_text" android:textSize="@dimen/textSize_18" app:layout_constraintStart_toEndOf="@id/img_risk_warn" app:layout_constraintTop_toTopOf="parent" android:text="åºæ¥å·¡æ¥" /> <TextView android:id="@+id/tv_change_rate" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="20dp" android:paddingEnd="0dp" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" app:layout_constraintTop_toBottomOf="@id/tv_risk_warn" android:text="@{viewModel.changeInfoTxt}" tools:text="æ´æ¹çæ åµï¼å¦ææ´æ¹çè¾ä½ï¼åä½ä¸ºé£é©æç¤ºå±ç¤º" /> </android.support.constraint.ConstraintLayout> </LinearLayout> </ScrollView> </android.support.v7.widget.CardView> <TextView android:id="@+id/tv_change_efficiency" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="20dp" android:paddingEnd="0dp" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" app:layout_constraintTop_toBottomOf="@id/tv_change_rate" tools:text="æ´æ¹æçæ åµï¼æ´æ¹æçä¸ºè¦æ±æ´æ¹çæéï¼å¤©æ°ï¼é¤ä»¥å®é æ´æ¹çç¨æ¶ï¼å¤©æ°ï¼ï¼å¦ææçä½äº60%ï¼åä½ä¸ºé£é©æç¤ºå±ç¤º" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab_close" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/cancel" android:src="@drawable/icon_close_white" app:elevation="8dp" app:fabSize="normal" app:layout_anchor="@id/cv_dialog_main" app:layout_anchorGravity="bottom|center" /> <TextView android:id="@+id/tv_problem_recurrence" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="20dp" android:paddingEnd="0dp" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" app:layout_constraintTop_toBottomOf="@id/tv_change_efficiency" tools:text="é®é¢å¤åæ åµï¼è¥åä¸ä¸ªæå æç¸åç±»åçé®é¢åºç°ä¸¤æ¬¡å以䏿¶ï¼æéå±ç¤ºï¼å¹¶ç»åºå¯¹åºçæ´æ¹ç" /> </android.support.design.widget.CoordinatorLayout> </android.support.constraint.ConstraintLayout> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/dimen16"> <ImageView android:id="@+id/img_inspection_key_point" android:layout_width="20dp" android:layout_height="20dp" android:layout_marginBottom="@dimen/dimen4" android:contentDescription="å·¡æ¥è¦ç¹" android:src="@drawable/icon_consult" app:layout_constraintBottom_toBottomOf="@id/tv_inspection_key_point" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/tv_risk_warn" /> <TextView android:id="@+id/tv_inspection_key_point" android:layout_width="0dp" android:layout_height="30dp" android:text="å·¡æ¥è¦ç¹" android:textColor="@color/primary_text" android:textSize="@dimen/textSize_18" app:layout_constraintStart_toEndOf="@id/img_inspection_key_point" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/tv_key_point" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="20dp" android:paddingEnd="0dp" android:textColor="@color/main_color_1" android:textSize="@dimen/textSize_16" app:layout_constraintTop_toBottomOf="@id/img_inspection_key_point" tools:text="å·¡æ¥è¦ç¹ï¼æ³¨æéè¦æ£æ¥çä½ç½®ã设å¤åé®é¢ç" /> </android.support.constraint.ConstraintLayout> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/dimen16"> <ImageView android:id="@+id/img_temp_inspection" android:layout_width="20dp" android:layout_height="20dp" android:layout_marginBottom="@dimen/dimen4" android:contentDescription="åºæ¥å·¡æ¥" android:src="@drawable/ic_emergency" app:layout_constraintBottom_toBottomOf="@id/tv_risk_warn" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/tv_risk_warn" /> <TextView android:id="@+id/tv_temp_inspection" android:layout_width="0dp" android:layout_height="30dp" android:text="åºæ¥å·¡æ¥" android:textColor="@color/primary_text" android:textSize="@dimen/textSize_18" app:layout_constraintStart_toEndOf="@id/img_temp_inspection" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> </LinearLayout> </ScrollView> </android.support.v7.widget.CardView> <android.support.design.widget.FloatingActionButton android:id="@+id/fab_close" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/cancel" android:src="@drawable/icon_close_white" app:elevation="8dp" app:fabSize="normal" app:layout_anchor="@id/cv_dialog_main" app:layout_anchorGravity="bottom|center" /> </android.support.design.widget.CoordinatorLayout> </layout> app/src/main/res/layout/layout_scene_history.xml
ÎļþÒÑɾ³ý