增加针对场景的贴图替换

This commit is contained in:
董宏宇
2020-10-28 21:07:59 +08:00
parent 9065fbb689
commit e32b64cf7d
2 changed files with 30 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import android.graphics.Bitmap;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.utils.ImageUtil;
@@ -149,14 +150,38 @@ public class V2XMarkerAdapter {
}
/**
* TODO 都是模拟数据
* 获取VR道路事件
*/
public static Bitmap getV2XVRRoadEventViewPng() {
Bitmap bitmap = ImageUtil.createBitmap(V2XUtils.getApp(),R.drawable.v2x_duixiang_laiche_che_xian);
public static Bitmap getV2XVRRoadEventViewPng(V2XPushMessageEntity alarmMessage) {
Bitmap bitmap = ImageUtil.createBitmap(V2XUtils.getApp(),
R.drawable.v2x_vr_ziche);
switch (alarmMessage.getSceneId()) {
case "200001"://后方VIP车辆提示
bitmap = ImageUtil.createBitmap(V2XUtils.getApp(),
R.drawable.v2x_duixiang_laiche_che);
break;
case "200002"://前车急刹
break;
case "200003"://后方危险车辆预警
break;
case "200004"://逆向车辆路线预判
bitmap = ImageUtil.createBitmap(V2XUtils.getApp(),
R.drawable.v2x_duixiang_laiche_che);
break;
case "200005"://VIP变灯通行
break;
case "200006"://障碍物绕行
break;
case "200007"://行人预警,行人路线预测
break;
case "200008"://拥堵路线推荐
break;
case "200009"://双闪车辆,自动绕行
break;
}
return bitmap;
}
}

View File

@@ -53,7 +53,7 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
.longitude(entity.getLon());
optionsRipple.anchor(0.5f, 0.5f);
optionsRipple.icon(V2XMarkerAdapter.getV2XVRRoadEventViewPng());
optionsRipple.icon(V2XMarkerAdapter.getV2XVRRoadEventViewPng(entity));
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
drawablePloyLine(entity);