数据下沉到common模块

This commit is contained in:
chenfufeng
2021-09-07 20:29:01 +08:00
parent 0c2e27cc54
commit 73da2deee3
90 changed files with 713 additions and 923 deletions

41
.idea/misc.xml generated
View File

@@ -11,11 +11,37 @@
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="../../../../../../layout/custom_preview.xml" value="0.390625" />
<entry key="../../../../../layout/custom_preview.xml" value="0.19947916666666668" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/fragment_warning.xml" value="0.34427083333333336" />
<entry key="../../../../layout/custom_preview.xml" value="0.14635416666666667" />
<entry key="OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml" value="0.1953125" />
<entry key="modules/mogo-module-authorize/src/main/res/layout/module_authorize_fragment.xml" value="0.273046875" />
<entry key="modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_blue.xml" value="0.1390625" />
<entry key="modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_red_vr.xml" value="0.2421875" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/camera_item_v2x_live_video.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/camera_push_live_video.xml" value="0.27447916666666666" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/camera_view_video_layout_normal.xml" value="0.27447916666666666" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/include_debug_panel.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml" value="0.27447916666666666" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/module_ext_include_seeking_help_notice.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml" value="0.2953125" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance_no_map.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_extensions.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/module_map_layout_navi_info_panel.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-guide/src/main/res/layout/module_guide_fragment.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-guide/src/main/res/layout/module_guide_item_stage_five.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/fragment_warning.xml" value="1.0" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/notification_v2x_msg_vr.xml" value="0.3453125" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/view_traffic_light_vr.xml" value="0.25" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/view_traffic_light_vr.xml" value="1.25" />
<entry key="modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-main/src/main/res/drawable-xhdpi/module_main_warning_bkg_bottom.xml" value="0.359375" />
<entry key="modules/mogo-module-main/src/main/res/drawable-xhdpi/module_main_warning_bkg_left.xml" value="0.359375" />
<entry key="modules/mogo-module-main/src/main/res/drawable-xhdpi/module_main_warning_bkg_right.xml" value="0.359375" />
<entry key="modules/mogo-module-main/src/main/res/drawable-xhdpi/module_main_warning_bkg_top.xml" value="0.33" />
<entry key="modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml" value="0.3125" />
<entry key="modules/mogo-module-main/src/main/res/layout/module_main_activity_main_no_map.xml" value="0.33645833333333336" />
<entry key="modules/mogo-module-map/src/main/res/layout/module_map_fragment_map.xml" value="0.17864583333333334" />
<entry key="modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml" value="0.315625" />
<entry key="modules/mogo-module-service/src/main/res/drawable/bg_adas_dispatch.xml" value="0.184" />
<entry key="modules/mogo-module-service/src/main/res/drawable/bg_adas_dispatch_affirm.xml" value="0.19166666666666668" />
<entry key="modules/mogo-module-service/src/main/res/drawable/bg_map_marker_blue_info.xml" value="0.184" />
@@ -26,10 +52,19 @@
<entry key="modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_cars.xml" value="0.5546876453218006" />
<entry key="modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_remind.xml" value="0.35734252929687504" />
<entry key="modules/mogo-module-service/src/main/res/layout/module_services_fragment_online_car_panel.xml" value="0.28919677734374993" />
<entry key="modules/mogo-module-share/src/main/res/layout/launcher_dialog_share.xml" value="0.25416666666666665" />
<entry key="modules/mogo-module-smp/src/main/res/layout/module_small_map_view.xml" value="0.3338541666666667" />
<entry key="modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_cancel_help.xml" value="0.2421875" />
<entry key="modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_blue.xml" value="0.1390625" />
<entry key="modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_orange.xml" value="0.1359375" />
<entry key="modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_orange_vr.xml" value="0.1359375" />
<entry key="modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_read.xml" value="0.2421875" />
<entry key="modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_red_vr.xml" value="0.2421875" />
<entry key="modules/mogo-module-widgets/src/main/res/layout/module_widgets_app_entrance.xml" value="0.2838541666666667" />
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -9,10 +9,8 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarker3DResAdapter;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
import com.mogo.module.common.entity.MarkerExploreWay;
@@ -20,6 +18,7 @@ import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.utils.logger.Logger;
import java.util.HashMap;
@@ -91,7 +90,7 @@ class MarkerDrawer {
Object bindObj = markerShowEntity.getBindObj();
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
options.icon3DRes(MapMarker3DResAdapter.getMarker3DRes(poiType));
options.icon3DRes(SceneTypeEnum.getMarker3DRes(poiType));
}
}

View File

@@ -1,55 +0,0 @@
package com.mogo.module.common.drawer.marker;
import android.content.Context;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerShowEntity;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ACCIDENT;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_FOG;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ICE;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_LIVING;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_PONDING;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ROAD_WORK;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.TRAFFIC_CHECK;
/**
* created by wujifei on 2021/4/28 18:04
* describe:地图Marker的3d资源适配器
*/
public class MapMarker3DResAdapter {
public static int getMarker3DRes(String poiType) {
int res = 0;
switch (poiType) {
case FOURS_BLOCK_UP:
res = R.raw.v2x_yongdu;
break;
case FOURS_ACCIDENT:
res = R.raw.v2x_shigu;
break;
case FOURS_LIVING:
res = R.raw.v2x_shishilukuang;
break;
case FOURS_FOG:
res = R.raw.v2x_nongwu;
break;
case TRAFFIC_CHECK:
res = R.raw.v2x_jiaotongjiancha;
break;
case FOURS_ROAD_WORK:
res = R.raw.v2x_daolushigong;
break;
case FOURS_ICE:
res = R.raw.v2x_daolujiebing;
break;
case FOURS_PONDING:
res = R.raw.v2x_daolujishui;
break;
}
return res;
}
}

View File

@@ -3,6 +3,8 @@ package com.mogo.module.common.entity;
import android.text.TextUtils;
import com.mogo.module.common.enums.SceneTypeEnum;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
@@ -13,7 +15,7 @@ public class MarkerExploreWay implements Serializable {
private String infoId;
private String type;//卡片类型,
/**
* @see MarkerPoiTypeEnum
* @see SceneTypeEnum
*/
private String poiType;
private String sn;
@@ -154,7 +156,7 @@ public class MarkerExploreWay implements Serializable {
public String getPoiType() {
if (TextUtils.isEmpty(poiType)) {
return MarkerPoiTypeEnum.FOURS_BLOCK_UP;
return SceneTypeEnum.FOURS_BLOCK_UP.getPoiType();
}
return poiType;
}

View File

@@ -2,6 +2,8 @@ package com.mogo.module.common.entity;
import android.text.TextUtils;
import com.mogo.module.common.enums.SceneTypeEnum;
import java.io.Serializable;
import java.util.Objects;
@@ -57,56 +59,7 @@ public class V2XRoadEventEntity implements Serializable {
public String getTts(boolean haveLiveCar) {
tts = "前方#" + (int) getDistance() + "米#";
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
tts += "停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
tts += "加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
tts += "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
tts += "道路封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
tts += "道路施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
tts += "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
tts += "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
tts += "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
tts += "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
tts += "交通事故";
break;
default:
tts += "道路事件";
break;
}
tts += SceneTypeEnum.getTts(getPoiType());
if (haveLiveCar) {
tts += ",查看实况请说确定。";
setShowEventButton(true);
@@ -122,56 +75,7 @@ public class V2XRoadEventEntity implements Serializable {
*/
public String getTtsWithFeedback() {
tts = "检测到附近";
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
tts += "有停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
tts += "有加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
tts += "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
tts += "封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
tts += "施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
tts += "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
tts += "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
tts += "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
tts += "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
tts += "交通事故";
break;
default:
tts += "道路事件";
break;
}
tts += SceneTypeEnum.getTtsWithFeedback(getPoiType());
tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。";
return tts;
}
@@ -193,56 +97,7 @@ public class V2XRoadEventEntity implements Serializable {
}
public String getAlarmContent() {
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
alarmContent = "停车场附近";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
alarmContent = "加油站附近";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
alarmContent = "前方交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
alarmContent = "前方封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
alarmContent = "前方施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
alarmContent = "前方道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
alarmContent = "前方道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
alarmContent = "前方出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
alarmContent = "前方路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
alarmContent = "前方交通事故";
break;
default:
tts += "道路事件";
break;
}
alarmContent = SceneTypeEnum.getAlarmContent(getPoiType());
return alarmContent;
}

View File

@@ -0,0 +1,475 @@
package com.mogo.module.common.enums
import com.mogo.module.common.R
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.module.common.utils.CloudPoiManager
import com.mogo.module.common.utils.Const.*
enum class SceneTypeEnum(
val poiType: String, val poiTypeStr: String = "其它道路事件",
val poiTypeStrVr: String = "其它道路事件",
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo
) {
//加油站
GAS_STATION("10001", "加油站"),
//交通检查
TRAFFIC_CHECK("10002", "交通检查", "前方交通检查", R.drawable.v2x_icon_jiaotongjiancha_vr),
//封路
ROAD_CLOSED("10003", "封路", "前方封路", R.drawable.v2x_icon_fenglu_vr),
//商场打折
SHOP_DISCOUNT("10004", ""),
//4S店
FOURS_4S("10005", ""),
//施工
FOURS_ROAD_WORK("10006", "道路施工", "前方施工", R.drawable.v2x_icon_daolushigong_vr),
//拥堵
FOURS_BLOCK_UP("10007", "道路拥堵", "前方拥堵", R.drawable.v2x_icon_yongdu_vr),
//积水
FOURS_PONDING("10008", "道路积水", "前方道路积水", R.drawable.v2x_icon_jishui_vr),
//超市打折
FOURS_SHOP_FREE("10009", ""),
//浓雾
FOURS_FOG("10010", "出现浓雾", "浓雾预警", R.drawable.v2x_icon_nongwu_vr),
//结冰
FOURS_ICE("10011", "路面结冰"),
//停车场
FOURS_PARKING("10012", "停车场"),
//事故
FOURS_ACCIDENT("10013", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr),
//重大事故
FOURS_ACCIDENT_01("1001301", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr),
//特大事故
FOURS_ACCIDENT_02("1001302", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr),
//较大事故
FOURS_ACCIDENT_03("1001303", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr),
//一般事故
FOURS_ACCIDENT_04("1001304", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr),
//轻微事故
FOURS_ACCIDENT_05("1001305", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr),
//身边
FOURS_NEALY("10014", "身边事件"),
//实时路况
FOURS_LIVING("10015", "实时路况"),
//违章停车
ILLEGAL_PARK_LIVING("10016"),
//路面湿滑
ROAD_SLIPPERY("10021");
companion object {
@JvmStatic
fun getPoiTypeStr(poiType: String): String {
// 先获取网络配置的poi对应的名称
CloudPoiManager.getInstance().getWrapperByPoiType(poiType)?.let {
return it.title
}
// 如果获取不到,那么就用本地默认的
return when (poiType) {
GAS_STATION.poiType -> GAS_STATION.poiTypeStr
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStr
SHOP_DISCOUNT.poiType -> SHOP_DISCOUNT.poiTypeStr
FOURS_4S.poiType -> FOURS_4S.poiTypeStr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStr
FOURS_SHOP_FREE.poiType -> FOURS_SHOP_FREE.poiTypeStr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStr
FOURS_ICE.poiType -> FOURS_ICE.poiTypeStr
FOURS_PARKING.poiType -> FOURS_PARKING.poiTypeStr
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.poiTypeStr
FOURS_NEALY.poiType -> FOURS_NEALY.poiTypeStr
FOURS_LIVING.poiType -> FOURS_LIVING.poiTypeStr
else -> "其它道路事件"
}
}
@JvmStatic
fun getPoiTypeStrVr(poiType: String): String {
return when (poiType) {
GAS_STATION.poiType -> GAS_STATION.poiTypeStrVr
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStrVr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStrVr
SHOP_DISCOUNT.poiType -> SHOP_DISCOUNT.poiTypeStrVr
FOURS_4S.poiType -> FOURS_4S.poiTypeStrVr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStrVr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStrVr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStrVr
FOURS_SHOP_FREE.poiType -> FOURS_SHOP_FREE.poiTypeStrVr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStrVr
FOURS_ICE.poiType -> FOURS_ICE.poiTypeStrVr
FOURS_PARKING.poiType -> FOURS_PARKING.poiTypeStrVr
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.poiTypeStrVr
FOURS_NEALY.poiType -> FOURS_NEALY.poiTypeStrVr
FOURS_LIVING.poiType -> FOURS_LIVING.poiTypeStrVr
else -> "其它道路事件"
}
}
@JvmStatic
fun getPoiTypeSrcVr(poiType: String): Int {
return when (poiType) {
GAS_STATION.poiType -> GAS_STATION.poiTypeSrcVr
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeSrcVr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeSrcVr
SHOP_DISCOUNT.poiType -> SHOP_DISCOUNT.poiTypeSrcVr
FOURS_4S.poiType -> FOURS_4S.poiTypeSrcVr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeSrcVr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeSrcVr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeSrcVr
FOURS_SHOP_FREE.poiType -> FOURS_SHOP_FREE.poiTypeSrcVr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeSrcVr
FOURS_ICE.poiType -> FOURS_ICE.poiTypeSrcVr
FOURS_PARKING.poiType -> FOURS_PARKING.poiTypeSrcVr
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.poiTypeSrcVr
FOURS_NEALY.poiType -> FOURS_NEALY.poiTypeSrcVr
FOURS_LIVING.poiType -> FOURS_LIVING.poiTypeSrcVr
else -> R.drawable.v2x_icon_live_logo
}
}
/**
* 获取道路事件的背景色
*/
@JvmStatic
fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int {
return when (poiType) {
FOURS_PARKING.poiType, GAS_STATION.poiType -> R.drawable.bg_v2x_event_type_blue
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType, FOURS_NEALY.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_orange_vr else R.drawable.bg_v2x_event_type_orange
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
else -> {
if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
}
}
}
@JvmStatic
fun getPoiTypeBgForShareItem(poiType: String): Int {
return when (poiType) {
FOURS_PARKING.poiType, GAS_STATION.poiType ->
R.drawable.bg_v2x_event_type_blue
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType, FOURS_NEALY.poiType ->
R.drawable.bg_v2x_event_type_orange
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
FOURS_ROAD_WORK.poiType, FOURS_PONDING.poiType,
FOURS_FOG.poiType, FOURS_ICE.poiType,
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.bg_v2x_event_type_read
else -> R.drawable.bg_v2x_event_type_read
}
}
/**
* 判断是否是道路预警事件
*/
@JvmStatic
fun isRoadEvent(poiType: String?): Boolean {
return when (poiType) {
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
FOURS_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType,
FOURS_PONDING.poiType, FOURS_FOG.poiType,
FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
FOURS_ACCIDENT_05.poiType -> true
else -> false
}
}
/**
* 是否需要UGC预警
*/
@JvmStatic
fun isNeedRoadEventUgc(poiType: String?): Boolean {
return when (poiType) {
ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
FOURS_BLOCK_UP.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
FOURS_ACCIDENT_05.poiType -> true
else -> false
}
}
/**
* 获取 UGC 问答使用的 Title 和 TTS 以及展示图表
*/
@JvmStatic
fun getUgcTitleStr(poiType: String?): Array<Any?>? {
val str = arrayOfNulls<Any>(5)
when (poiType) {
ROAD_CLOSED.poiType -> {
str[0] = "你刚经过 #### \n封路吗?"
str[1] = "你刚路过的路段封路吗?您可以直接对我说封路、或者不封路。"
str[2] = R.drawable.v_to_x_event_ugc_fenglu
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP
}
FOURS_ROAD_WORK.poiType -> {
str[0] = "你刚经过 #### \n有道路施工吗?"
str[1] = "你刚路过的路段道路施工吗?您可以直接对我说有施工、或者没有施工。"
str[2] = R.drawable.bg_v2x_cancel_help
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP
}
FOURS_BLOCK_UP.poiType -> {
str[0] = "你刚路过 #### \n堵不堵?"
str[1] = "你刚路过的路段堵不堵?您可以直接对我说拥赌、或者不堵。"
str[2] = R.drawable.v_to_x_event_ugc_yongdu
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP
}
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> {
str[0] = "你刚经过 #### \n有事故发生吗?"
str[1] = "你刚路过的路段有交通事故吗?您可以直接对我说有事故、或者没有事故。"
str[2] = R.drawable.v_to_x_event_ugc_shigu
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP
}
else -> return null
}
return str
}
@JvmStatic
fun getTts(poiType: String?): String {
return when (poiType) {
FOURS_PARKING.poiType -> "停车场"
GAS_STATION.poiType -> "加油站"
TRAFFIC_CHECK.poiType -> "交通检查"
ROAD_CLOSED.poiType -> "道路封路"
FOURS_ROAD_WORK.poiType -> "道路施工"
FOURS_BLOCK_UP.poiType -> "道路拥堵"
FOURS_PONDING.poiType -> "道路积水"
FOURS_FOG.poiType -> "出现浓雾"
FOURS_ICE.poiType -> "路面结冰"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
else -> "道路事件"
}
}
@JvmStatic
fun getTtsWithFeedback(poiType: String?): String {
return when (poiType) {
FOURS_PARKING.poiType -> "有停车场"
GAS_STATION.poiType -> "有加油站"
TRAFFIC_CHECK.poiType -> "交通检查"
ROAD_CLOSED.poiType -> "封路"
FOURS_ROAD_WORK.poiType -> "施工"
FOURS_BLOCK_UP.poiType -> "道路拥堵"
FOURS_PONDING.poiType -> "道路积水"
FOURS_FOG.poiType -> "出现浓雾"
FOURS_ICE.poiType -> "路面结冰"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
else -> "道路事件"
}
}
@JvmStatic
fun getAlarmContent(poiType: String?): String {
return when (poiType) {
FOURS_PARKING.poiType -> "停车场附近"
GAS_STATION.poiType -> "加油站附近"
TRAFFIC_CHECK.poiType -> "前方交通检查"
ROAD_CLOSED.poiType -> "前方封路"
FOURS_ROAD_WORK.poiType -> "前方施工"
FOURS_BLOCK_UP.poiType -> "前方道路拥堵"
FOURS_PONDING.poiType -> "前方道路积水"
FOURS_FOG.poiType -> "前方出现浓雾"
FOURS_ICE.poiType -> "前方路面结冰"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
"前方交通事故"
else -> "道路事件"
}
}
@JvmStatic
fun getTypeSmallRes(type: String): Int {
return when (type) {
TRAFFIC_CHECK.poiType ->
R.drawable.mogo_image_jiaotongjiancha_small
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_small
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_small
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_small
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_small
FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_small
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.mogo_image_accident_small
else -> R.drawable.mogo_image_shishilukuang_small
}
}
@JvmStatic
fun getTypeRes(type: String): Int {
return when (type) {
TRAFFIC_CHECK.poiType -> R.drawable.mogo_image_jiaotongjiancha_nor
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_nor
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_nor
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_nor
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_nor
FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_nor
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.mogo_image_jiaotongshigu_nor
else -> R.drawable.mogo_image_shishlukuang_nor
}
}
@JvmStatic
fun getTypeName(type: String?): String {
return when (type) {
ROAD_CLOSED.poiType -> "封路"
FOURS_ICE.poiType -> "道路结冰"
FOURS_FOG.poiType -> "浓雾"
TRAFFIC_CHECK.poiType -> "交通检查"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
FOURS_BLOCK_UP.poiType -> "拥堵"
FOURS_ROAD_WORK.poiType -> "施工"
FOURS_PONDING.poiType -> "道路积水"
else -> "实时路况"
}
}
@JvmStatic
fun getMarker3DRes(poiType: String?): Int {
return when (poiType) {
FOURS_BLOCK_UP.poiType -> R.raw.v2x_yongdu
FOURS_ACCIDENT.poiType -> R.raw.v2x_shigu
FOURS_LIVING.poiType -> R.raw.v2x_shishilukuang
FOURS_FOG.poiType -> R.raw.v2x_nongwu
TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha
FOURS_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
FOURS_ICE.poiType -> R.raw.v2x_daolujiebing
FOURS_PONDING.poiType -> R.raw.v2x_daolujishui
else -> 0
}
}
@JvmStatic
fun getTypeNameTTS(type: String?): String {
return when (type) {
ROAD_CLOSED.poiType -> "封路"
FOURS_ICE.poiType -> "道路结冰"
FOURS_FOG.poiType -> "浓雾"
TRAFFIC_CHECK.poiType -> "交通检查"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
FOURS_BLOCK_UP.poiType -> "拥堵"
FOURS_ROAD_WORK.poiType -> "施工"
FOURS_PONDING.poiType -> "道路积水"
else -> "实时路况"
}
}
// @JvmStatic
// fun getIconRes(poiType: String?): Int {
// return when (poiType) {
// //交通检查
// TRAFFIC_CHECK.poiType -> {
// R.drawable.v_to_x_marker_2
// }
// //封路
// ROAD_CLOSED -> {
// R.drawable.v_to_x_marker_16
// }
// //施工
// FOURS_ROAD_WORK -> {
// R.drawable.v_to_x_marker_11
// }
// //拥堵
// FOURS_BLOCK_UP -> {
// R.drawable.v_to_x_marker_5
// }
// //积水
// FOURS_PONDING -> {
// R.drawable.v_to_x_marker_6
// }
// //浓雾
// FOURS_FOG -> {
// R.drawable.v_to_x_marker_9
// }
// //结冰
// FOURS_ICE -> {
// R.drawable.v_to_x_marker_8
// }
// //事故
// FOURS_ACCIDENT -> {
// R.drawable.v_to_x_marker_7
// }
// //事故
// FOURS_LIVING -> {
// R.drawable.v_to_x_marker_1
// }
// //红绿灯数据
// ALERT_TRAFFIC_LIGHT_SUGGEST -> {
// R.drawable.v_to_x_marker_3
// }
// //红绿灯数据
// ALERT_TRAFFIC_LIGHT_WARNING -> {
// R.drawable.v_to_x_marker_3
// }
// //前方静止or慢速车辆报警
// ALERT_FRONT_CAR -> {
// R.drawable.v_to_x_warning_car_red
// }
// // 故障车辆
// ALERT_CAR_TROUBLE_WARNING.toString() -> {
// R.drawable.icon_car_red
// }
// // 取快递
// ALERT_TRAFFIC_EXPRESS -> {
// R.drawable.v_to_x_marker_express
// }
// // 顺风车
// ALERT_TRAFFIC_TAXI -> {
// R.drawable.v_to_x_marker_taxi
// }
// }
// }
}
}

View File

@@ -4,7 +4,7 @@ import android.content.Context;
import android.util.ArrayMap;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -37,47 +37,47 @@ public class CloudPoiManager {
public void generateDefault() {
if (poiWrapper.isEmpty()) {
poiWrapper.put(MarkerPoiTypeEnum.GAS_STATION, new PoiWrapper(MarkerPoiTypeEnum.GAS_STATION, R.drawable.module_common_icon_map_marker_refuel,
poiWrapper.put(SceneTypeEnum.GAS_STATION.getPoiType(), new PoiWrapper(SceneTypeEnum.GAS_STATION.getPoiType(), R.drawable.module_common_icon_map_marker_refuel,
R.drawable.module_common_icon_map_marker_refuel, "加油站"));
poiWrapper.put(MarkerPoiTypeEnum.TRAFFIC_CHECK, new PoiWrapper(MarkerPoiTypeEnum.TRAFFIC_CHECK,
poiWrapper.put(SceneTypeEnum.TRAFFIC_CHECK.getPoiType(), new PoiWrapper(SceneTypeEnum.TRAFFIC_CHECK.getPoiType(),
R.drawable.module_common_icon_map_marker_road_check2, R.drawable.module_common_icon_map_marker_road_check2_white, "交通检查"));
poiWrapper.put(MarkerPoiTypeEnum.ROAD_CLOSED, new PoiWrapper(MarkerPoiTypeEnum.ROAD_CLOSED,
poiWrapper.put(SceneTypeEnum.ROAD_CLOSED.getPoiType(), new PoiWrapper(SceneTypeEnum.ROAD_CLOSED.getPoiType(),
R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路"));
poiWrapper.put(MarkerPoiTypeEnum.SHOP_DISCOUNT, new PoiWrapper(MarkerPoiTypeEnum.SHOP_DISCOUNT,
poiWrapper.put(SceneTypeEnum.SHOP_DISCOUNT.getPoiType(), new PoiWrapper(SceneTypeEnum.SHOP_DISCOUNT.getPoiType(),
R.drawable.module_common_icon_map_marker_shop_discount, R.drawable.module_common_icon_map_marker_shop_discount, "商场打折"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_4S, new PoiWrapper(MarkerPoiTypeEnum.FOURS_4S,
poiWrapper.put(SceneTypeEnum.FOURS_4S.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_4S.getPoiType(),
R.drawable.module_common_icon_map_marker_4s, R.drawable.module_common_icon_map_marker_4s, "4S店"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ROAD_WORK, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ROAD_WORK,
poiWrapper.put(SceneTypeEnum.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ROAD_WORK.getPoiType(),
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_BLOCK_UP, new PoiWrapper(MarkerPoiTypeEnum.FOURS_BLOCK_UP,
poiWrapper.put(SceneTypeEnum.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_BLOCK_UP.getPoiType(),
R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_PONDING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_PONDING,
poiWrapper.put(SceneTypeEnum.FOURS_PONDING.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_PONDING.getPoiType(),
R.drawable.module_common_icon_map_marker_pondingl2, R.drawable.module_common_icon_map_marker_pondingl2_white, "积水"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_SHOP_FREE, new PoiWrapper(MarkerPoiTypeEnum.FOURS_SHOP_FREE,
poiWrapper.put(SceneTypeEnum.FOURS_SHOP_FREE.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_SHOP_FREE.getPoiType(),
R.drawable.module_common_icon_map_marker_shop, R.drawable.module_common_icon_map_marker_shop, "超时打折"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_FOG, new PoiWrapper(MarkerPoiTypeEnum.FOURS_FOG,
poiWrapper.put(SceneTypeEnum.FOURS_FOG.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_FOG.getPoiType(),
R.drawable.module_common_ic_rc_dark_frog2, R.drawable.module_common_ic_rc_dark_frog2_white, "浓雾"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ICE, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ICE,
poiWrapper.put(SceneTypeEnum.FOURS_ICE.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ICE.getPoiType(),
R.drawable.module_common_ic_rc_freeze2, R.drawable.module_common_ic_rc_freeze2_white, "结冰"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_PARKING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_PARKING,
poiWrapper.put(SceneTypeEnum.FOURS_PARKING.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_PARKING.getPoiType(),
R.drawable.module_common_ic_rc_parking2, R.drawable.module_common_ic_rc_parking2, "停车场"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT,
poiWrapper.put(SceneTypeEnum.FOURS_ACCIDENT.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ACCIDENT.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_01, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_01,
poiWrapper.put(SceneTypeEnum.FOURS_ACCIDENT_01.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ACCIDENT_01.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "重大事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_02, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_02,
poiWrapper.put(SceneTypeEnum.FOURS_ACCIDENT_02.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ACCIDENT_02.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "特大事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_03, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_03,
poiWrapper.put(SceneTypeEnum.FOURS_ACCIDENT_03.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ACCIDENT_03.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "较大事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_04, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_04,
poiWrapper.put(SceneTypeEnum.FOURS_ACCIDENT_04.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ACCIDENT_04.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "一般事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_05, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_05,
poiWrapper.put(SceneTypeEnum.FOURS_ACCIDENT_05.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_ACCIDENT_05.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "轻微事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_NEALY, new PoiWrapper(MarkerPoiTypeEnum.FOURS_NEALY,
poiWrapper.put(SceneTypeEnum.FOURS_NEALY.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_NEALY.getPoiType(),
R.drawable.module_common_icon_map_marker_shear_news, R.drawable.module_common_icon_map_marker_shear_news, "身边"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_LIVING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_LIVING,
poiWrapper.put(SceneTypeEnum.FOURS_LIVING.getPoiType(), new PoiWrapper(SceneTypeEnum.FOURS_LIVING.getPoiType(),
R.drawable.module_common_icon_map_marker_living, R.drawable.module_common_icon_map_marker_living_white, "实时路况"));
poiWrapper.put(MarkerPoiTypeEnum.ILLEGAL_PARK_LIVING, new PoiWrapper(MarkerPoiTypeEnum.ILLEGAL_PARK_LIVING,
poiWrapper.put(SceneTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(), new PoiWrapper(SceneTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(),
R.drawable.module_common_ic_rc_illegal_park, R.drawable.module_common_ic_rc_illegal_park_white, "违章停车"));
// 分享里用到的故障求助
poiWrapper.put("9999", new PoiWrapper("9999",

View File

@@ -7,4 +7,37 @@ public class Const {
public static final String BROADCAST_SCENE_HANDLER_ACTION = "com.v2x.scene_handler_broadcast";
public static final String BROADCAST_SCENE_EXTRA_KEY = "V2XMessageEntity";
/**
* 用户UGC反馈免唤醒词语
*/
// 拥堵
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP_WORDS = {"拥堵", "很堵", "堵死了", "有点堵", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP_WORDS = {"没注意", "不堵", "很畅通", "取消", "关闭"};
// 封路
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP_WORDS = {"封路了", "封了", "封路", "有封路", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP_WORDS = {"不封路", "没注意", "没看到", "没有", "没封路", "无封路", "取消", "关闭"};
// 事故
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP_WORDS = {"有事故", "存在交通事故", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP_WORDS = {"没注意", "没有事故", "无事故", "没看到", "没有", "取消", "关闭"};
// 道路施工
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP_WORDS = {"", "在施工", "有施工", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP_WORDS = {"没注意", "没看到", "没有施工", "无施工", "很正常", "取消", "关闭"};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#3A435E" android:startColor="#525B7B" android:type="linear" />
<corners android:radius="@dimen/dp_26" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#3A435E" android:startColor="#525B7B" android:type="linear" />
<corners android:radius="@dimen/dp_26" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#ff5cc1ff"
android:startColor="#ff256bff"/>
<corners android:radius="@dimen/dp_10" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FFA757"
android:startColor="#D48721" />
<corners android:radius="@dimen/dp_10" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FFBF29"
android:startColor="#FFBF29" />
<corners android:bottomLeftRadius="@dimen/dp_20" android:topRightRadius="@dimen/dp_20"/>
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FF4944"
android:startColor="#C23632" />
<corners android:radius="@dimen/dp_10" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FF4944"
android:startColor="#C23632"/>
<corners android:bottomLeftRadius="@dimen/dp_20" />
</shape>

View File

@@ -5,6 +5,7 @@ import android.util.Log
import com.mogo.commons.voice.AIAssist
import com.mogo.map.MogoLatLng
import com.mogo.module.common.entity.MarkerPoiTypeEnum
import com.mogo.module.common.enums.SceneTypeEnum
import com.mogo.module.share.R
import com.mogo.module.share.constant.ShareConstants.*
import com.mogo.service.share.TanluUploadParams
@@ -93,18 +94,7 @@ object UploadHelper {
private fun getTypeName(type: String): String? {
return when (type) {
MarkerPoiTypeEnum.TRAFFIC_CHECK -> "交通检查"
MarkerPoiTypeEnum.ROAD_CLOSED -> "封路"
MarkerPoiTypeEnum.FOURS_ROAD_WORK -> "施工"
MarkerPoiTypeEnum.FOURS_BLOCK_UP -> "拥堵"
MarkerPoiTypeEnum.FOURS_PONDING -> "道路积水"
MarkerPoiTypeEnum.FOURS_ICE -> "道路结冰"
MarkerPoiTypeEnum.FOURS_FOG -> "浓雾"
MarkerPoiTypeEnum.FOURS_ACCIDENT -> "交通事故"
MarkerPoiTypeEnum.FOURS_LIVING -> "实时路况"
else -> "实时路况"
}
return SceneTypeEnum.getTypeName(type)
}
}

View File

@@ -12,6 +12,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.common.view.CustomRatingBar;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.entity.panel.V2XShareEventDescription;
@@ -20,7 +21,6 @@ import com.mogo.module.v2x.entity.panel.V2XShareEventItemEnum;
import com.mogo.module.v2x.entity.panel.V2XShareEventLoadMoreItem;
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
import com.mogo.module.v2x.listener.AdapterCallback;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.utils.DateTimeUtils;
@@ -108,8 +108,8 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
String notLikeNum = String.valueOf(data.getNotlikeNum());
if (poitype != null) {
((shareItemViewHolder) holder).caseStyleTextView.setText(EventTypeUtils.getPoiTypeStr(poitype));
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeUtils.getPoiTypeBgForShareItem(poitype));
((shareItemViewHolder) holder).caseStyleTextView.setText(SceneTypeEnum.getPoiTypeStr(poitype));
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(SceneTypeEnum.getPoiTypeBgForShareItem(poitype));
}
if (address != null) {

View File

@@ -10,14 +10,11 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingViewHolder;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.utils.V2XUtils;
import java.util.List;
@@ -68,7 +65,7 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
mTypeTv = holder.itemView.findViewById(R.id.tv_poitype);
mTotalTv = holder.itemView.findViewById(R.id.tv_info_total);
mTypeTv.setText(getTypeName(surroundingConstruction.getPoiType()));
mTypeTv.setText(SceneTypeEnum.getTypeName(surroundingConstruction.getPoiType()));
if (surroundingConstruction.getConstrutList() != null) {
mTotalTv.setText(surroundingConstruction.getConstrutList().size() + "");
}
@@ -77,13 +74,13 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
@Override
public void onClick(View v) {
if (mClickListener != null) {
mClickListener.onItemClickListener(v, position, surroundingConstruction);
mClickListener.onItemClickListener(v, holder.getAdapterPosition(), surroundingConstruction);
}
}
});
mBgImageView.setBackgroundResource(getTypeRes(surroundingConstruction.getPoiType()));
mTypeImageView.setBackgroundResource(getTypeSmallRes(surroundingConstruction.getPoiType()));
mBgImageView.setBackgroundResource(SceneTypeEnum.getTypeRes(surroundingConstruction.getPoiType()));
mTypeImageView.setBackgroundResource(SceneTypeEnum.getTypeSmallRes(surroundingConstruction.getPoiType()));
// RequestOptions requestOptions = new RequestOptions()
// .placeholder(R.drawable.v2x_icon_live_logo)
// .error(R.drawable.v2x_icon_live_logo)
@@ -105,132 +102,4 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
public int getItemCount() {
return mPoiInfosList == null ? 0 : mPoiInfosList.size();
}
private int getTypeSmallRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_small;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_small;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_small;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_small;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_small;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_small;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_small;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
resId = R.drawable.mogo_image_accident_small;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
default:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
}
return resId;
}
private int getTypeRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_nor;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_nor;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_nor;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_nor;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_nor;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
resId = R.drawable.mogo_image_jiaotongshigu_nor;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
default:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
}
return resId;
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName = "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName = "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
typeName = "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName = "实时路况";
break;
default:
typeName = "实时路况";
break;
}
return typeName;
}
}

View File

@@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingDetailVH;
@@ -76,7 +77,7 @@ public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroun
mUnHeartLikeView = holder.itemView.findViewById(R.id.surrounding_road_unlike);
mUserNameTv.setText( exploreWay.getUserInfo() != null ? ("用户" + exploreWay.getUserInfo().getUserName() + "分享") : "蘑菇用户分享");
mTypeTv.setText(getTypeName(exploreWay.getPoiType()));
mTypeTv.setText(SceneTypeEnum.getTypeName(exploreWay.getPoiType()));
mAddressTv.setText(exploreWay.getAddr());
mTimeTv.setText(DateTimeUtils.getTimeText(exploreWay.getGenerateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
@@ -134,50 +135,4 @@ public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroun
public int getItemCount() {
return markerExploreWays == null ? 0 : markerExploreWays.size();
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName = "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName = "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
typeName = "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName = "实时路况";
break;
default:
typeName = "实时路况";
break;
}
return typeName;
}
}

View File

@@ -13,11 +13,11 @@ import com.mogo.map.MogoLatLng;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
@@ -116,7 +116,7 @@ public class V2XEventUgcVH extends V2XBaseViewHolder<V2XEventShowEntity> {
if (mNoveltyInfo != null) {
Object[] ugcTitleStr = EventTypeUtils.getUgcTitleStr(mNoveltyInfo.getPoiType());
Object[] ugcTitleStr = SceneTypeEnum.getUgcTitleStr(mNoveltyInfo.getPoiType());
if (ugcTitleStr != null) {
tvEventUgcTitle.setText(((String) ugcTitleStr[0]).replace("####", mNoveltyInfo.getAddr()));

View File

@@ -27,6 +27,7 @@ import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.common.wm.WindowManagerView;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
@@ -39,7 +40,6 @@ import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventWindow;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadVideoCarScenario;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.view.HeartLikeView;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
@@ -275,14 +275,15 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
.displayImage(mNoveltyInfo.getUserInfo().getUserHead(), ivReportHead);
}
String poiType = EventTypeUtils.getPoiTypeStr(mNoveltyInfo.getPoiType());
String poiType = SceneTypeEnum.getPoiTypeStr(mNoveltyInfo.getPoiType());
if (!TextUtils.isEmpty(poiType)) {
tvEventTypeTitle.setText(poiType);
tvEventTypeTitle.setBackgroundResource(EventTypeUtils.getPoiTypeBg(mNoveltyInfo.getPoiType()));
tvEventTypeTitle.setBackgroundResource(SceneTypeEnum.getPoiTypeBg(mNoveltyInfo.getPoiType(),
V2XServiceManager.getMoGoStatusManager().isVrMode()));
}
ivEvent.setImageResource(EventTypeUtils.getPoiTypeSrcVr(mNoveltyInfo.getPoiType()));
tvEvent.setText(EventTypeUtils.getPoiTypeStrVr(mNoveltyInfo.getPoiType()));
ivEvent.setImageResource(SceneTypeEnum.getPoiTypeSrcVr(mNoveltyInfo.getPoiType()));
tvEvent.setText(SceneTypeEnum.getPoiTypeStrVr(mNoveltyInfo.getPoiType()));
if (V2XPoiTypeEnum.FOURS_FOG.equals(mNoveltyInfo.getPoiType())) {
V2XServiceManager.getDisplayEffectsManager().displayEffects(V2XPoiTypeEnum.FOURS_FOG);
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(ALERT_THE_FRONT_CRASH_WARNING_TOP, MogoReceiver.ACTION_V2X_FRONT_WARNING);

View File

@@ -8,9 +8,9 @@ import android.widget.TextView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.utils.TimeUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
@@ -58,7 +58,7 @@ public class V2XScenarioHistoryRoadEventVH extends V2XHistoryBaseViewHolder<V2XH
mIvIconP.setVisibility(View.GONE);
mTvAddress.setText(mExploreWay.getAddr());
mTagEventType.setText(EventTypeUtils.getPoiTypeStr(mExploreWay.getPoiType()));
mTagEventType.setText(SceneTypeEnum.getPoiTypeStr(mExploreWay.getPoiType()));
try {
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + "的分享 " +

View File

@@ -8,17 +8,14 @@ import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.ArrayList;
import java.util.Set;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* V2X 道路预警服务
@@ -54,7 +51,7 @@ public class V2XEarlyWarningServer {
String roadInfoId = v2XRoadEventEntity.getNoveltyInfo().getInfoId();
// 封路、施工、拥堵、拥堵 才会有UGC提示
if (EventTypeUtils.isNeedRoadEventUgc(v2XRoadEventEntity.getPoiType())) {
if (SceneTypeEnum.isNeedRoadEventUgc(v2XRoadEventEntity.getPoiType())) {
// Logger.w(MODULE_NAME,
// "V2X预警--UGC检测" +
// "\n事件详情" + roadInfoId +

View File

@@ -2,6 +2,7 @@ package com.mogo.module.v2x.entity.panel;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.enums.SceneTypeEnum;
import java.io.Serializable;
import java.util.ArrayList;
@@ -39,43 +40,7 @@ public class SurroundingConstruction implements Serializable {
public String getTypeNameTTS(String type) {
String typeName = "请查看周边的";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName += "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName += "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName += "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName += "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
typeName += "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName += "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName += "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName += "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName += "实时路况";
break;
default:
typeName += "实时路况";
break;
}
typeName += SceneTypeEnum.getTypeNameTTS(type);
return typeName + "信息";
}
}

View File

@@ -23,8 +23,8 @@ import com.google.android.material.tabs.TabLayoutMediator
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.mvp.MvpFragment
import com.mogo.module.common.entity.MarkerExploreWay
import com.mogo.module.common.entity.MarkerPoiTypeEnum
import com.mogo.module.common.MogoApisHandler
import com.mogo.module.common.enums.SceneTypeEnum
import com.mogo.module.v2x.R
import com.mogo.module.v2x.SpacesItemDecoration
import com.mogo.module.v2x.V2XConst.MODULE_NAME
@@ -317,14 +317,14 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
mSurroundingDetailAdapter.notifyDataSetChanged()
val originStr = String.format(context!!.resources.getString(R.string.v2x_surrounding_detail_top_brief), markerExploreWays.size)
val spannableString = SpannableString(originStr + getTypeName(detailData.poiType))
val spannableString = SpannableString(originStr + SceneTypeEnum.getTypeName(detailData.poiType))
spannableString.setSpan(ForegroundColorSpan(Color.parseColor("#459DFF")),
7, originStr.length - getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
7, originStr.length - SceneTypeEnum.getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
//设置字体大小true表示前面的字体大小 dip
spannableString.setSpan(AbsoluteSizeSpan(context!!.resources.getDimension(R.dimen.module_v2x_surrounding_top_textsize).toInt(), true),
7, originStr.length - getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
7, originStr.length - SceneTypeEnum.getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
spannableString.setSpan(StyleSpan(Typeface.BOLD), 7,
originStr.length - getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
originStr.length - SceneTypeEnum.getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
mTopBriefTv?.text = (spannableString)
}
}
@@ -356,21 +356,6 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
}
private fun getTypeName(type: String): String? {
return when (type) {
MarkerPoiTypeEnum.ROAD_CLOSED -> "封路"
MarkerPoiTypeEnum.FOURS_ICE -> "道路结冰"
MarkerPoiTypeEnum.FOURS_FOG -> "浓雾"
MarkerPoiTypeEnum.TRAFFIC_CHECK -> "交通检查"
MarkerPoiTypeEnum.FOURS_ACCIDENT -> "交通事故"
MarkerPoiTypeEnum.FOURS_BLOCK_UP -> "拥堵"
MarkerPoiTypeEnum.FOURS_ROAD_WORK -> "施工"
MarkerPoiTypeEnum.FOURS_PONDING -> "道路积水"
MarkerPoiTypeEnum.FOURS_LIVING -> "实时路况"
else -> "实时路况"
}
}
/*
* 语音查询事件面板内容
* */

View File

@@ -21,10 +21,9 @@ import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.Utils;
@@ -35,7 +34,6 @@ import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
import com.mogo.module.v2x.listener.V2XMarkerClickListener;
import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
import com.mogo.module.v2x.marker.V2XMarkerAdapter;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.utils.ViewUtils;
import com.mogo.utils.logger.Logger;
@@ -141,7 +139,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
if (exploreWayList != null) {
for (MarkerExploreWay markerExploreWay : exploreWayList) {
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
if (SceneTypeEnum.isRoadEvent(markerExploreWay.getPoiType())) {
MarkerLocation markerLocation = markerExploreWay.getLocation();
// 记录道路事件
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
@@ -415,26 +413,21 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
markerShowEntity.setTextContent(noveltyInfo.getLocation().getAddress());
// 这里只绘制道路事件相关
switch (noveltyInfo.getPoiType()) {
case V2XPoiTypeEnum.TRAFFIC_CHECK:
case V2XPoiTypeEnum.ROAD_CLOSED:
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
case V2XPoiTypeEnum.FOURS_PONDING:
case V2XPoiTypeEnum.FOURS_PARKING:
case V2XPoiTypeEnum.FOURS_ICE:
case V2XPoiTypeEnum.FOURS_FOG:
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
drawableMarker(
V2XServiceManager.getContext(),
markerShowEntity,
clickListener);
break;
if (SceneTypeEnum.TRAFFIC_CHECK.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.ROAD_CLOSED.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ROAD_WORK.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_PONDING.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_PARKING.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ICE.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_FOG.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_01.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_02.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_03.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_04.getPoiType().equals(noveltyInfo.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_05.getPoiType().equals(noveltyInfo.getPoiType())) {
drawableMarker(V2XServiceManager.getContext(), markerShowEntity, clickListener);
}
}
}

View File

@@ -17,6 +17,7 @@ import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.SceneTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
@@ -171,37 +172,35 @@ public class V2XRoadEventWindow extends V2XBasWindow
//Logger.d(MODULE_NAME, "V2X===道路事件:" + v2XRoadEventEntity);
// 进行类型分发
switch (v2XRoadEventEntity.getPoiType()) {
case V2XPoiTypeEnum.TRAFFIC_CHECK: // 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED://封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK://施工
case FOURS_BLOCK_UP://拥堵
case V2XPoiTypeEnum.FOURS_PONDING://积水
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
case V2XPoiTypeEnum.FOURS_LIVING://实时路况
case V2XPoiTypeEnum.FOURS_NEALY://身边
// 展示道路事件本身详情
if (mItemList.isEmpty()) {
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
v2XEventShowEntity.setViewType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XEventShowEntity.setV2XRoadEventEntity(v2XRoadEventEntity);
mItemList.add(v2XEventShowEntity);
}
// 获取道路事件周边的直播车机
V2XServiceManager
.getV2XRefreshModel()
.queryNearbyVehicleLiveByLocation(
this,
v2XRoadEventEntity.getLocation().getLon(),
v2XRoadEventEntity.getLocation().getLat());
break;
if (SceneTypeEnum.TRAFFIC_CHECK.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.ROAD_CLOSED.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ROAD_WORK.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_PONDING.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_FOG.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ICE.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_01.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_02.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_03.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_04.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_ACCIDENT_05.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_LIVING.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| SceneTypeEnum.FOURS_NEALY.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
// 展示道路事件本身详情
if (mItemList.isEmpty()) {
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
v2XEventShowEntity.setViewType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XEventShowEntity.setV2XRoadEventEntity(v2XRoadEventEntity);
mItemList.add(v2XEventShowEntity);
}
// 获取道路事件周边的直播车机
V2XServiceManager
.getV2XRefreshModel()
.queryNearbyVehicleLiveByLocation(
this,
v2XRoadEventEntity.getLocation().getLon(),
v2XRoadEventEntity.getLocation().getLat());
}
}
// 刷新列表

View File

@@ -1,364 +0,0 @@
package com.mogo.module.v2x.utils;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.module.common.utils.CloudPoiManager;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.utils.logger.Logger;
/**
* @ProjectName: MoGoModulSafeDriving
* @Package: com.mogo.module.v2x.utils
* @ClassName: EventTypeUtils
* @Description: java类作用描述
* @Author: fenghl
* @CreateDate: 2020/5/20 17:10
* @UpdateUser: 更新者:
* @UpdateDate: 2020/5/20 17:10
* @UpdateRemark: 更新说明:
* @Version: 1.0
*/
public class EventTypeUtils {
public static String getPoiTypeStr(String poiType) {
// 先获取网络配置的poi对应的名称
PoiWrapper wrapper = CloudPoiManager.getInstance().getWrapperByPoiType(poiType);
if (wrapper != null) {
//Logger.d("EventTypeUtils", "从配置表中拿到了相关数据: " + wrapper.getTitle());
return wrapper.getTitle();
}
// 如果获取不到,那么就用本地默认的
String str = "其它道路事件";
switch (poiType) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
str = "停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
str = "加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
str = "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
str = "封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
str = "道路施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str = "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
str = "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
str = "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
str = "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
str = "交通事故";
break;
// 实时路况
case V2XPoiTypeEnum.FOURS_LIVING:
str = "实时路况";
break;
// 身边
case V2XPoiTypeEnum.FOURS_NEALY:
str = "身边事件";
break;
default:
str = "其它道路事件";
break;
}
return str;
}
public static int getPoiTypeSrcVr(String poiType) {
int src;
switch (poiType) {
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
src = R.drawable.v2x_icon_yongdu_vr;
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
src = R.drawable.v2x_icon_jishui_vr;
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
src = R.drawable.v2x_icon_nongwu_vr;
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
src = R.drawable.v2x_icon_fenglu_vr;
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
src = R.drawable.v2x_icon_daolushigong_vr;
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
src = R.drawable.v2x_icon_jiaotongshigu_vr;
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
src = R.drawable.v2x_icon_jiaotongjiancha_vr;
break;
default:
src = R.drawable.v2x_icon_live_logo;
break;
}
return src;
}
public static String getPoiTypeStrVr(String poiType) {
String str = "其它道路事件";
switch (poiType) {
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str = "前方拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
str = "前方道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
str = "浓雾预警";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
str = "前方封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
str = "前方施工";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
str = "前方交通事故";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
str = "前方交通检查";
break;
default:
str = "其它道路事件";
break;
}
return str;
}
/**
* 获取道路事件的背景色
*
* @param poiType poi类型
* @return 背景
*/
public static int getPoiTypeBg(String poiType) {
int strBg;
switch (poiType) {
case V2XPoiTypeEnum.FOURS_PARKING: // 停车场
case V2XPoiTypeEnum.GAS_STATION: // 加油站
strBg = R.drawable.bg_v2x_event_type_blue;
break;
case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵
case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况
case V2XPoiTypeEnum.FOURS_NEALY: // 身边
strBg = V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.drawable.bg_v2x_event_type_orange_vr : R.drawable.bg_v2x_event_type_orange;
break;
case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED:// 封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK:// 施工
case V2XPoiTypeEnum.FOURS_PONDING:// 积水
case V2XPoiTypeEnum.FOURS_FOG: // 浓雾
case V2XPoiTypeEnum.FOURS_ICE: // 结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
strBg = V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.drawable.bg_v2x_event_type_red_vr : R.drawable.bg_v2x_event_type_read;
break;
default:
strBg = V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.drawable.bg_v2x_event_type_red_vr : R.drawable.bg_v2x_event_type_read;
break;
}
return strBg;
}
/*
* VR模式下道路类型影响到分享列表 (VR模式暂时没有事件面板,所以可以删除此方法,公用上边的getPoiTypeBg)
* */
public static int getPoiTypeBgForShareItem(String poiType) {
int strBg;
switch (poiType) {
case V2XPoiTypeEnum.FOURS_PARKING: // 停车场
case V2XPoiTypeEnum.GAS_STATION: // 加油站
strBg = R.drawable.bg_v2x_event_type_blue;
break;
case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵
case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况
case V2XPoiTypeEnum.FOURS_NEALY: // 身边
strBg = R.drawable.bg_v2x_event_type_orange;
break;
case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED:// 封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK:// 施工
case V2XPoiTypeEnum.FOURS_PONDING:// 积水
case V2XPoiTypeEnum.FOURS_FOG: // 浓雾
case V2XPoiTypeEnum.FOURS_ICE: // 结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
strBg = R.drawable.bg_v2x_event_type_read;
break;
default:
strBg = R.drawable.bg_v2x_event_type_read;
break;
}
return strBg;
}
/**
* 判断是否是道路预警事件
*
* @param poiType
* @return
*/
public static boolean isRoadEvent(String poiType) {
boolean isRoadEvent = false;
// 进行类型分发
switch (poiType) {
case V2XPoiTypeEnum.TRAFFIC_CHECK: // 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED://封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK://施工
case V2XPoiTypeEnum.FOURS_BLOCK_UP://拥堵
case V2XPoiTypeEnum.FOURS_PONDING://积水
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
isRoadEvent = true;
break;
}
return isRoadEvent;
}
/**
* 是否需要UGC预警
*
* @param poiType
* @return
*/
public static boolean isNeedRoadEventUgc(String poiType) {
boolean isRoadEvent = false;
// 进行类型分发
switch (poiType) {
case V2XPoiTypeEnum.ROAD_CLOSED://封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK://施工
case V2XPoiTypeEnum.FOURS_BLOCK_UP://拥堵
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
isRoadEvent = true;
break;
}
return isRoadEvent;
}
/**
* 获取 UGC 问答使用的 Title 和 TTS 以及展示图表
*
* @param poiType 事件类型
* @return UGC 文案
*/
public static Object[] getUgcTitleStr(String poiType) {
Object[] str = new Object[5];
switch (poiType) {
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
str[0] = "你刚经过 #### \n封路吗";
str[1] = "你刚路过的路段封路吗?您可以直接对我说封路、或者不封路。";
str[2] = R.drawable.v_to_x_event_ugc_fenglu;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP;
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
str[0] = "你刚经过 #### \n有道路施工吗";
str[1] = "你刚路过的路段道路施工吗?您可以直接对我说有施工、或者没有施工。";
str[2] = R.drawable.v_to_x_event_ugc_shigong;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP;
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str[0] = "你刚路过 #### \n堵不堵";
str[1] = "你刚路过的路段堵不堵?您可以直接对我说拥赌、或者不堵。";
str[2] = R.drawable.v_to_x_event_ugc_yongdu;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP;
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
str[0] = "你刚经过 #### \n有事故发生吗";
str[1] = "你刚路过的路段有交通事故吗?您可以直接对我说有事故、或者没有事故。";
str[2] = R.drawable.v_to_x_event_ugc_shigu;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP;
break;
default:
return null;
}
return str;
}
}