数据下沉到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

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 = {"没注意", "没看到", "没有施工", "无施工", "很正常", "取消", "关闭"};
}