diff --git a/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java b/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java index 7c39af50bb..a4e603b05e 100644 --- a/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java +++ b/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java @@ -66,6 +66,7 @@ import java.util.TimerTask; import chassis.VehicleStateOuterClass; import mogo.telematics.pad.MessagePad; +import mogo.v2x.ObuWarningEvent; import mogo_msg.MogoReportMsg; import perception.TrafficLightOuterClass; import prediction.Prediction; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index a080bc6d00..f357943f1f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -17,7 +17,6 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.module.MogoModule; import com.mogo.commons.module.MogoModulePaths; -import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.constants.MoGoConfig; import com.mogo.eagle.core.data.constants.MogoServicePaths; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt index e57241ae53..38dcae72a6 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt @@ -38,8 +38,8 @@ data class V2XEvent( @SerializedName("radius") var radius: Double, - @SerializedName("type") - var type: Int + @SerializedName("poiType") + var poiType: String? ) @Keep diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index e6d7bb9401..05aeee34af 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -271,7 +271,7 @@ public class AMapCustomView LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, center.getLat(), center.getLon()); markerOption.position(latLng); markerOption.anchor(0.13f, 1f); - markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap())); + markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap(event.getPoiType()))); markerOptionsList.add(markerOption); } } @@ -284,8 +284,8 @@ public class AMapCustomView currMarkerList = mAMap.addMarkers(markerOptionsList, false); } - private Bitmap getV2XBitmap() { - V2XMarkerView marker = new V2XMarkerView(getContext()); + private Bitmap getV2XBitmap(String poiType) { + V2XMarkerView marker = new V2XMarkerView(getContext(), null, 0, poiType); marker.measure(View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 229), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 96), View.MeasureSpec.EXACTLY)); marker.layout(0, 0, marker.getMeasuredWidth(), marker.getMeasuredHeight()); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt index a776a29073..687ec34f1b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt @@ -3,14 +3,16 @@ package com.mogo.eagle.core.function.smp import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater +import android.widget.ImageView +import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.function.map.R -import kotlinx.android.synthetic.main.view_maker_with_count.view.* class V2XMarkerView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + defStyleAttr: Int = 0, + private val poiType: String? = "" ) : ConstraintLayout ( context, attrs, @@ -19,5 +21,33 @@ class V2XMarkerView @JvmOverloads constructor( init { LayoutInflater.from(context).inflate(R.layout.layout_v2x_maker, this, true) + initView() + } + + private fun initView() { + val iconView = findViewById(R.id.ivIcon) + val contentView = findViewById(R.id.tvContent) + when (poiType) { + "10006" -> { + iconView.setBackgroundResource(R.drawable.icon_small_v2x_road_construction) + contentView.text = "道路施工" + } + "10007" -> { + iconView.setBackgroundResource(R.drawable.icon_v2x_road_congestion) + contentView.text = "道路拥堵" + } + "10032" -> { + iconView.setBackgroundResource(R.drawable.icon_v2x_road_accidents) + contentView.text = "道路事故" + } + "10025" -> { + iconView.setBackgroundResource(R.drawable.icon_v2x_obstacle) + contentView.text = "障碍车辆" + } +// "10031" -> { +// iconView.setBackgroundResource(R.drawable.icon_small_v2x_road_construction) +// contentView.text = "弱势预警" +// } + } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml index 8a5ee087ea..d105f5057d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml @@ -19,7 +19,7 @@ />