开启了实时路况的预警展示

This commit is contained in:
董宏宇
2020-08-07 12:32:15 +08:00
parent 706d45dd4f
commit f11630b1aa
2 changed files with 11 additions and 6 deletions

View File

@@ -6,10 +6,10 @@ import android.graphics.Bitmap
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.module.service.utils.ViewUtils
import com.mogo.module.v2x.R
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.module.common.entity.V2XRoadEventEntity
import com.mogo.module.service.utils.ViewUtils
import com.mogo.module.v2x.R
import kotlinx.android.synthetic.main.view_marker_event_car.view.*
/**
@@ -23,7 +23,7 @@ import kotlinx.android.synthetic.main.view_marker_event_car.view.*
* version: 1.0
*/
class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
ConstraintLayout(context) {
ConstraintLayout(context) {
val TAG = "V2XMarkerRoadEventView"
init {
@@ -32,13 +32,13 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
fun initView(context: Context, alarmInfo: V2XRoadEventEntity) {
if (alarmInfo.poiType == V2XPoiTypeEnum.ALERT_FRONT_CAR ||
alarmInfo.poiType == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString()
alarmInfo.poiType == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString()
) {
LayoutInflater.from(context)
.inflate(R.layout.view_marker_event_car, this)
.inflate(R.layout.view_marker_event_car, this)
} else {
LayoutInflater.from(context)
.inflate(R.layout.view_marker_event_road, this)
.inflate(R.layout.view_marker_event_road, this)
}
updateIcon(alarmInfo)
}
@@ -82,6 +82,10 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
V2XPoiTypeEnum.FOURS_ACCIDENT -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_7)
}
//事故
V2XPoiTypeEnum.FOURS_LIVING -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_1)
}
//红绿灯数据
V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_3)

View File

@@ -127,6 +127,7 @@ public class EventTypeUtils {
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case V2XPoiTypeEnum.FOURS_LIVING://实时路况
isRoadEvent = true;
break;
}