[2.12.0] local code style change
This commit is contained in:
@@ -8,6 +8,8 @@ import androidx.core.util.Pair
|
||||
import androidx.localbroadcastmanager.content.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.cloud.passport.*
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.module.common.enums.EventTypeHelper
|
||||
import com.mogo.commons.network.*
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW
|
||||
@@ -34,7 +36,6 @@ import com.mogo.eagle.core.function.v2x.events.receiver.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker.Marker
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.*
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.*
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils
|
||||
import com.mogo.eagle.core.function.v2x.events.voice.*
|
||||
@@ -51,7 +52,6 @@ import com.mogo.module.common.*
|
||||
import com.mogo.module.common.drawer.*
|
||||
import com.mogo.module.common.entity.*
|
||||
import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum
|
||||
import com.mogo.module.common.enums.*
|
||||
import com.mogo.service.statusmanager.*
|
||||
import com.mogo.service.statusmanager.StatusDescriptor.ACC_STATUS
|
||||
import com.mogo.service.statusmanager.StatusDescriptor.SEEK_HELPING
|
||||
|
||||
@@ -62,8 +62,6 @@ internal object BridgeApi {
|
||||
|
||||
fun statusManager(): IMogoStatusManager? = apis?.statusManagerApi
|
||||
|
||||
fun analytics() = apis?.analyticsApi
|
||||
|
||||
fun v2xMarker() = v2xMarker
|
||||
|
||||
fun v2xPolyline() = v2xPolyline
|
||||
@@ -80,12 +78,4 @@ internal object BridgeApi {
|
||||
|
||||
fun registerCenter() = apis?.registerCenterApi
|
||||
|
||||
fun imageLoader() = apis?.imageLoaderApi
|
||||
|
||||
fun windowManager() = apis?.windowManagerApi
|
||||
|
||||
fun displayEffects() = apis?.displayEffectsManager
|
||||
|
||||
fun intentManager() = apis?.intentManagerApi
|
||||
|
||||
}
|
||||
@@ -3,18 +3,10 @@ package com.mogo.eagle.core.function.v2x.events.manager;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerNoveltyInfo;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.v2x.data.V2XMarkerCardResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
@@ -43,23 +35,6 @@ public interface IMoGoV2XMarkerManager extends IProvider {
|
||||
*/
|
||||
void analysisV2XRoadEvent(V2XMarkerCardResult markerCardResult);
|
||||
|
||||
|
||||
/**
|
||||
* 展开气泡
|
||||
*
|
||||
* @param context
|
||||
* @param currentMarker
|
||||
*/
|
||||
IMogoMarker openMarker(Context context, IMogoMarker currentMarker);
|
||||
|
||||
/**
|
||||
* 关闭气泡
|
||||
*
|
||||
* @param context
|
||||
* @param currentMarker
|
||||
*/
|
||||
void closeMarker(Context context, IMogoMarker currentMarker);
|
||||
|
||||
/**
|
||||
* 绘制正在预警的道路事件的POI点
|
||||
*
|
||||
|
||||
@@ -4,15 +4,14 @@ import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
@@ -21,21 +20,16 @@ import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
@@ -45,6 +39,7 @@ import com.mogo.v2x.data.V2XMarkerExploreWay;
|
||||
import com.mogo.v2x.data.V2XMarkerLocation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
@@ -127,7 +122,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
// 探路目前只有上报拥堵
|
||||
String poi = markerExploreWay.getPoiType();
|
||||
v2XRoadEventEntity.setPoiType(poi);
|
||||
v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay,markerCardResult.getExtras()));
|
||||
v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay, markerCardResult.getExtras()));
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
}
|
||||
@@ -139,67 +134,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IMogoMarker openMarker(Context context, IMogoMarker currentMarker) {
|
||||
try {
|
||||
if (currentMarker != null) {
|
||||
Object object = currentMarker.getObject();
|
||||
if (object != null) {
|
||||
// 修改数据
|
||||
MarkerShowEntity showEntity = (MarkerShowEntity) object;
|
||||
showEntity.setChecked(true);
|
||||
|
||||
// 获取数据对应的View
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView(context,
|
||||
showEntity,
|
||||
currentMarker.getMogoMarkerOptions());
|
||||
|
||||
Bitmap bitmap;
|
||||
if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
|
||||
|| showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) {
|
||||
bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity);
|
||||
} else {
|
||||
bitmap = ViewUtils.fromView(markerView.getView());
|
||||
}
|
||||
|
||||
currentMarker.setIcon(bitmap);
|
||||
currentMarker.setToTop();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return currentMarker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeMarker(Context context, IMogoMarker currentMarker) {
|
||||
try {
|
||||
if (currentMarker != null) {
|
||||
Object object = currentMarker.getObject();
|
||||
if (object != null) {
|
||||
MarkerShowEntity showEntity = (MarkerShowEntity) object;
|
||||
showEntity.setChecked(false);
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView(context,
|
||||
showEntity,
|
||||
currentMarker.getMogoMarkerOptions());
|
||||
|
||||
Bitmap bitmap;
|
||||
if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
|
||||
|| showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) {
|
||||
bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity);
|
||||
} else {
|
||||
bitmap = ViewUtils.fromView(markerView.getView());
|
||||
}
|
||||
currentMarker.setIcon(bitmap);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) {
|
||||
try {
|
||||
@@ -225,20 +159,15 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
markerShowEntity.setMarkerLocation(markerExploreWay.getLocation());
|
||||
markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_NOVELTY);
|
||||
|
||||
// 由于性能问题,D车机不使用事件扩散动画
|
||||
if (!CarSeries.isF8xxSeries()) {
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
|
||||
} else {
|
||||
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
|
||||
optionsRipple.period(1);
|
||||
}
|
||||
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
|
||||
optionsRipple.period(1);
|
||||
boolean isVrMode = false;
|
||||
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
|
||||
if (statusManager != null) {
|
||||
isVrMode = statusManager.isVrMode();
|
||||
}
|
||||
if (isVrMode) {
|
||||
mAlarmInfoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, clickListener);
|
||||
mAlarmInfoMarker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity);
|
||||
} else {
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
|
||||
IMogoMarkerManager marker = MogoMarkerManager.getInstance(context);
|
||||
|
||||
@@ -3,23 +3,11 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.mogo.eagle.core.function.v2x.R;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
@@ -27,7 +26,7 @@ public class V2XMarkerAdapter {
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回道路事件静态的图,因为D车机性能不行,会卡顿
|
||||
* 返回道路事件静态的图,因为车机性能不行,会卡顿
|
||||
*/
|
||||
public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) {
|
||||
Bitmap bitmap;
|
||||
@@ -156,17 +155,4 @@ public class V2XMarkerAdapter {
|
||||
return icons;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟点
|
||||
*
|
||||
* @param context 上下文
|
||||
* @return MarkerView
|
||||
*/
|
||||
public static Bitmap getV2XCarMarkerView(Context context, MarkerShowEntity showEntity) {
|
||||
if (showEntity.isChecked()) {
|
||||
return new V2XMarkerCarInfoView(context, showEntity).getView();
|
||||
} else {
|
||||
return new V2XMarkerCarView(context, showEntity).getView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.marker
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.text.TextUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.v2x.R
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes.V2XMarkerEntity
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar
|
||||
import com.mogo.module.common.entity.MarkerShowEntity
|
||||
import kotlinx.android.synthetic.main.view_marker_car.view.*
|
||||
import kotlinx.android.synthetic.main.view_marker_car_info.view.*
|
||||
import kotlinx.android.synthetic.main.view_marker_car_info.view.ivCar
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-0619:55
|
||||
* desc : 绘制在线车辆,特殊车辆
|
||||
* version: 1.0
|
||||
*/
|
||||
class V2XMarkerCarInfoView(context: Context, showEntity: MarkerShowEntity) :
|
||||
ConstraintLayout(context) {
|
||||
|
||||
init {
|
||||
initView(context, showEntity)
|
||||
}
|
||||
|
||||
private fun initView(context: Context, showEntity: MarkerShowEntity) {
|
||||
val bindObj: Any = showEntity.bindObj
|
||||
if (bindObj is MarkerOnlineCar) {
|
||||
//1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆
|
||||
when (bindObj.userInfo.safeLabelType) {
|
||||
// 可直播车机
|
||||
4 -> {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car, this)
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio)
|
||||
}
|
||||
else -> {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car_info, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bindObj is V2XMarkerEntity) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car, this)
|
||||
}
|
||||
updateUI(showEntity)
|
||||
}
|
||||
|
||||
fun updateUI(showEntity: MarkerShowEntity) {
|
||||
ivCar.rotation = showEntity.markerLocation.angle.toFloat()
|
||||
// ivCar.rotation = 90f
|
||||
|
||||
tvUserMarker.text = if (TextUtils.isEmpty(showEntity.textContent)) {
|
||||
""
|
||||
} else {
|
||||
showEntity.textContent
|
||||
}
|
||||
|
||||
val bindObj: Any = showEntity.bindObj
|
||||
if (bindObj is MarkerOnlineCar) {
|
||||
tvMarkerContent.text =
|
||||
if (bindObj.userInfo == null && TextUtils.isEmpty(bindObj.userInfo.userName)) {
|
||||
"蘑菇车主"
|
||||
} else {
|
||||
bindObj.userInfo.userName
|
||||
}
|
||||
|
||||
//车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆',
|
||||
when (bindObj.carInfo.vehicleType) {
|
||||
// 普通车
|
||||
0 -> {
|
||||
clMarkerContent.visibility = View.VISIBLE
|
||||
ivReverseTriangle.visibility = View.VISIBLE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
// 警车
|
||||
1 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
// 救护车
|
||||
2 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
// 道路救援车辆
|
||||
3 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
else -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bindObj is V2XMarkerEntity) {
|
||||
when (bindObj.targetId) {
|
||||
10001 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
10002 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
10003 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
//失控车
|
||||
10004 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
// 故障车
|
||||
20007 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getView(): Bitmap {
|
||||
return ViewUtils.fromView(this)
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.marker
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.v2x.R
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes.V2XMarkerEntity
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar
|
||||
import com.mogo.module.common.entity.MarkerShowEntity
|
||||
import kotlinx.android.synthetic.main.view_marker_car.view.*
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-0619:55
|
||||
* desc : 绘制在线车辆,特殊车辆
|
||||
* version: 1.0
|
||||
*/
|
||||
class V2XMarkerCarView(context: Context, showEntity: MarkerShowEntity) :
|
||||
ConstraintLayout(context) {
|
||||
|
||||
init {
|
||||
initView(context, showEntity)
|
||||
}
|
||||
|
||||
private fun initView(context: Context, showEntity: MarkerShowEntity) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car, this)
|
||||
updateUI(showEntity)
|
||||
}
|
||||
|
||||
fun updateUI(showEntity: MarkerShowEntity) {
|
||||
ivCar.rotation = showEntity.markerLocation.angle.toFloat()
|
||||
|
||||
val bindObj: Any = showEntity.bindObj
|
||||
if (bindObj is MarkerOnlineCar) {
|
||||
//1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆
|
||||
when (bindObj.userInfo.safeLabelType) {
|
||||
1 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_blue)
|
||||
}
|
||||
2 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_green)
|
||||
}
|
||||
3 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_red)
|
||||
}
|
||||
4 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio)
|
||||
}
|
||||
}
|
||||
|
||||
//车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆',
|
||||
when (bindObj.carInfo.vehicleType) {
|
||||
// 普通车
|
||||
0 -> {
|
||||
ivMarkerTip.visibility = View.VISIBLE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
// 警车
|
||||
1 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
// 救护车
|
||||
2 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
// 道路救援车辆
|
||||
3 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
else -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bindObj is V2XMarkerEntity) {
|
||||
when (bindObj.targetId) {
|
||||
10001 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
10002 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
10003 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
10004 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
// 故障车
|
||||
20007 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getView(): Bitmap {
|
||||
return ViewUtils.fromView(this)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
|
||||
@@ -17,8 +17,6 @@ import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -73,26 +71,24 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
getV2XMessageEntity().getContent().getTts(false);
|
||||
}
|
||||
showWindow();
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics != null) {
|
||||
String poiType = getV2XMessageEntity().getContent().getPoiType();
|
||||
String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat());
|
||||
String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon());
|
||||
String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId();
|
||||
String style = "1";
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", infoId);
|
||||
properties.put("type", poiType);
|
||||
properties.put("lng", lon);
|
||||
properties.put("lat", lat);
|
||||
properties.put("style", style);
|
||||
analytics.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
String poiType = getV2XMessageEntity().getContent().getPoiType();
|
||||
String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat());
|
||||
String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon());
|
||||
String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId();
|
||||
String style = "1";
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", infoId);
|
||||
properties.put("type", poiType);
|
||||
properties.put("lng", lon);
|
||||
properties.put("lat", lat);
|
||||
properties.put("style", style);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void showWindow() {
|
||||
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
||||
V2XRoadEventEntity content = entity != null ? entity.getContent() : null;
|
||||
@@ -131,12 +127,11 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
if (entity.isNeedAddLine()) {
|
||||
drawPOI();
|
||||
}
|
||||
DisplayEffectsInterface wu = BridgeApi.INSTANCE.displayEffects();
|
||||
V2XRoadEventEntity content = entity.getContent();
|
||||
if (wu != null && content != null) {
|
||||
if (content != null) {
|
||||
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
|
||||
if (noveltyInfo != null && EventTypeEnum.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) {
|
||||
wu.displayEffects(EventTypeEnum.FOURS_FOG.getPoiType());
|
||||
CallerHmiManager.INSTANCE.displayEffects();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,7 @@ import android.graphics.Rect
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.utilcode.util.WindowUtils
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.utils.CarSeries
|
||||
import java.lang.Exception
|
||||
|
||||
class MapUtils {
|
||||
|
||||
@@ -22,34 +18,18 @@ class MapUtils {
|
||||
return
|
||||
}
|
||||
val mBoundRect = Rect()
|
||||
val paddingTop: Int
|
||||
val paddingBottom: Int
|
||||
val paddingRight: Int
|
||||
val paddingLeft: Int
|
||||
if (CarSeries.isF8xxSeries()) {
|
||||
paddingTop = WindowUtils.dip2px(context, 250f)
|
||||
paddingBottom = WindowUtils.dip2px(context, 100f)
|
||||
paddingRight = WindowUtils.dip2px(context, 100f)
|
||||
paddingLeft = WindowUtils.dip2px(context, 475f)
|
||||
} else {
|
||||
paddingTop = WindowUtils.dip2px(context, 370f)
|
||||
paddingBottom = WindowUtils.dip2px(context, 100f)
|
||||
paddingRight = WindowUtils.dip2px(context, 100f)
|
||||
paddingLeft = WindowUtils.dip2px(context, 575f)
|
||||
}
|
||||
mBoundRect.bottom = paddingBottom
|
||||
mBoundRect.top = paddingTop
|
||||
mBoundRect.left = paddingLeft
|
||||
mBoundRect.right = paddingRight
|
||||
mBoundRect.bottom = WindowUtils.dip2px(context, 100f)
|
||||
mBoundRect.top = WindowUtils.dip2px(context, 370f)
|
||||
mBoundRect.left = WindowUtils.dip2px(context, 575f)
|
||||
mBoundRect.right = WindowUtils.dip2px(context, 100f)
|
||||
// 当前车辆位置
|
||||
val carLocation = MogoLatLng(
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84Lat(),
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84Lon()
|
||||
)
|
||||
// 调整自适应的地图镜头
|
||||
carLocation?.let {
|
||||
CallerMapUIServiceManager.getMapUIController()?.showBounds("MapUtils", it, listOf(latLng), mBoundRect, true)
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
?.showBounds("MapUtils", carLocation, listOf(latLng), mBoundRect, true)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.utils;
|
||||
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -15,17 +14,13 @@ public class TrackUtils {
|
||||
//埋点
|
||||
public static void trackV2xRoadShow(String dbid, String type, String style) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", dbid);
|
||||
properties.put("type", type);
|
||||
properties.put("lng", V2XStatusManager.getInstance().getLocation().getLongitude());
|
||||
properties.put("lat", V2XStatusManager.getInstance().getLocation().getLatitude());
|
||||
properties.put("style", style);
|
||||
analytics.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -34,15 +29,11 @@ public class TrackUtils {
|
||||
//道路事件操作埋点 v2x_road_event
|
||||
public static void trackV2xRoadEvent(String dbid, String sn, String type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", dbid);
|
||||
properties.put("sn", sn);
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.V2X_ROAD_EVET, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_EVET, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -54,13 +45,9 @@ public class TrackUtils {
|
||||
*/
|
||||
public static void trackV2xRoadProduceEvent(int type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.V2X_ROAD_PRODUCE, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_PRODUCE, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -68,13 +55,9 @@ public class TrackUtils {
|
||||
|
||||
public static void trackV2XMarkerClick(int type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.LAUNCHER_ICON_CLICK, properties);
|
||||
AnalyticsUtils.track(V2XConst.LAUNCHER_ICON_CLICK, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -95,13 +78,9 @@ public class TrackUtils {
|
||||
*/
|
||||
public static void trackV2xHistoryEvent(int type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package com.mogo.eagle.core.function.v2x.events.voice
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.text.TextUtils
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.service.intent.IMogoIntentListener
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
@@ -51,7 +51,7 @@ object V2XVoiceManager : IMogoVoiceCmdCallBack, IMogoIntentListener {
|
||||
try {
|
||||
unRegisterWakeCmd(cmd)
|
||||
voiceCallbackMap[cmd] = callbackListener
|
||||
BridgeApi.intentManager()?.registerIntentListener(cmd, this)
|
||||
IntentManager.getInstance().registerIntentListener(cmd, this)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
@@ -63,7 +63,7 @@ object V2XVoiceManager : IMogoVoiceCmdCallBack, IMogoIntentListener {
|
||||
fun unRegisterWakeCmd(cmd: String): V2XVoiceManager {
|
||||
try {
|
||||
voiceCallbackMap.remove(cmd)
|
||||
BridgeApi.intentManager()?.unregisterIntentListener(cmd, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(cmd, this)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
@@ -4,21 +4,22 @@ import android.location.Location
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlin.math.abs
|
||||
@@ -28,7 +29,7 @@ import kotlin.math.min
|
||||
|
||||
|
||||
class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
IMogoCarLocationChangedListener2 {
|
||||
IMoGoMapLocationListener {
|
||||
|
||||
private var vip: Boolean = false
|
||||
|
||||
@@ -38,7 +39,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
// 是否已进入到路口(停止线处)
|
||||
private var isEnter = false
|
||||
|
||||
private var mLocation: Location? = null
|
||||
private var mLocation: MogoLocation? = null
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -53,7 +54,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
// 到路口100m时回调
|
||||
CallerLogger.d("$M_V2X$TAG", "处理路口交通数据:是否是第一次处理:${isFirst}是否进入路口:${isEnter}")
|
||||
if (trafficLightResult.currentRoadIsRight()) {
|
||||
CallerLogger.d("$M_V2X$TAG","当前道路右转,不处理")
|
||||
CallerLogger.d("$M_V2X$TAG", "当前道路右转,不处理")
|
||||
return
|
||||
}
|
||||
if (isFirst && !isEnter) {
|
||||
@@ -79,7 +80,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
fun listenTrafficLight() {
|
||||
CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
MogoApisHandler.getInstance().apis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
CallVipSetListenerManager.registerVipSetListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -177,7 +178,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
for (i in 0..size step 2) {
|
||||
if (i < size) {
|
||||
// 自车到0-1、2-3、4-5、6-7组成的线段的最小距离
|
||||
minValue = min(minValue, LocationUtils.pointToLine(points[i].lon, points[i].lat, points[i+1].lon, points[i+1].lat, lon, lat))
|
||||
minValue = min(
|
||||
minValue,
|
||||
LocationUtils.pointToLine(
|
||||
points[i].lon,
|
||||
points[i].lat,
|
||||
points[i + 1].lon,
|
||||
points[i + 1].lat,
|
||||
lon,
|
||||
lat
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return if (minValue > 9999) 0f else minValue.toFloat()
|
||||
@@ -186,18 +197,26 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
/**
|
||||
* 闯红灯预警
|
||||
*/
|
||||
@BizConfig(V2I,"",BIZ_IVP)
|
||||
@BizConfig(V2I, "", BIZ_IVP)
|
||||
private fun redLightWarning() {
|
||||
CallerLogger.d("$M_V2X$TAG", "=====闯红灯预警=====")
|
||||
ThreadUtils.runOnUiThread {
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绿灯通行提示
|
||||
*/
|
||||
@BizConfig(V2I,"",BIZ_IVP_GREEN)
|
||||
@BizConfig(V2I, "", BIZ_IVP_GREEN)
|
||||
private fun greenLightWarning(speed: String = "50") {
|
||||
CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====")
|
||||
ThreadUtils.runOnUiThread {
|
||||
@@ -209,7 +228,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
speed
|
||||
)
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,13 +248,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
|
||||
CallVipSetListenerManager.unRegisterVipSetListener(TAG)
|
||||
CallerTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
|
||||
MogoApisHandler.getInstance().apis.registerCenterApi.unregisterCarLocationChangedListener(
|
||||
TAG, this
|
||||
)
|
||||
CallerMapLocationListenerManager.removeListener(TAG,false)
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged2(latLng: Location?) {
|
||||
latLng?.let {
|
||||
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||
location?.let {
|
||||
mLocation = it
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB |
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#585A7C" />
|
||||
<corners android:radius="360dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_6"
|
||||
android:left="@dimen/dp_6"
|
||||
android:right="@dimen/dp_6"
|
||||
android:top="@dimen/dp_6" />
|
||||
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#5CC1FF"
|
||||
android:startColor="#256BFF" />
|
||||
<corners android:radius="360dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_3"
|
||||
android:left="@dimen/dp_16"
|
||||
android:right="@dimen/dp_16"
|
||||
android:top="@dimen/dp_3" />
|
||||
|
||||
</shape>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/shape_id" >
|
||||
<!-- 倒三角 -->
|
||||
<rotate
|
||||
android:fromDegrees="45"
|
||||
android:pivotX="135%"
|
||||
android:pivotY="15%"
|
||||
android:toDegrees="45" >
|
||||
<shape android:shape="rectangle" >
|
||||
<size android:width="@dimen/dp_20"
|
||||
android:height="@dimen/dp_20"/>
|
||||
<solid android:color="#3F4057" />
|
||||
</shape >
|
||||
</rotate >
|
||||
</item >
|
||||
</layer-list >
|
||||
@@ -20,7 +20,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_18">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventImg"
|
||||
android:layout_width="@dimen/module_v2x_event_image_width"
|
||||
android:layout_height="@dimen/module_v2x_event_image_height"
|
||||
@@ -108,7 +108,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/ivEventDistanceLogo"
|
||||
tools:text="2020/01/02 12:54" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventHead"
|
||||
android:layout_width="@dimen/module_v2x_event_head_size"
|
||||
android:layout_height="@dimen/module_v2x_event_head_size"
|
||||
@@ -213,7 +213,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/iv_event"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:visibility="gone">
|
||||
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventImg"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
@@ -99,7 +99,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/ivEventDistanceLogo"
|
||||
tools:text="2020/01/02 12:54" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventHead"
|
||||
android:layout_width="@dimen/module_v2x_event_head_size"
|
||||
android:layout_height="@dimen/module_v2x_event_head_size"
|
||||
@@ -226,7 +226,7 @@
|
||||
android:layout_height="@dimen/module_v2x_road_event_height"
|
||||
android:background="@drawable/bg_v2x_event_bg">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/iv_event"
|
||||
android:layout_width="@dimen/module_v2x_road_event_icon_width"
|
||||
android:layout_height="@dimen/module_v2x_road_event_icon_height"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivFaultHelpHead"
|
||||
android:layout_width="@dimen/module_v2x_event_help_head_size"
|
||||
android:layout_height="@dimen/module_v2x_event_help_head_size"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivFaultHelpHead"
|
||||
android:layout_width="@dimen/module_v2x_fault_help_height"
|
||||
android:layout_height="@dimen/module_v2x_fault_help_height"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_30" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_20" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_height="match_parent"
|
||||
app:roundLayoutRadius="@dimen/dp_30">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivImg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -31,7 +31,7 @@
|
||||
</com.mogo.eagle.core.widget.RoundLayout>
|
||||
</com.mogo.eagle.core.widget.RoundLayout>
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_v2x_event_list_item">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivFaultHelpHead"
|
||||
android:layout_width="@dimen/module_v2x_history_event_icon_size"
|
||||
android:layout_height="@dimen/module_v2x_history_event_icon_size"
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/dp_80"
|
||||
android:orientation="vertical"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMarkerTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/v_to_x_marker_car_red"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:rotation="90"
|
||||
android:src="@drawable/icon_car_gray"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivMarkerTip"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivMarkerTip"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivMarkerTip" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:background="@drawable/v2x_map_marker_blue_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
android:id="@+id/ivUserHead"
|
||||
android:layout_width="@dimen/dp_76"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_failureHolder="@drawable/icon_default_user_head"
|
||||
app:miv_overlayImageId="@drawable/icon_default_user_head"
|
||||
app:miv_placeHolder="@drawable/icon_default_user_head"
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:minWidth="@dimen/dp_150"
|
||||
android:singleLine="true"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_32"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ivIcon"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivUserHead"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
|
||||
app:layout_goneMarginRight="@dimen/dp_30"
|
||||
tools:text="诗一样的女子" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUserMarker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/v2x_map_marker_driver_type_blue_info"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMarkerContent"
|
||||
tools:text="老司机" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/dp_85"
|
||||
android:layout_height="@dimen/dp_85"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_talk"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvMarkerContent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="-10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="@+id/clMarkerContent"
|
||||
app:layout_constraintStart_toStartOf="@+id/clMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/clMarkerContent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivReverseTriangle"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/v2x_shape_reverse_triangle_blue"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_map_marker_car_gray"
|
||||
android:translationY="-10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:clickable="true" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:clickable="true" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user