new#Vr模式车速仪表盘

This commit is contained in:
wujifei
2021-03-29 16:05:23 +08:00
parent a65758b8cf
commit 4d8c4c091c
25 changed files with 480 additions and 217 deletions

View File

@@ -137,6 +137,11 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
}
};
private MogoImageView ivEvent;
private TextView tvEvent;
private TextView tvPlay;
private void init(View itemView) {
ivEventImg = itemView.findViewById(R.id.ivEventImg);
ivReportHead = itemView.findViewById(R.id.ivEventHead);
@@ -150,6 +155,10 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
ivEventZan = itemView.findViewById(R.id.ivEventZan);
ivEventReportTrue = itemView.findViewById(R.id.ivEventReportTrue);
ivEventReportErr = itemView.findViewById(R.id.ivEventReportErr);
ivEvent = itemView.findViewById(R.id.iv_event);
tvEvent = itemView.findViewById(R.id.tv_event);
tvPlay = itemView.findViewById(R.id.tv_play);
}
public V2XRoadEventVH(ViewGroup viewGroup, IV2XWindow v2XWindow) {
@@ -233,6 +242,9 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
ivEventImg.setOnClickListener(v -> {
showRoadVideoInfo(v2XEventShowEntity);
});
tvPlay.setOnClickListener(v -> {
showRoadVideoInfo(v2XEventShowEntity);
});
ivEventPlay.setOnClickListener(v -> {
showRoadVideoInfo(v2XEventShowEntity);
});
@@ -253,7 +265,10 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
if (!TextUtils.isEmpty(poiType)) {
tvEventTypeTitle.setText(poiType);
tvEventTypeTitle.setBackgroundResource(EventTypeUtils.getPoiTypeBg(mNoveltyInfo.getPoiType()));
}
ivEvent.setImageResource(EventTypeUtils.getPoiTypeSrcVr(mNoveltyInfo.getPoiType()));
tvEvent.setText(EventTypeUtils.getPoiTypeStrVr(mNoveltyInfo.getPoiType()));
tvEventAddress.setText(mNoveltyInfo.getAddr());
tvEventDistance.setText("距离 " + (int) mNoveltyInfo.getDistance() + "");

View File

@@ -87,6 +87,51 @@ public class EventTypeUtils {
return str;
}
public static int getPoiTypeSrcVr(String poiType) {
int src;
switch (poiType) {
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
src = R.drawable.v2x_icon_yongdu_vr;
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
src = R.drawable.v2x_icon_jishui_vr;
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
src = R.drawable.v2x_icon_nongwu_vr;
break;
default:
src = R.drawable.v2x_icon_live_logo;
break;
}
return src;
}
public static String getPoiTypeStrVr(String poiType) {
String str = "其它道路事件";
switch (poiType) {
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str = "前方拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
str = "前方道路积水道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
str = "浓雾预警";
break;
default:
str = "其它道路事件";
break;
}
return str;
}
/**
* 获取道路事件的背景色
*