diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index c394ba105c..4e0cb392df 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.msgbox import android.content.Context import android.os.Looper import com.mogo.eagle.core.data.msgbox.* -import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb 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 18134d8151..0eceebdb66 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 @@ -263,7 +263,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); } } @@ -276,8 +276,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 @@ />