Merge branch 'qa_1.1.8' into dev
# Conflicts: # gradle.properties # modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryRoadEventVH.java
This commit is contained in:
@@ -15,7 +15,6 @@ import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
|
||||
import com.mogo.service.eventpanel.IEventPanelProvider;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -35,6 +34,7 @@ public class V2XEventPanelModuleProvider implements
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
Logger.e(MODULE_NAME, "事件模版 createFragment。。。。");
|
||||
V2XServiceManager.init(context);
|
||||
return V2XEventPanelFragment.Companion.getInstance();
|
||||
}
|
||||
@@ -92,21 +92,28 @@ public class V2XEventPanelModuleProvider implements
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
V2XServiceManager.init(context);
|
||||
Logger.e(MODULE_NAME, "事件模版 模块初始化。。。。");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPanelWithSelectedItem(int item) {
|
||||
V2XEventPanelFragment.Companion.getInstance().showPanelWithSelectedItem(item);
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isMainPageIsBackground()) {
|
||||
V2XEventPanelFragment.Companion.getInstance().showPanelWithSelectedItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPanel() {
|
||||
V2XEventPanelFragment.Companion.getInstance().showPanel();
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isMainPageIsBackground()) {
|
||||
V2XEventPanelFragment.Companion.getInstance().showPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePanel() {
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isMainPageIsBackground()) {
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.module.v2x.listener;
|
||||
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
@@ -64,24 +64,14 @@ public class V2XMessageListener_401005 implements IMogoOnMessageListener<V2XSpec
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_MARKER_SPECIAL_CAR);
|
||||
List<V2XMarkerEntity> coordinates = message.getCoordinates();
|
||||
List<V2XMarkerEntity> entityList = new ArrayList<>();
|
||||
// 移除上一次的数据
|
||||
//Context context = V2XServiceManager.getContext();
|
||||
|
||||
for (V2XMarkerEntity coordinate : coordinates) {
|
||||
//故障车机
|
||||
if (coordinate.getTargetId() == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING) {
|
||||
//V2XMarkerEntity.UserInfoBean userInfoBean = coordinate.getUserInfo();
|
||||
//if (userInfoBean != null) {
|
||||
entityList.add(coordinate);
|
||||
//}
|
||||
//绘制
|
||||
//V2XServiceManager
|
||||
// .getMoGoV2XMarkerManager()
|
||||
// .drawableSpecialCarPOI(context, coordinate, V2XMarkerClickListener.getInstance());
|
||||
}
|
||||
}
|
||||
if (!entityList.isEmpty()) {
|
||||
//V2XUtils.runOnUiThread(() -> V2XServiceManager.getMoGoV2XScenarioManager().showOtherSeekHelpWindow(entityList));
|
||||
V2XUtils.runOnUiThread(() -> {
|
||||
V2XMessageEntity<List<V2XMarkerEntity>> v2XMessageEntity = new V2XMessageEntity<>();
|
||||
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING);
|
||||
|
||||
@@ -56,66 +56,70 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
@Override
|
||||
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
|
||||
//Logger.d(MODULE_NAME, "处理V2X场景:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
// 展示
|
||||
V2XUtils.runOnUiThread(() -> {
|
||||
// 提取之前存储的场景
|
||||
if (v2XMessageEntity != null) {
|
||||
try {
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
// 展示
|
||||
V2XUtils.runOnUiThread(() -> {
|
||||
// 提取之前存储的场景
|
||||
if (v2XMessageEntity != null) {
|
||||
|
||||
|
||||
// 广播给应用内部其它模块
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent);
|
||||
// 广播给应用内部其它模块
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent);
|
||||
|
||||
mV2XScenario = mV2XScenarioSet.get(v2XMessageEntity.getType());
|
||||
// 如果没有拿到之前的,根据类型分发
|
||||
if (mV2XScenario == null) {
|
||||
switch (v2XMessageEntity.getType()) {
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING:
|
||||
mV2XScenario = V2XRoadEventScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
|
||||
mV2XScenario = V2XSeekHelpScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
|
||||
mV2XScenario = V2XFatigueDrivingScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING:
|
||||
mV2XScenario = V2XPushEventScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING:
|
||||
mV2XScenario = V2XPushLiveCarScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ANIMATION_WARNING:
|
||||
mV2XScenario = V2XAnimationScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP:
|
||||
mV2XScenario = V2XCarForHelpScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING:
|
||||
mV2XScenario = V2XIllegalParkScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING:
|
||||
mV2XScenario = V2XEventUgcScenario.getInstance();
|
||||
break;
|
||||
default:
|
||||
Logger.e(MODULE_NAME, "当前V2X消息类型未定义。");
|
||||
TipToast.tip("当前V2X消息类型未定义");
|
||||
return;
|
||||
mV2XScenario = mV2XScenarioSet.get(v2XMessageEntity.getType());
|
||||
// 如果没有拿到之前的,根据类型分发
|
||||
if (mV2XScenario == null) {
|
||||
switch (v2XMessageEntity.getType()) {
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING:
|
||||
mV2XScenario = V2XRoadEventScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
|
||||
mV2XScenario = V2XSeekHelpScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
|
||||
mV2XScenario = V2XFatigueDrivingScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING:
|
||||
mV2XScenario = V2XPushEventScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING:
|
||||
mV2XScenario = V2XPushLiveCarScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ANIMATION_WARNING:
|
||||
mV2XScenario = V2XAnimationScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP:
|
||||
mV2XScenario = V2XCarForHelpScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING:
|
||||
mV2XScenario = V2XIllegalParkScenario.getInstance();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING:
|
||||
mV2XScenario = V2XEventUgcScenario.getInstance();
|
||||
break;
|
||||
default:
|
||||
Logger.e(MODULE_NAME, "当前V2X消息类型未定义。");
|
||||
TipToast.tip("当前V2X消息类型未定义");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 展示最新的消息
|
||||
if (mV2XScenario != null) {
|
||||
if (v2XMessageEntity.getType() != V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP) {
|
||||
hidOtherPanel();
|
||||
}
|
||||
mV2XScenario.init(v2XMessageEntity);
|
||||
mV2XScenarioSet.put(v2XMessageEntity.getType(), mV2XScenario);
|
||||
}
|
||||
}
|
||||
|
||||
// 展示最新的消息
|
||||
if (mV2XScenario != null) {
|
||||
if (v2XMessageEntity.getType() != V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP) {
|
||||
hidOtherPanel();
|
||||
}
|
||||
mV2XScenario.init(v2XMessageEntity);
|
||||
mV2XScenarioSet.put(v2XMessageEntity.getType(), mV2XScenario);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user