rebase
This commit is contained in:
@@ -174,4 +174,12 @@ object CallerHmiManager : CallerBase() {
|
||||
fun showNormalBanner(noticeNormal: NoticeNormalData) {
|
||||
waringProviderApi.showNoticeNormalData(noticeNormal)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示VIP标识
|
||||
*/
|
||||
fun vipIdentification(visible: Boolean){
|
||||
waringProviderApi.vipIdentification(visible)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.eagle.core.function.call.trafficlight
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
|
||||
object CallTrafficLightListenerManager {
|
||||
|
||||
private val TAG = "CallTrafficLightListenerManager"
|
||||
|
||||
private val M_TRAFFIC_LIGHT_LISTENER: HashMap<String, IMoGoTrafficLightListener> =
|
||||
HashMap()
|
||||
|
||||
private var trafficLightResult:TrafficLightResult? = null
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun registerTrafficLightListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoTrafficLightListener
|
||||
) {
|
||||
trafficLightResult?.let {
|
||||
listener.onTrafficLightStatus(it)
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun unRegisterTrafficLightListener(@Nullable tag: String) {
|
||||
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun unRegisterTrafficLightListener(@Nullable listener: IMoGoTrafficLightListener) {
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_TRAFFIC_LIGHT_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
this.trafficLightResult = trafficLightResult
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
Logger.d(TAG, "invokeTrafficLightStatus tag is : $tag")
|
||||
val listener = it.value
|
||||
listener.onTrafficLightStatus(trafficLightResult)
|
||||
}
|
||||
}
|
||||
|
||||
fun resetTrafficLightData(){
|
||||
trafficLightResult = null
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.eagle.core.function.call.trafficlight
|
||||
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.trafficlight.ITrafficLightProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallTrafficLightManager : CallerBase() {
|
||||
|
||||
fun getTrafficLightProvider(): ITrafficLightProvider {
|
||||
return getApiInstance(
|
||||
ITrafficLightProvider::class.java,
|
||||
MogoServicePaths.PATH_TRAFFIC_LIGHT
|
||||
)
|
||||
}
|
||||
|
||||
fun getTrafficLightCurrentState() {
|
||||
getTrafficLightProvider().getTrafficLightCurrentState()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user