Merge remote-tracking branch 'origin/dev_1.1.2' into dev_1.1.2
@@ -28,6 +28,7 @@ import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoMarkerService;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
@@ -64,6 +65,7 @@ public class V2XServiceManager {
|
||||
private static IMogoRegisterCenter mMogoRegisterCenter;
|
||||
private static IMogoRefreshStrategyController mIMogoRefreshStrategyController;
|
||||
private static IMogoMarkerService mIMogoMarkerService;
|
||||
private static IMogoShareManager mIMogoShareManager;
|
||||
|
||||
private static IMogoActionManager mMogoActionManager;
|
||||
private static ICarsChattingProvider mCarsChattingProvider;
|
||||
@@ -102,6 +104,7 @@ public class V2XServiceManager {
|
||||
mMogoTopViewManager = mMogoServiceApis.getTopViewManager();
|
||||
mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi();
|
||||
mIMogoMarkerService = mMogoServiceApis.getMarkerService();
|
||||
mIMogoShareManager = mMogoServiceApis.getShareManager();
|
||||
|
||||
mMarkerManager = mMapService.getMarkerManager(context);
|
||||
mNavi = mMapService.getNavi(context);
|
||||
@@ -243,4 +246,8 @@ public class V2XServiceManager {
|
||||
public static V2XCalculateServer getV2XCalculateServer() {
|
||||
return mV2XCalculateServer;
|
||||
}
|
||||
|
||||
public static IMogoShareManager getMogoShareManager() {
|
||||
return mIMogoShareManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,16 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
@Override
|
||||
public void initView(V2XEventShowEntity v2XEventShowEntity) {
|
||||
mV2XPushMessageEntity = v2XEventShowEntity.getV2XPushMessageEntity();
|
||||
try {
|
||||
MarkerLocation markerLocation = new MarkerLocation();
|
||||
markerLocation.setLon(mV2XPushMessageEntity.getLon());
|
||||
markerLocation.setLat(mV2XPushMessageEntity.getLat());
|
||||
mNoveltyInfo = new MarkerExploreWay();
|
||||
mNoveltyInfo.setLocation(markerLocation);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 只有自研车机才会 有车聊聊通话
|
||||
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
|
||||
// 判断是否可以打电话
|
||||
@@ -143,7 +153,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
mUserInfo.setUserHead(mV2XPushMessageEntity.getHeadImgUrl());
|
||||
mUserInfo.setUserName(mV2XPushMessageEntity.getDisplayName());
|
||||
mUserInfo.setGender(mV2XPushMessageEntity.getSex());
|
||||
mUserInfo.setAge(30);
|
||||
mUserInfo.setAge(mV2XPushMessageEntity.getAge());
|
||||
mNoveltyInfo.setUserInfo(mUserInfo);
|
||||
triggerCallChart(mNoveltyInfo);
|
||||
} catch (Exception e) {
|
||||
@@ -152,16 +162,6 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
MarkerLocation markerLocation = new MarkerLocation();
|
||||
markerLocation.setLon(mV2XPushMessageEntity.getLon());
|
||||
markerLocation.setLat(mV2XPushMessageEntity.getLat());
|
||||
mNoveltyInfo = new MarkerExploreWay();
|
||||
mNoveltyInfo.setLocation(markerLocation);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
if (!TextUtils.isEmpty(mV2XPushMessageEntity.getHeadImgUrl())) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
|
||||
@@ -40,43 +40,47 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistor
|
||||
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);
|
||||
mTvAddress = itemView.findViewById(R.id.tvAddress);
|
||||
mTvIllegalNum = itemView.findViewById(R.id.tvIllegalNum);
|
||||
|
||||
mTagEventType = (TextView) itemView.findViewById(R.id.tagEventType);
|
||||
mTagEventEvaluate = (TextView) itemView.findViewById(R.id.tagEventEvaluate);
|
||||
mTagEventType = itemView.findViewById(R.id.tagEventType);
|
||||
mTagEventEvaluate = itemView.findViewById(R.id.tagEventEvaluate);
|
||||
|
||||
mLlIllegalParkingLike = (HeartLikeView) itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mLlIllegalParkingUnLike = (HeartUnLikeView) itemView.findViewById(R.id.llIllegalParkingUnLike);
|
||||
mLlIllegalParkingLike = itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mLlIllegalParkingUnLike = 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());
|
||||
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();
|
||||
});
|
||||
} 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) {
|
||||
@@ -87,14 +91,18 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistor
|
||||
|
||||
@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);
|
||||
try {
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,30 +1,176 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.text.TextUtils;
|
||||
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.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerUserInfo;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
|
||||
import com.mogo.module.v2x.utils.ChartingUtil;
|
||||
import com.mogo.module.v2x.utils.SpanUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
/**
|
||||
* 出行动态中的他人故障求助
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
|
||||
private TextView mTagEventType;
|
||||
private TextView mTagEventEvaluate;
|
||||
private MogoImageView mIvFaultHelpHead;
|
||||
private TextView mTvFaultHelpName;
|
||||
private TextView mTvFaultHelpEventTime;
|
||||
private TextView mTvFaultHelpDistance;
|
||||
private ImageView mIvFaultHelpEventCall;
|
||||
private ImageView mIvFaultHelpEventNavi;
|
||||
|
||||
private MarkerExploreWay mNoveltyInfo;
|
||||
// 上传事件的用户信息
|
||||
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
|
||||
|
||||
private V2XHistoryScenarioData mOldScenarioData;
|
||||
|
||||
public V2XScenarioHistoryOtherSeekHelpVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_scennario_history_other_help, viewGroup, false));
|
||||
mTagEventType = itemView.findViewById(R.id.tagEventType);
|
||||
mTagEventEvaluate = itemView.findViewById(R.id.tagEventEvaluate);
|
||||
mIvFaultHelpHead = itemView.findViewById(R.id.ivFaultHelpHead);
|
||||
mTvFaultHelpName = itemView.findViewById(R.id.tvFaultHelpName);
|
||||
mTvFaultHelpEventTime = itemView.findViewById(R.id.tvFaultHelpEventTime);
|
||||
mTvFaultHelpDistance = itemView.findViewById(R.id.tvFaultHelpDistance);
|
||||
mIvFaultHelpEventCall = itemView.findViewById(R.id.ivFaultHelpEventCall);
|
||||
mIvFaultHelpEventNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(V2XHistoryScenarioData viewData) {
|
||||
try {
|
||||
mOldScenarioData = viewData;
|
||||
V2XPushMessageEntity xPushMessageEntity = GsonUtil.objectFromJson(viewData.getEventJsonData(), V2XPushMessageEntity.class);
|
||||
|
||||
if (!viewData.isDispose()) {
|
||||
hideControlButton(View.VISIBLE);
|
||||
} else {
|
||||
hideControlButton(View.GONE);
|
||||
}
|
||||
|
||||
mTvFaultHelpName.setText(xPushMessageEntity.getDisplayName());
|
||||
|
||||
if (!TextUtils.isEmpty(xPushMessageEntity.getHeadImgUrl())) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(xPushMessageEntity.getHeadImgUrl(), mIvFaultHelpHead);
|
||||
}
|
||||
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
|
||||
String eventTime = String.format("%s发布求助信息",
|
||||
sdf.format(new Date(xPushMessageEntity.getCreateTime())));
|
||||
mTvFaultHelpEventTime.setText(eventTime);
|
||||
|
||||
try {
|
||||
MarkerLocation markerLocation = new MarkerLocation();
|
||||
markerLocation.setLon(xPushMessageEntity.getLon());
|
||||
markerLocation.setLat(xPushMessageEntity.getLat());
|
||||
mNoveltyInfo = new MarkerExploreWay();
|
||||
mNoveltyInfo.setLocation(markerLocation);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mIvFaultHelpEventNavi.setOnClickListener(v -> {
|
||||
triggerStartNavi(mNoveltyInfo);
|
||||
});
|
||||
|
||||
// 只有自研车机才会 有车聊聊通话
|
||||
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
|
||||
// 判断是否可以打电话
|
||||
ChartingUtil.isCanCall(b -> {
|
||||
if (b) {
|
||||
// 判断是否可以打电话
|
||||
ChartingUtil.isOnLine(xPushMessageEntity.getSn(), b1 -> {
|
||||
if (b1) {
|
||||
mIvFaultHelpEventCall.setVisibility(VISIBLE);
|
||||
} else {
|
||||
mIvFaultHelpEventCall.setVisibility(GONE);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mIvFaultHelpEventCall.setVisibility(GONE);
|
||||
}
|
||||
});
|
||||
|
||||
mIvFaultHelpEventCall.setOnClickListener(v -> {
|
||||
if (!V2XUtils.isFastClick()) {
|
||||
try {
|
||||
mUserInfo.setSn(xPushMessageEntity.getSn());
|
||||
mUserInfo.setUserHead(xPushMessageEntity.getHeadImgUrl());
|
||||
mUserInfo.setUserName(xPushMessageEntity.getDisplayName());
|
||||
mUserInfo.setGender(xPushMessageEntity.getSex());
|
||||
mUserInfo.setAge(xPushMessageEntity.getAge());
|
||||
mNoveltyInfo.setUserInfo(mUserInfo);
|
||||
triggerCallChart(mNoveltyInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
try {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
|
||||
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);
|
||||
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
void hideControlButton(int gone) {
|
||||
mTagEventEvaluate.setVisibility(gone);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,47 +42,51 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
|
||||
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);
|
||||
mTvAddress = itemView.findViewById(R.id.tvAddress);
|
||||
mTvIllegalNum = itemView.findViewById(R.id.tvIllegalNum);
|
||||
mIvIconP = itemView.findViewById(R.id.ivIconP);
|
||||
mTagEventType = itemView.findViewById(R.id.tagEventType);
|
||||
mTagEventEvaluate = itemView.findViewById(R.id.tagEventEvaluate);
|
||||
|
||||
mLlIllegalParkingLike = (HeartLikeView) itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mLlIllegalParkingUnLike = (HeartUnLikeView) itemView.findViewById(R.id.llIllegalParkingUnLike);
|
||||
mLlIllegalParkingLike = itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mLlIllegalParkingUnLike = 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"));
|
||||
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();
|
||||
});
|
||||
} 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) {
|
||||
@@ -93,14 +97,18 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
|
||||
|
||||
@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);
|
||||
try {
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.module.v2x.V2XConst.MODULE_NAME
|
||||
import com.mogo.module.v2x.V2XServiceManager
|
||||
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
|
||||
import com.mogo.module.v2x.presenter.EventPanelPresenter
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.*
|
||||
|
||||
@@ -24,13 +25,10 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
private val TAG = "EventPanelFragment"
|
||||
|
||||
private val tabsTitle = arrayOf("出行动态", "周边事件", "我的分享")
|
||||
private var fragments: Array<Fragment>? = null
|
||||
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
|
||||
private var selectPosition = 0
|
||||
|
||||
companion object {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
@@ -73,13 +71,21 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
hidePanel()
|
||||
}
|
||||
|
||||
btnShowOrHidePanels.setOnClickListener {
|
||||
if (clPanelContainer.visibility == View.GONE) {
|
||||
llEventMore.setOnClickListener {
|
||||
if (!isPanelShow()) {
|
||||
showPanel()
|
||||
} else {
|
||||
hidePanel()
|
||||
}
|
||||
}
|
||||
|
||||
val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
|
||||
if (historyMessage != null && historyMessage.size > 0) {
|
||||
tvEventCount.visibility = View.VISIBLE
|
||||
tvEventCount.text = "${historyMessage.size}"
|
||||
} else {
|
||||
tvEventCount.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -94,16 +100,13 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
fun showPanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment show panel")
|
||||
clPanelContainer.visibility = View.VISIBLE
|
||||
btnShowOrHidePanels.text = "隐藏面板"
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, true)
|
||||
}
|
||||
|
||||
fun hidePanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment hide panel")
|
||||
clPanelContainer.visibility = View.GONE
|
||||
btnShowOrHidePanels.text = "显示面板"
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, false)
|
||||
|
||||
}
|
||||
|
||||
fun isPanelShow(): Boolean {
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.mogo.module.v2x.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -16,6 +18,7 @@ import com.mogo.module.v2x.adapter.V2XScenarioHistoryAdapter;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusChangedListener;
|
||||
import com.mogo.module.v2x.manager.V2XStatusDescriptor;
|
||||
import com.mogo.module.v2x.presenter.ScenarioHistoryPresenter;
|
||||
import com.mogo.module.v2x.view.V2XListEmptyView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -31,6 +34,8 @@ public class V2XScenarioHistoryFragment
|
||||
extends MvpFragment<V2XScenarioHistoryFragment, ScenarioHistoryPresenter> {
|
||||
private String TAG = "ScenarioHistoryFragment";
|
||||
|
||||
private V2XListEmptyView mEmptyView;
|
||||
private CoordinatorLayout mClHistoryList;
|
||||
private RecyclerView mRecyclerView;
|
||||
private V2XScenarioHistoryAdapter mV2XScenarioHistoryAdapter;
|
||||
private ArrayList<V2XHistoryScenarioData> mV2XHistoryScenarioData = new ArrayList<>();
|
||||
@@ -43,7 +48,10 @@ public class V2XScenarioHistoryFragment
|
||||
@Override
|
||||
protected void initViews() {
|
||||
Log.d(TAG, "initViews --------> ");
|
||||
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
|
||||
mEmptyView = findViewById(R.id.viewEmpty);
|
||||
mClHistoryList = findViewById(R.id.clHistoryList);
|
||||
mRecyclerView = findViewById(R.id.recyclerView);
|
||||
mV2XScenarioHistoryAdapter = new V2XScenarioHistoryAdapter(mV2XHistoryScenarioData);
|
||||
mRecyclerView.setAdapter(mV2XScenarioHistoryAdapter);
|
||||
mRecyclerView.addItemDecoration(new SpacesItemDecoration(14));
|
||||
@@ -51,12 +59,28 @@ public class V2XScenarioHistoryFragment
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
initListener();
|
||||
|
||||
mEmptyView.setTripMessage("暂无交通事件");
|
||||
mEmptyView.setRefreshVisibility(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化页面用到得监听
|
||||
*/
|
||||
private void initListener() {
|
||||
mEmptyView.setOnControlListener(new V2XListEmptyView.OnControlListener() {
|
||||
@Override
|
||||
public void onShearClick() {
|
||||
V2XServiceManager.getMogoShareManager().showShareDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshClick() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
V2XServiceManager.getMoGoV2XStatusManager()
|
||||
.registerStatusChangedListener(
|
||||
TAG,
|
||||
@@ -85,7 +109,14 @@ public class V2XScenarioHistoryFragment
|
||||
public void loadHistory(List<V2XHistoryScenarioData> v2XHistoryScenarioData) {
|
||||
Logger.d(TAG, "查询到历史消息:" + GsonUtil.jsonFromObject(v2XHistoryScenarioData));
|
||||
mV2XHistoryScenarioData.clear();
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
if (v2XHistoryScenarioData.size() > 0) {
|
||||
mEmptyView.setVisibility(View.GONE);
|
||||
mClHistoryList.setVisibility(View.VISIBLE);
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
} else {
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
mClHistoryList.setVisibility(View.GONE);
|
||||
}
|
||||
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import com.mogo.module.v2x.entity.net.V2XLivePushVoRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
|
||||
import com.mogo.module.v2x.entity.panel.SurroundingResponse;
|
||||
import com.mogo.module.v2x.entity.panel.V2XShareEventDescription;
|
||||
import com.mogo.module.v2x.entity.panel.V2XShareEventItem;
|
||||
import com.mogo.module.v2x.entity.panel.SurroundingResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -140,4 +140,11 @@ public interface V2XApiService {
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/poiInfoFabulous/car/poi/no/addPoiInfoFabulous/v1")
|
||||
Observable<BaseData> addPoiInfoFabulous(@FieldMap Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 响应求助
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/poiInfoFabulous/car/poi/no/RespondingToHelp/v1")
|
||||
Observable<BaseData> respondingToHelp(@FieldMap Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -518,4 +517,35 @@ public class V2XRefreshModel {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应求助
|
||||
* "seekHelpSn":"testSn01",求助SN
|
||||
* "enthusiasticSn":"testSn02",响应求助SN
|
||||
*/
|
||||
public void respondingToHelp(String seekHelpSn) {
|
||||
if (mV2XApiService != null) {
|
||||
final Map<String, Object> map = new ParamsProvider.Builder(mContext).build();
|
||||
String json = new StringBuilder()
|
||||
.append("{")
|
||||
.append("\"seekHelpSn\":").append(seekHelpSn)
|
||||
.append(",")
|
||||
.append("\"enthusiasticSn\":").append(Utils.getSn())
|
||||
.append("}").toString();
|
||||
map.put("data", json);
|
||||
mV2XApiService.respondingToHelp(map).subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
super.onSuccess(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ 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;
|
||||
@@ -34,7 +33,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
|
||||
protected String TAG = "AbsV2XScenario";
|
||||
private IV2XWindow mV2XWindow;
|
||||
private IV2XButton mV2XButton;
|
||||
private IV2XMarker<T> mV2XMarker;
|
||||
private IV2XMarker mV2XMarker;
|
||||
private IMoGoV2XStatusManager mV2XStatusManager;
|
||||
private V2XMessageEntity<T> mV2XMessageEntity;
|
||||
|
||||
@@ -67,7 +66,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
|
||||
this.mV2XWindow = mV2XWindow;
|
||||
}
|
||||
|
||||
public IV2XMarker<T> getV2XMarker() {
|
||||
public IV2XMarker getV2XMarker() {
|
||||
return mV2XMarker;
|
||||
}
|
||||
|
||||
@@ -105,7 +104,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
|
||||
*
|
||||
* @param markerExploreWay 要存储的场景
|
||||
*/
|
||||
public void saveLocalStory(int scenarioType ,MarkerExploreWay markerExploreWay) {
|
||||
public void saveLocalStory(int scenarioType, Object markerExploreWay) {
|
||||
try {
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Intent;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
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.scenario.IV2XScenarioManager;
|
||||
@@ -16,8 +15,6 @@ import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpScenario;
|
||||
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.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -78,7 +75,6 @@ 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();
|
||||
@@ -114,23 +110,4 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
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.V2XServiceManager;
|
||||
@@ -50,25 +50,45 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
}
|
||||
|
||||
private List<V2XMarkerEntity> mMarkerEntity;
|
||||
private V2XPushMessageEntity mV2XPushMessageEntity;
|
||||
|
||||
@Override
|
||||
public void init(@Nullable V2XMessageEntity<List<V2XMarkerEntity>> v2XMessageEntity) {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
try {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
|
||||
// 广播给ADAS和Launcher卡片
|
||||
V2XRoadEventEntity eventEntity = new V2XRoadEventEntity();
|
||||
eventEntity.setPoiType(V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "");
|
||||
eventEntity.setExpireTime(30000);
|
||||
eventEntity.setTts("发现其他车主的求助信息");
|
||||
eventEntity.setAlarmContent("其他车主求助");
|
||||
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), eventEntity);
|
||||
// 广播给ADAS和Launcher卡片
|
||||
V2XRoadEventEntity eventEntity = new V2XRoadEventEntity();
|
||||
eventEntity.setPoiType(V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "");
|
||||
eventEntity.setExpireTime(30000);
|
||||
eventEntity.setTts("发现其他车主的求助信息");
|
||||
eventEntity.setAlarmContent("其他车主求助");
|
||||
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), eventEntity);
|
||||
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
if (getV2XMessageEntity() != null &&
|
||||
!V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow()) {
|
||||
mMarkerEntity = getV2XMessageEntity().getContent();
|
||||
show();
|
||||
mMarkerEntity = getV2XMessageEntity().getContent();
|
||||
|
||||
V2XMarkerEntity markerEntity = mMarkerEntity.get(0);
|
||||
mV2XPushMessageEntity = new V2XPushMessageEntity();
|
||||
mV2XPushMessageEntity.setLon(markerEntity.getLon());
|
||||
mV2XPushMessageEntity.setLat(markerEntity.getLat());
|
||||
mV2XPushMessageEntity.setDisplayName(markerEntity.getUserInfo().getDisplayName());
|
||||
mV2XPushMessageEntity.setHeadImgUrl(markerEntity.getUserInfo().getHeadImgUrl());
|
||||
mV2XPushMessageEntity.setSex(markerEntity.getUserInfo().getSex());
|
||||
mV2XPushMessageEntity.setSn(markerEntity.getUserInfo().getSn());
|
||||
mV2XPushMessageEntity.setCreateTime(markerEntity.getCreateTime());
|
||||
mV2XPushMessageEntity.setDistance(markerEntity.getDistance());
|
||||
mV2XPushMessageEntity.setExpireTime(20000);
|
||||
|
||||
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING, mV2XPushMessageEntity);
|
||||
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
if (getV2XMessageEntity() != null &&
|
||||
!V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow()) {
|
||||
show();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +109,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addView(getV2XWindow().getView(), layoutParams, this);
|
||||
getV2XWindow().show(mMarkerEntity);
|
||||
getV2XWindow().show(mV2XPushMessageEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -35,7 +34,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* desc : 他人发起的故障求助
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XSeekHelpWindow extends ConstraintLayout implements IV2XWindow<List<V2XMarkerEntity>> {
|
||||
public class V2XSeekHelpWindow extends ConstraintLayout implements IV2XWindow<V2XPushMessageEntity> {
|
||||
private static final String TAG = "V2XSeekHelpWindow";
|
||||
|
||||
// 展示列表
|
||||
@@ -96,32 +95,18 @@ public class V2XSeekHelpWindow extends ConstraintLayout implements IV2XWindow<Li
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(List<V2XMarkerEntity> entityList) {
|
||||
if (entityList != null && !entityList.isEmpty()) {
|
||||
V2XMarkerEntity markerEntity = entityList.get(0);
|
||||
|
||||
mV2XPushMessageEntity = new V2XPushMessageEntity();
|
||||
mV2XPushMessageEntity.setLon(markerEntity.getLon());
|
||||
mV2XPushMessageEntity.setLat(markerEntity.getLat());
|
||||
mV2XPushMessageEntity.setDisplayName(markerEntity.getUserInfo().getDisplayName());
|
||||
mV2XPushMessageEntity.setHeadImgUrl(markerEntity.getUserInfo().getHeadImgUrl());
|
||||
mV2XPushMessageEntity.setSex(markerEntity.getUserInfo().getSex());
|
||||
mV2XPushMessageEntity.setSn(markerEntity.getUserInfo().getSn());
|
||||
mV2XPushMessageEntity.setCreateTime(markerEntity.getCreateTime());
|
||||
mV2XPushMessageEntity.setDistance(markerEntity.getDistance());
|
||||
mV2XPushMessageEntity.setExpireTime(20000);
|
||||
|
||||
public void show(V2XPushMessageEntity xPushMessageEntity) {
|
||||
if (xPushMessageEntity != null) {
|
||||
mV2XPushMessageEntity = xPushMessageEntity;
|
||||
// 清空数据
|
||||
mItemList.clear();
|
||||
|
||||
//Logger.d(MODULE_NAME, "V2X===推送消息:" + v2XRoadEventEntity);
|
||||
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
|
||||
v2XEventShowEntity.setV2XPushMessageEntity(mV2XPushMessageEntity);
|
||||
v2XEventShowEntity.setV2XPushMessageEntity(xPushMessageEntity);
|
||||
v2XEventShowEntity.setViewType(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING);
|
||||
mItemList.add(v2XEventShowEntity);
|
||||
// 刷新列表
|
||||
mV2XRoadEventAdapter.notifyDataSetChanged();
|
||||
|
||||
countDownV2XEvent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,15 @@ public class V2XSQLiteUtils {
|
||||
return getScenarioHistoryDao().query(new V2XHistoryScenarioData(), "triggerTime", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当天的未评价V2X数据
|
||||
*/
|
||||
public static List<V2XHistoryScenarioData> getScenarioHistoryUnDisposeData() {
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.isDispose = false;
|
||||
return getScenarioHistoryDao().query(v2XHistoryScenarioData, "triggerTime", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改指定的数据
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.mogo.module.v2x.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
|
||||
/**
|
||||
* 列表空白布局View
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XListEmptyView extends LinearLayout {
|
||||
|
||||
private ImageView mIvEmptyView;
|
||||
private TextView mTvTrip;
|
||||
private Button mBtnShear;
|
||||
private Button mBtnRefresh;
|
||||
|
||||
private OnControlListener mOnControlListener;
|
||||
|
||||
public V2XListEmptyView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public V2XListEmptyView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public V2XListEmptyView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
LayoutInflater.from(context).inflate(R.layout.view_history_empty, this);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mIvEmptyView = findViewById(R.id.ivEmptyView);
|
||||
mTvTrip = findViewById(R.id.tvTrip);
|
||||
mBtnShear = findViewById(R.id.btnShear);
|
||||
mBtnRefresh = findViewById(R.id.btnRefresh);
|
||||
|
||||
mBtnShear.setOnClickListener(v -> {
|
||||
if (mOnControlListener != null) {
|
||||
mOnControlListener.onShearClick();
|
||||
}
|
||||
});
|
||||
mBtnRefresh.setOnClickListener(v -> {
|
||||
if (mOnControlListener != null) {
|
||||
mOnControlListener.onRefreshClick();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setTripMessage(String tripMsg) {
|
||||
if (mTvTrip != null) {
|
||||
mTvTrip.setText(tripMsg);
|
||||
}
|
||||
}
|
||||
|
||||
public void setShearVisibility(boolean visibility) {
|
||||
if (mBtnShear != null) {
|
||||
if (visibility) {
|
||||
mBtnShear.setVisibility(VISIBLE);
|
||||
} else {
|
||||
mBtnShear.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRefreshVisibility(boolean visibility) {
|
||||
if (mBtnRefresh != null) {
|
||||
if (visibility) {
|
||||
mBtnRefresh.setVisibility(VISIBLE);
|
||||
} else {
|
||||
mBtnRefresh.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnControlListener(OnControlListener onControlListener) {
|
||||
this.mOnControlListener = onControlListener;
|
||||
}
|
||||
|
||||
public interface OnControlListener {
|
||||
void onShearClick();
|
||||
|
||||
void onRefreshClick();
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 700 B |
|
After Width: | Height: | Size: 686 B |
|
After Width: | Height: | Size: 561 B |
|
After Width: | Height: | Size: 293 B |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,10 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_180" />
|
||||
<gradient android:angle="90"
|
||||
android:endColor="#D94848"
|
||||
android:startColor="#C63F3F" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_40" />
|
||||
<gradient android:angle="135"
|
||||
android:endColor="#3F456D"
|
||||
android:startColor="#3F435F" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_16" />
|
||||
<solid android:color="#3F4057" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_16" />
|
||||
<solid android:color="#cc3F4057" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_180" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_180" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_180" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#5CC1FF"
|
||||
android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_180" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#5CC1FF"
|
||||
android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -5,6 +5,39 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/llEventMore"
|
||||
android:layout_width="@dimen/dp_132"
|
||||
android:layout_height="@dimen/dp_132"
|
||||
android:background="@drawable/v2x_drawable_event_more_bkg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:translationZ="1dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnShowOrHidePanels"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/icon_event_panel_more" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvEventCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/v2x_drawable_event_message_bkg"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:visibility="gone"
|
||||
tools:text="9"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
@@ -96,15 +129,4 @@
|
||||
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnShowOrHidePanels"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="300dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="显示面板"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,35 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout 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="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00000000">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_60"
|
||||
android:paddingBottom="@dimen/dp_27"
|
||||
android:text="今日出行遇到的交通事件"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textStyle="bold"
|
||||
app:layout_scrollFlags="scroll|enterAlways" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
<com.mogo.module.v2x.view.V2XListEmptyView
|
||||
android:id="@+id/viewEmpty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:listitem="@layout/item_v2x_illegal_parking" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/clHistoryList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00000000">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_60"
|
||||
android:paddingBottom="@dimen/dp_27"
|
||||
android:text="今日出行遇到的交通事件"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textStyle="bold"
|
||||
app:layout_scrollFlags="scroll|enterAlways" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:listitem="@layout/item_v2x_illegal_parking" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -9,7 +9,7 @@
|
||||
android:layout_height="116.4px"
|
||||
android:layout_marginTop="30px"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@drawable/amap_ride" />
|
||||
android:src="@drawable/icon_share_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_event_null_des"
|
||||
|
||||
@@ -49,15 +49,14 @@
|
||||
android:textSize="18px" />
|
||||
|
||||
|
||||
<ImageView
|
||||
<com.mogo.module.v2x.view.HeartUnLikeView
|
||||
android:id="@+id/road_case_useless"
|
||||
android:layout_width="44px"
|
||||
android:layout_height="44px"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_toLeftOf="@id/road_case_useless_num"
|
||||
android:gravity="center"
|
||||
android:paddingRight="5px"
|
||||
android:src="@drawable/amap_bus" />
|
||||
android:paddingRight="5px" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_useful_num"
|
||||
@@ -71,14 +70,13 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
<ImageView
|
||||
<com.mogo.module.v2x.view.HeartLikeView
|
||||
android:id="@+id/road_case_uselful"
|
||||
android:layout_width="44px"
|
||||
android:layout_height="44px"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_toLeftOf="@id/road_case_useful_num"
|
||||
android:paddingRight="5px"
|
||||
android:src="@drawable/amap_ride" />
|
||||
android:paddingRight="5px" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_address"
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivEmptyView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:src="@drawable/icon_blank_history_event"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvTrip"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTrip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:gravity="center"
|
||||
android:text="周边5公里,暂无交通事件\n
|
||||
你可以试着分享一个交通事件给其他车主"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnShear"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivEmptyView" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnShear"
|
||||
android:layout_width="@dimen/dp_300"
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:background="@drawable/v2xt_dw_common_corner_bkg_dark"
|
||||
android:gravity="center"
|
||||
android:text="去分享"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintEnd_toStartOf="@+id/btnRefresh"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivEmptyView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTrip" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnRefresh"
|
||||
android:layout_width="@dimen/dp_300"
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:background="@drawable/v2xt_dw_common_corner_bkg_light"
|
||||
android:gravity="center"
|
||||
android:text="刷新"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivEmptyView"
|
||||
app:layout_constraintStart_toEndOf="@+id/btnShear"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTrip" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -5,10 +5,10 @@
|
||||
</declare-styleable>
|
||||
|
||||
<style name="customRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
|
||||
<item name="android:minHeight">17px</item>
|
||||
<item name="android:maxHeight">17px</item>
|
||||
<item name="android:maxWidth">15.4px</item>
|
||||
<item name="android:minWidth">15.4px</item>
|
||||
<item name="android:minHeight">18px</item>
|
||||
<item name="android:maxHeight">18px</item>
|
||||
<item name="android:maxWidth">16px</item>
|
||||
<item name="android:minWidth">16px</item>
|
||||
<item name="android:spacing">3.7px</item>
|
||||
<item name="android:numStars">5</item>
|
||||
<item name="android:rating">1</item>
|
||||
|
||||