[2.15.0] fix bug of roma click and add trace log
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user