|
|
@@ -1,5 +1,6 @@
|
|
|
package com.grkj.iscs_mars.view.fragment
|
|
|
|
|
|
+import android.util.Log
|
|
|
import android.view.GestureDetector
|
|
|
import android.view.Gravity
|
|
|
import android.view.MotionEvent
|
|
|
@@ -118,18 +119,19 @@ class SwitchStatusFragment :
|
|
|
adapter.notifyDataSetChanged()
|
|
|
}, 2000)
|
|
|
}
|
|
|
- val switchStatus = switchData
|
|
|
- .find { it.idx == item.pointSerialNumber?.toInt() }?.enabled
|
|
|
- ?: (item.status == "1")
|
|
|
+ val swPoint = switchData.find { it.idx == item.pointSerialNumber?.toInt() }
|
|
|
+ val switchStatus = swPoint?.enabled ?: (item.status == "1")
|
|
|
when (switchStatus) {
|
|
|
false -> {
|
|
|
itemBinding.switchStatus.setBackgroundResource(R.drawable.bg_switch_off)
|
|
|
itemBinding.switchStatus.text = CommonUtils.getStr(R.string.switch_close)
|
|
|
}
|
|
|
+
|
|
|
true -> {
|
|
|
itemBinding.switchStatus.setBackgroundResource(R.drawable.bg_switch_on)
|
|
|
itemBinding.switchStatus.text = CommonUtils.getStr(R.string.switch_open)
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
itemBinding.switchStatus.setBackgroundResource(R.drawable.bg_switch_alarm)
|
|
|
itemBinding.switchStatus.text = CommonUtils.getStr(R.string.switch_alarm)
|
|
|
@@ -246,6 +248,7 @@ class SwitchStatusFragment :
|
|
|
mBinding?.mapview?.refresh()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
override fun onMapLoadFail() = Unit
|
|
|
})
|
|
|
}
|