[2.15.0] fix bug of roma click and add trace log

This commit is contained in:
zhongchao
2023-04-19 12:36:03 +08:00
parent f29edcdb3a
commit 4ae4bd7ecb
5 changed files with 25 additions and 6 deletions

View File

@@ -25,6 +25,9 @@ class RomaPassengerView @JvmOverloads constructor(
@Volatile
private var romaMode = false
@Volatile
private var click = false
private val openRes: Int
private val normalRes: Int
@@ -36,10 +39,15 @@ class RomaPassengerView @JvmOverloads constructor(
normalRes = a.getResourceId(R.styleable.RomaPassengerView_roma_close, 0)
a.recycle()
setOnClickListener {
if(!click){
return@setOnClickListener
}
romaMode = !romaMode
romaTrigger(romaMode) { mode ->
click = true
romaMode = mode
}
click = false
}
}
@@ -65,6 +73,7 @@ class RomaPassengerView @JvmOverloads constructor(
}
override fun romaStatus(status: Boolean) {
click = true
if (status) {
romaMode = true
if (openRes != 0) {

View File

@@ -24,9 +24,15 @@ class RomaView @JvmOverloads constructor(
@Volatile
private var romaMode = false
@Volatile
private var click = false
init {
LayoutInflater.from(context).inflate(R.layout.view_roma_bg, this, true)
setOnClickListener {
if(!click){
return@setOnClickListener
}
romaMode = !romaMode
// 司机屏发送事件给乘客屏
if (romaMode) {
@@ -40,6 +46,7 @@ class RomaView @JvmOverloads constructor(
"1".toByteArray()
)
}
click = false
}
}
@@ -49,6 +56,7 @@ class RomaView @JvmOverloads constructor(
}
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
click = true
when(type){
TelematicConstant.OPEN_ROMA_STATUS -> {
when (String(byteArray)) {