[6.1.0][Opt]新增请求平行驾驶点击事件

This commit is contained in:
chenfufeng
2023-09-18 14:22:06 +08:00
parent e9639522af
commit 174b2db510

View File

@@ -57,6 +57,7 @@ class ParallelDriveView @JvmOverloads constructor(
private lateinit var rootLayout: ConstraintLayout
private lateinit var statusIcon: ImageView
private lateinit var statusTitle: TextView
private var listener: ClickEventListener? = null
init {
LayoutInflater.from(context).inflate(R.layout.view_parallel_drive, this, true)
@@ -80,6 +81,7 @@ class ParallelDriveView @JvmOverloads constructor(
state = APP_REQUESTING
updateUI(APP_REQUESTING)
reqParaDrive()
listener?.onReqClick()
}
APP_REQUESTING -> {
cancelParaDrive()
@@ -94,6 +96,10 @@ class ParallelDriveView @JvmOverloads constructor(
checkAvailableAndUpdateUI()
}
fun setClickEventListener(listener: ClickEventListener?) {
this.listener = listener
}
override fun onAutopilotStatusResponse(state: Int) {
super.onAutopilotStatusResponse(state)
if (state != autopilotState) {
@@ -330,4 +336,8 @@ class ParallelDriveView @JvmOverloads constructor(
CallerParallelDrivingListenerManager.removeListener(TAG)
CallerParallelDrivingActionsListenerManager.removeListener(TAG)
}
interface ClickEventListener {
fun onReqClick()
}
}