整理资源
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
package com.mogo.module.common.utils
|
||||
|
||||
import com.mogo.module.common.enum.WarningTypeEnum
|
||||
import com.mogo.module.common.R
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhoukeyi
|
||||
* @date 2021/8/6 11:04 上午
|
||||
*/
|
||||
object WarningUtils {
|
||||
fun getWarningIcon(v2xType: Int): Array<Any> {
|
||||
var warningIconId = R.drawable.icon_warning_v2x_abnormal_vehicle
|
||||
var warningContent = "注意周边环境"
|
||||
var warningTts = "注意周边环境"
|
||||
|
||||
when (v2xType) {
|
||||
WarningTypeEnum.WARNING_PRIOR_COLLISION -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_collision_warning
|
||||
warningContent = "前车碰撞预警"
|
||||
warningTts = "前车碰撞预警"
|
||||
}//前向碰撞
|
||||
WarningTypeEnum.WARNING_INTERSECTION_COLLISION -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_collision_warning
|
||||
warningContent = "注意交叉路口车辆"
|
||||
warningTts = "注意交叉路口车辆"
|
||||
}//交叉路口碰撞
|
||||
WarningTypeEnum.WARNING_LEFT_AUXILIARY -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_collision_warning
|
||||
warningContent = "注意左前车辆"
|
||||
warningTts = "注意左前车辆"
|
||||
}//左转辅助
|
||||
WarningTypeEnum.WARNING_BLIND_AREA_COLLISION -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_blind_area_collision
|
||||
warningContent = "注意后方来车"
|
||||
warningTts = "注意后方来车"
|
||||
}//盲区/变道辅助
|
||||
WarningTypeEnum.WARNING_REVERSE_OVERTAKING -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_blind_area_collision
|
||||
warningContent = "注意逆向车道车辆"
|
||||
warningTts = "注意逆向车道车辆"
|
||||
}//逆向超车
|
||||
WarningTypeEnum.WARNING_VEHICLE_BRAKES -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_emergency_brake
|
||||
warningContent = "前车急刹车"
|
||||
warningTts = "前车急刹车"
|
||||
}//紧急制动-前车急刹
|
||||
WarningTypeEnum.WARNING_ABNORMAL_VEHICLE -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_abnormal_vehicle
|
||||
warningContent = "前车异常"
|
||||
warningTts = "前车异常"
|
||||
}//异常车辆提醒
|
||||
WarningTypeEnum.WARNING_VEHICLE_CONTROL -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_vehicle_control
|
||||
warningContent = "前车失控预警"
|
||||
warningTts = "前车失控预警"
|
||||
}//车辆失控预警
|
||||
WarningTypeEnum.WARNING_SPECIAL_VEHICLE_ACCESS -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_special_vehicle_access
|
||||
warningContent = "请避让特种车辆"
|
||||
warningTts = "后方存在特殊车辆,请安排避让"
|
||||
}//特种车辆通行
|
||||
WarningTypeEnum.WARNING_SPEED_LIMIT -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_over_speed
|
||||
warningContent = "减速慢行"
|
||||
warningTts = "请减速慢行"
|
||||
}// 限速预警
|
||||
WarningTypeEnum.WARNING_RED_LIGHT -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_traffic_lights_red
|
||||
warningContent = "路口红灯,禁止通行"
|
||||
warningTts = "路口红灯,禁止通行"
|
||||
}//闯红灯预警
|
||||
WarningTypeEnum.WARNING_VULNERABLE_TRANSPORT_PARTICIPANT -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_pedestrian_crossing
|
||||
warningContent = "行人碰撞预警"
|
||||
warningTts = "行人碰撞预警"
|
||||
}//弱势交通参与者碰撞预警
|
||||
WarningTypeEnum.WARNING_TRAFFIC_SPEED_GUIDE -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_traffic_lights_green
|
||||
warningContent = "绿波通行"
|
||||
warningTts = "绿波通行"
|
||||
}//绿波通行车速引导
|
||||
WarningTypeEnum.WARNING_CAR_PLATE -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_road_construction
|
||||
warningContent = "前方施工"
|
||||
warningTts = "前方施工"
|
||||
}//车内标牌
|
||||
WarningTypeEnum.warning_congestion -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_congestion
|
||||
warningContent = "前方道路拥堵"
|
||||
warningTts = "前方道路拥堵"
|
||||
}//前方道路拥堵
|
||||
WarningTypeEnum.WARNING_OVER_SPEED -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_over_speed
|
||||
warningContent = "您已超速"
|
||||
warningTts = "您已超速"
|
||||
}//超速预警
|
||||
WarningTypeEnum.WARNING_ROAD_HAZARDS -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_road_dangerous
|
||||
warningContent = "道路危险情况预警"
|
||||
warningTts = "道路危险情况预警"
|
||||
}//道路危险情况预警
|
||||
WarningTypeEnum.WARNING_ROUNDABOUT -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_roundaboutpng
|
||||
warningContent = "前方驶入环岛"
|
||||
warningTts = "前方驶入环岛"
|
||||
}//环岛
|
||||
WarningTypeEnum.WARNING_GIVE_WAY -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_over_speed
|
||||
warningContent = "有车出入,减速慢行"
|
||||
warningTts = "有车出入,减速慢行"
|
||||
}//减速让行
|
||||
WarningTypeEnum.WARNING_BAN_ASTERN -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_ban_astern
|
||||
warningContent = "当前路段禁止停车"
|
||||
warningTts = "当前路段禁止停车"
|
||||
}//禁止停车
|
||||
WarningTypeEnum.WARNING_TURN_LEFT_SHARP -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_turn_left_sharp
|
||||
warningContent = "前方左转急弯"
|
||||
warningTts = "前方路口左转急弯,请减速慢行"
|
||||
}//左转急弯
|
||||
WarningTypeEnum.WARNING_TURN_RIGHT_SHARP -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_turn_right_sharp
|
||||
warningContent = "前方右转急弯"
|
||||
warningTts = "前方路口右转急弯,请减速慢行"
|
||||
}//右转急弯
|
||||
WarningTypeEnum.WARNING_TRAMCAR -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_tramcar
|
||||
warningContent = "前方有轨电车提醒"
|
||||
warningTts = "前方有轨电车经过,请注意行驶安全"
|
||||
}//有轨电车
|
||||
WarningTypeEnum.WARNING_TEST_SECTION -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_test_section
|
||||
warningContent = "前方考试路段"
|
||||
warningTts = "前方考试路段,减速慢行"
|
||||
}//考试路段
|
||||
WarningTypeEnum.WARNING_ACCIDENT_PRONE_ROAD_SECTION -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_accident_prone_road_section
|
||||
warningContent = "当前路段事故多发"
|
||||
warningTts = "当前路段事故多发,请谨慎行驶"
|
||||
}//事故易发路段
|
||||
WarningTypeEnum.WARNING_HUMP_BRIDGE -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_hump_bridge
|
||||
warningContent = "前方驼峰桥"
|
||||
warningTts = "即将驶入桥梁,请减速慢行"
|
||||
}//驼峰桥
|
||||
WarningTypeEnum.WARNING_SCHOOL -> {
|
||||
warningIconId = R.drawable.icon_warning_v2x_school
|
||||
warningContent = "前方学校,减速慢行"
|
||||
warningTts = "前方人行横道,请减速慢"
|
||||
}// 学校
|
||||
}
|
||||
|
||||
return arrayOf(warningIconId, warningContent, warningTts)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user