[2.13.2][feat]新增全览V2X事件的日志
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -38,8 +38,8 @@ data class V2XEvent(
|
||||
@SerializedName("radius")
|
||||
var radius: Double,
|
||||
|
||||
@SerializedName("type")
|
||||
var type: Int
|
||||
@SerializedName("poiType")
|
||||
var poiType: String?
|
||||
)
|
||||
|
||||
@Keep
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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<ImageView>(R.id.ivIcon)
|
||||
val contentView = findViewById<TextView>(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 = "弱势预警"
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv"
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="119dp"
|
||||
android:layout_height="35dp"
|
||||
android:text="道路施工"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user