完成了出行面板列表的部分逻辑
This commit is contained in:
@@ -254,6 +254,13 @@ public class SQLBaseDao<T> implements SQLIDao<T> {
|
||||
field.set(item, cursor.getLong(columnIndex));
|
||||
} else if (fieldType == (Double.class)) {
|
||||
field.set(item, cursor.getDouble(columnIndex));
|
||||
} else if (fieldType == (Boolean.class)) {
|
||||
int value = cursor.getInt(columnIndex);
|
||||
if (value == 0) {
|
||||
field.set(item, false);
|
||||
} else {
|
||||
field.set(item, true);
|
||||
}
|
||||
} else if (fieldType == (byte[].class)) {
|
||||
field.set(item, cursor.getBlob(columnIndex));
|
||||
} else {
|
||||
@@ -326,6 +333,8 @@ public class SQLBaseDao<T> implements SQLIDao<T> {
|
||||
sqlCreateTable.append(columnName).append(" BIGINT,");
|
||||
} else if (fieldType == (Double.class)) {
|
||||
sqlCreateTable.append(columnName).append(" DOUBLE,");
|
||||
} else if (fieldType == (Boolean.class)) {
|
||||
sqlCreateTable.append(columnName).append(" INTEGER,");
|
||||
} else if (fieldType == (byte[].class)) {
|
||||
sqlCreateTable.append(columnName).append(" BLOB,");
|
||||
} else {
|
||||
@@ -366,6 +375,12 @@ public class SQLBaseDao<T> implements SQLIDao<T> {
|
||||
contentValues.put(columnName, (Long) valueObject);
|
||||
} else if (fieldType == (Double.class)) {
|
||||
contentValues.put(columnName, (Double) valueObject);
|
||||
} else if (fieldType == (Boolean.class)) {
|
||||
if (((boolean) valueObject)) {
|
||||
contentValues.put(columnName, 1);
|
||||
} else {
|
||||
contentValues.put(columnName, 0);
|
||||
}
|
||||
} else if (fieldType == (byte[].class)) {
|
||||
contentValues.put(columnName, (byte[]) valueObject);
|
||||
} else {
|
||||
@@ -390,8 +405,19 @@ public class SQLBaseDao<T> implements SQLIDao<T> {
|
||||
Set<Map.Entry<String, Field>> fieldIterator = cacheField.entrySet();
|
||||
for (Map.Entry<String, Field> stringFieldEntry : fieldIterator) {
|
||||
if (stringFieldEntry.getValue().get(entity) != null) {
|
||||
contentValues.put(stringFieldEntry.getKey(),
|
||||
stringFieldEntry.getValue().get(entity).toString());
|
||||
// 针对Boolean类型进行处理
|
||||
if (stringFieldEntry.getValue().get(entity) instanceof Boolean) {
|
||||
if ((boolean) stringFieldEntry.getValue().get(entity)) {
|
||||
contentValues.put(stringFieldEntry.getKey(), "1");
|
||||
} else {
|
||||
contentValues.put(stringFieldEntry.getKey(), "0");
|
||||
}
|
||||
}
|
||||
// 其它数据类型处理
|
||||
else {
|
||||
contentValues.put(stringFieldEntry.getKey(),
|
||||
stringFieldEntry.getValue().get(entity).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.mogo.utils.sqlite.annotation.DbDatabase;
|
||||
import com.mogo.utils.sqlite.annotation.DbField;
|
||||
import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* V2X 道路历史事件
|
||||
*
|
||||
@@ -33,6 +31,12 @@ public class V2XHistoryScenarioData {
|
||||
@DbField(fieldName = "eventJsonData")
|
||||
public String eventJsonData;
|
||||
|
||||
/**
|
||||
* 事件是否被处理过了,true-处理过了。false-未处理过
|
||||
*/
|
||||
@DbField(fieldName = "isDispose")
|
||||
public Boolean isDispose;
|
||||
|
||||
public Integer getScenarioType() {
|
||||
return scenarioType;
|
||||
}
|
||||
@@ -56,4 +60,12 @@ public class V2XHistoryScenarioData {
|
||||
public void setTriggerTime(Long triggerTime) {
|
||||
this.triggerTime = triggerTime;
|
||||
}
|
||||
|
||||
public Boolean isDispose() {
|
||||
return isDispose;
|
||||
}
|
||||
|
||||
public void setDispose(Boolean dispose) {
|
||||
isDispose = dispose;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,125 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.utils.RoadConditionUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.view.HeartLikeView;
|
||||
import com.mogo.module.v2x.view.HeartUnLikeView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
/**
|
||||
* 出行面板违章停车
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
private TextView mTvAddress;
|
||||
private TextView mTvIllegalNum;
|
||||
|
||||
private TextView mTagEventType;
|
||||
private TextView mTagEventEvaluate;
|
||||
|
||||
private HeartLikeView mLlIllegalParkingLike;
|
||||
private HeartUnLikeView mLlIllegalParkingUnLike;
|
||||
|
||||
private MarkerExploreWay mExploreWay;
|
||||
|
||||
private V2XHistoryScenarioData mOldScenarioData;
|
||||
|
||||
public V2XScenarioHistoryIllegalParkVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_scennario_history, viewGroup, false));
|
||||
mTvAddress = (TextView) itemView.findViewById(R.id.tvAddress);
|
||||
mTvIllegalNum = (TextView) itemView.findViewById(R.id.tvIllegalNum);
|
||||
|
||||
mTagEventType = (TextView) itemView.findViewById(R.id.tagEventType);
|
||||
mTagEventEvaluate = (TextView) itemView.findViewById(R.id.tagEventEvaluate);
|
||||
|
||||
mLlIllegalParkingLike = (HeartLikeView) itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mLlIllegalParkingUnLike = (HeartUnLikeView) itemView.findViewById(R.id.llIllegalParkingUnLike);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(V2XHistoryScenarioData viewData) {
|
||||
mOldScenarioData = viewData;
|
||||
mExploreWay = GsonUtil.objectFromJson(viewData.getEventJsonData(), MarkerExploreWay.class);
|
||||
mTvAddress.setText(mExploreWay.getAddr());
|
||||
|
||||
try {
|
||||
mTvIllegalNum.setText("违章人数:" + (int) mExploreWay.getItems().get(0).getIllegalCount());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (!viewData.isDispose()) {
|
||||
hideControlButton(View.VISIBLE);
|
||||
} else {
|
||||
hideControlButton(View.GONE);
|
||||
}
|
||||
|
||||
mLlIllegalParkingLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
|
||||
roadReportTrue();
|
||||
});
|
||||
|
||||
mLlIllegalParkingUnLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
|
||||
roadReportErr();
|
||||
});
|
||||
}
|
||||
|
||||
void hideControlButton(int gone) {
|
||||
mTagEventEvaluate.setVisibility(gone);
|
||||
mLlIllegalParkingLike.setVisibility(gone);
|
||||
mLlIllegalParkingUnLike.setVisibility(gone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
hideControlButton(View.GONE);
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
|
||||
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
|
||||
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
|
||||
v2XHistoryScenarioData.setDispose(true);
|
||||
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData, v2XHistoryScenarioData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况正确
|
||||
*/
|
||||
private void roadReportTrue() {
|
||||
delayedCloseWindow();
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendShareReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况错误
|
||||
*/
|
||||
private void roadReportErr() {
|
||||
delayedCloseWindow();
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendShareReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.utils.EventTypeUtils;
|
||||
import com.mogo.module.v2x.utils.RoadConditionUtils;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.view.HeartLikeView;
|
||||
import com.mogo.module.v2x.view.HeartUnLikeView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
/**
|
||||
* 出行面板道路事件面板
|
||||
@@ -14,18 +27,105 @@ import com.mogo.module.v2x.R;
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
private TextView mTvAddress;
|
||||
private TextView mTvIllegalNum;
|
||||
private ImageView mIvIconP;
|
||||
private TextView mTagEventType;
|
||||
private TextView mTagEventEvaluate;
|
||||
|
||||
private HeartLikeView mLlIllegalParkingLike;
|
||||
private HeartUnLikeView mLlIllegalParkingUnLike;
|
||||
|
||||
private MarkerExploreWay mExploreWay;
|
||||
private V2XHistoryScenarioData mOldScenarioData;
|
||||
|
||||
public V2XScenarioHistoryRoadEventVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_scennario_history, viewGroup, false));
|
||||
mTvAddress = (TextView) itemView.findViewById(R.id.tvAddress);
|
||||
mTvIllegalNum = (TextView) itemView.findViewById(R.id.tvIllegalNum);
|
||||
mIvIconP = (ImageView) itemView.findViewById(R.id.ivIconP);
|
||||
mTagEventType = (TextView) itemView.findViewById(R.id.tagEventType);
|
||||
mTagEventEvaluate = (TextView) itemView.findViewById(R.id.tagEventEvaluate);
|
||||
|
||||
mLlIllegalParkingLike = (HeartLikeView) itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mLlIllegalParkingUnLike = (HeartUnLikeView) itemView.findViewById(R.id.llIllegalParkingUnLike);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(V2XHistoryScenarioData viewData) {
|
||||
mOldScenarioData = viewData;
|
||||
mExploreWay = GsonUtil.objectFromJson(viewData.getEventJsonData(), MarkerExploreWay.class);
|
||||
|
||||
mIvIconP.setVisibility(View.GONE);
|
||||
mTvAddress.setText(mExploreWay.getAddr());
|
||||
mTagEventType.setText(EventTypeUtils.getPoiTypeStr(mExploreWay.getPoiType()));
|
||||
|
||||
try {
|
||||
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + " 的分享 时间:" +
|
||||
TimeUtils.millis2String(mExploreWay.getGenerateTime(), "MM月dd日 HH:mm"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (!viewData.isDispose()) {
|
||||
hideControlButton(View.VISIBLE);
|
||||
} else {
|
||||
hideControlButton(View.GONE);
|
||||
}
|
||||
|
||||
mLlIllegalParkingLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
|
||||
roadReportTrue();
|
||||
});
|
||||
|
||||
mLlIllegalParkingUnLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
|
||||
roadReportErr();
|
||||
});
|
||||
}
|
||||
|
||||
void hideControlButton(int gone) {
|
||||
mTagEventEvaluate.setVisibility(gone);
|
||||
mLlIllegalParkingLike.setVisibility(gone);
|
||||
mLlIllegalParkingUnLike.setVisibility(gone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
hideControlButton(View.GONE);
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
|
||||
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
|
||||
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
|
||||
v2XHistoryScenarioData.setDispose(true);
|
||||
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData,v2XHistoryScenarioData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况正确
|
||||
*/
|
||||
private void roadReportTrue() {
|
||||
delayedCloseWindow();
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendShareReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况错误
|
||||
*/
|
||||
private void roadReportErr() {
|
||||
delayedCloseWindow();
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendShareReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import androidx.annotation.Nullable;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.commons.voice.VoicePreemptType;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
@@ -15,8 +17,11 @@ import com.mogo.module.v2x.scenario.IV2XScenario;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XButton;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -94,4 +99,23 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
|
||||
return mV2XMessageEntity.equals(v2XMessageEntity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 存储本地数据
|
||||
*
|
||||
* @param markerExploreWay 要存储的场景
|
||||
*/
|
||||
public void saveLocalStory(int scenarioType ,MarkerExploreWay markerExploreWay) {
|
||||
try {
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.setScenarioType(scenarioType);
|
||||
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
|
||||
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
|
||||
v2XHistoryScenarioData.setDispose(false);
|
||||
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,16 +62,6 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
V2XUtils.runOnUiThread(() -> {
|
||||
// 提取之前存储的场景
|
||||
if (v2XMessageEntity != null) {
|
||||
try {
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.setScenarioType(v2XMessageEntity.getType());
|
||||
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
|
||||
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(v2XMessageEntity.getContent()));
|
||||
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 广播给应用内部其它模块
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_ACTION);
|
||||
@@ -88,6 +78,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
|
||||
mV2XScenario = V2XSeekHelpScenario.getInstance();
|
||||
saveLocalStory(v2XMessageEntity);
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
|
||||
mV2XScenario = V2XFatigueDrivingScenario.getInstance();
|
||||
@@ -123,4 +114,23 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储本地数据
|
||||
*
|
||||
* @param v2XMessageEntity 要存储的场景
|
||||
*/
|
||||
void saveLocalStory(V2XMessageEntity v2XMessageEntity) {
|
||||
try {
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.setScenarioType(v2XMessageEntity.getType());
|
||||
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
|
||||
v2XHistoryScenarioData.setDispose(false);
|
||||
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(v2XMessageEntity.getContent()));
|
||||
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.module.v2x.utils.TrackUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
@@ -83,6 +84,8 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
|
||||
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "2");
|
||||
}
|
||||
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), v2XRoadEventEntity);
|
||||
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING,
|
||||
markerExploreWay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,5 +113,4 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
|
||||
public void clearPOI() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -78,30 +78,38 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
|
||||
// 设置TTS
|
||||
getV2XMessageEntity().getContent().getTts(false);
|
||||
// 广播给ADAS
|
||||
ADASUtils.broadcastToADAS(
|
||||
V2XServiceManager.getContext(),
|
||||
getV2XMessageEntity().getContent());
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
showWindow();
|
||||
}
|
||||
try {
|
||||
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
|
||||
// 设置TTS
|
||||
getV2XMessageEntity().getContent().getTts(false);
|
||||
// 广播给ADAS
|
||||
ADASUtils.broadcastToADAS(
|
||||
V2XServiceManager.getContext(),
|
||||
getV2XMessageEntity().getContent());
|
||||
|
||||
// 地图主动推送/触发消息 埋点
|
||||
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 = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2";
|
||||
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);
|
||||
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
|
||||
getV2XMessageEntity().getContent().getNoveltyInfo());
|
||||
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
showWindow();
|
||||
}
|
||||
|
||||
// 地图主动推送/触发消息 埋点
|
||||
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 = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2";
|
||||
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);
|
||||
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +177,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
if (getV2XMarker() != null) {
|
||||
// 重置告警信息
|
||||
V2XServiceManager.getV2XStatusManager().setAlarmInfo(getV2XMessageEntity().getContent());
|
||||
getV2XMarker() .drawPOI(getV2XMessageEntity().getContent());
|
||||
getV2XMarker().drawPOI(getV2XMessageEntity().getContent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,4 +73,15 @@ public class V2XSQLiteUtils {
|
||||
return getScenarioHistoryDao().query(new V2XHistoryScenarioData(), "triggerTime", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改指定的数据
|
||||
*/
|
||||
public static void updateScenarioHistoryData(V2XHistoryScenarioData oldScenarioData, V2XHistoryScenarioData newScenarioData) {
|
||||
try {
|
||||
int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData);
|
||||
Logger.d(V2XConst.MODULE_NAME, "修改数据成功:" + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
android:angle="180"
|
||||
android:endColor="#ff5cc1ff"
|
||||
android:startColor="#ff256bff"/>
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<corners android:radius="@dimen/dp_10" />
|
||||
</shape>
|
||||
@@ -4,5 +4,5 @@
|
||||
android:angle="180"
|
||||
android:endColor="#8384A9"
|
||||
android:startColor="#676982" />
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<corners android:radius="@dimen/dp_10" />
|
||||
</shape>
|
||||
@@ -4,5 +4,5 @@
|
||||
android:angle="180"
|
||||
android:endColor="#FFA757"
|
||||
android:startColor="#D48721" />
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<corners android:radius="@dimen/dp_10" />
|
||||
</shape>
|
||||
@@ -4,5 +4,5 @@
|
||||
android:angle="180"
|
||||
android:endColor="#FF4944"
|
||||
android:startColor="#C23632" />
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<corners android:radius="@dimen/dp_10" />
|
||||
</shape>
|
||||
@@ -73,6 +73,7 @@
|
||||
android:id="@+id/tvIllegalNum"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:alpha="0.6"
|
||||
android:gravity="center_vertical"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:paddingTop="@dimen/dp_3"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_3"
|
||||
android:text="违章停车"
|
||||
android:text="求助信息"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
Reference in New Issue
Block a user