Merge branch 'dev_1.1.2' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into dev_1.1.2

This commit is contained in:
wangcongtao
2020-08-12 15:13:24 +08:00
18 changed files with 177 additions and 32 deletions

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -65,7 +65,7 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
# 探路
MOGO_MODULE_TANLU_VERSION=1.3.1.24
# 车聊聊
CARCHATTING_VERSION=1.4.8
CARCHATTING_VERSION=1.4.9
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.3.4
# 视频引导

View File

@@ -1,5 +1,6 @@
package com.mogo.module.common.entity;
import com.mogo.map.location.MogoLocation;
import com.mogo.utils.sqlite.annotation.DbDatabase;
import com.mogo.utils.sqlite.annotation.DbField;
import com.mogo.utils.sqlite.annotation.DbTable;
@@ -68,4 +69,14 @@ public class V2XHistoryScenarioData {
public void setDispose(Boolean dispose) {
isDispose = dispose;
}
@Override
public V2XHistoryScenarioData clone() throws CloneNotSupportedException {
try {
return (V2XHistoryScenarioData) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return this;
}
}

View File

@@ -59,7 +59,7 @@ public class V2XConst {
*/
public static final String V2X_ROAD_SHOW = "v2x_road_show";
public static final String V2X_ROAD_EVET = "v2x_road_event";
public static final String V2X_ROAD_EVET_HISTORY_BUTTON = "V2X_button";
public static final String V2X_ROAD_EVET_HISTORY_BUTTON = "V2X_button_click";
/**
* V2X 道路事件操作类型
*/

View File

@@ -31,6 +31,7 @@ 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.tanlu.IMogoTanluProvider;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoWindowManager;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
@@ -54,7 +55,6 @@ public class V2XServiceManager {
private static IMogoLocationClient mMogoLocationClient;
private static IMogoGeoSearch mIMogoGeoSearch;
private static IMogoSearchManager mIMogoSearchManager;
private static IMogoTopViewManager mMogoTopViewManager;
private static IMogoStatusManager mMogoStatusManager;
private static IMogoWindowManager mIMogoWindowManager;
@@ -66,6 +66,7 @@ public class V2XServiceManager {
private static IMogoRefreshStrategyController mIMogoRefreshStrategyController;
private static IMogoMarkerService mIMogoMarkerService;
private static IMogoShareManager mIMogoShareManager;
private static IMogoTanluProvider mIMogoTanluProvider;
private static IMogoActionManager mMogoActionManager;
private static ICarsChattingProvider mCarsChattingProvider;
@@ -105,6 +106,7 @@ public class V2XServiceManager {
mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi();
mIMogoMarkerService = mMogoServiceApis.getMarkerService();
mIMogoShareManager = mMogoServiceApis.getShareManager();
mIMogoTanluProvider = mMogoServiceApis.getTanluApi();
mMarkerManager = mMapService.getMarkerManager(context);
mNavi = mMapService.getNavi(context);
@@ -250,4 +252,11 @@ public class V2XServiceManager {
public static IMogoShareManager getMogoShareManager() {
return mIMogoShareManager;
}
public static IMogoTanluProvider getTanluManager() {
return mIMogoTanluProvider;
}
}

View File

@@ -7,17 +7,21 @@ import android.widget.TextView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
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.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.module.v2x.voice.V2XVoiceManager;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
@@ -101,6 +105,10 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder<V2XEventShowEntity> {
*/
@Override
public void delayedCloseWindow() {
V2XHistoryScenarioData v2XHistoryScenarioData =new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING);
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(mExploreWay));
V2XSQLiteUtils.updateScenarioHistoryDataIsDispose(v2XHistoryScenarioData);
itemView.postDelayed(() -> V2XIllegalParkScenario.getInstance().close(), 1000);
}

View File

@@ -73,12 +73,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
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())) {

View File

@@ -48,7 +48,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
Logger.d(MODULE_NAME, "事件面板初始化……")
fragments = arrayOf(
V2XScenarioHistoryFragment(),
SurroundingEventFragment(),
V2XSurroundingFragment(),
V2XShareEventsFragment()
)
//禁用预加载
@@ -120,11 +120,11 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
// 修改未处理消息
fun changeEventCount() {
val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
if (historyMessage != null) {
mV2XEventPanelHistoryCountView?.changeMsgCount(historyMessage.size)
} else {
mV2XEventPanelHistoryCountView?.changeMsgCount(0)
}
// val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
// if (historyMessage != null) {
// mV2XEventPanelHistoryCountView?.changeMsgCount(historyMessage.size)
// } else {
// mV2XEventPanelHistoryCountView?.changeMsgCount(0)
// }
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.module.v2x.fragment;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
@@ -22,9 +23,11 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.ServiceConst;
@@ -54,7 +57,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* 周边事件
*/
public class SurroundingEventFragment extends MvpFragment<SurroundingEventView, SurroundingEventPresenter> implements SurroundingEventView,
public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, SurroundingEventPresenter> implements SurroundingEventView,
View.OnClickListener, SurroundingItemClickListener {
private static final String TAG = "SurroundingFragment";
private RecyclerView mRecyclerView;
@@ -193,9 +196,6 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
return valueList;
}
// TODO 排序
/**
* 处理marker的显示
*
@@ -249,6 +249,9 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
}
}, i * 100L);
}
//自适应显示
showBonndsRoadtion(exploreWayList);
} else {
Logger.e(TAG, "onItemClickListener exploreWayList == null");
}
@@ -258,6 +261,66 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
}
}
/**
* 自适应显示
*
* @param exploreWayList
*/
private void showBonndsRoadtion(List<MarkerExploreWay> exploreWayList) {
Logger.e(TAG, "showBonndsRoadtion exploreWayList.size() = " + exploreWayList.size());
Rect rect = new Rect(
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_left),
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_top),
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_right),
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_bottom));
moveNotFresh();
//第一个参数调用者,第二个参数当前自车的位置,第三个参数需要显示在范围内的点不包含自车的位置
//第四个参数显示范围的UI边界,第五个参数是否锁定自车位置看业务需要
V2XServiceManager.getMapUIController().showBounds(ServiceConst.CARD_TYPE_ROAD_CONDITION, null, getMogoList(exploreWayList), rect, false);
}
private void moveNotFresh() {
V2XServiceManager.getMoGoStatusManager().setUserInteractionStatus(TAG, true, false);
}
/**
* 构造经纬度列表
*
* @return
*/
private List<MogoLatLng> getMogoList(List<MarkerExploreWay> markerExploreWayList) {
List<MogoLatLng> list = new ArrayList<>();
if (markerExploreWayList != null && markerExploreWayList.size() > 0) {
if (markerExploreWayList.size() < 6) {
for (int i = 0; i < markerExploreWayList.size(); i++) {
MarkerLocation location = markerExploreWayList.get(i).getLocation();
if (location != null) {
MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon());
list.add(mogoLatLng);
} else {
Logger.e(TAG, "getMogoList() < 6 location == null");
}
}
} else {
for (int i = 0; i < 6; i++) {
MarkerLocation location = markerExploreWayList.get(i).getLocation();
if (location != null) {
MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon());
list.add(mogoLatLng);
} else {
Logger.e(TAG, "getMogoList() location == null");
}
}
}
} else {
Logger.e(TAG, "getMogoList() markerExploreWay == null");
}
return list;
}
@Override
public void onDestroy() {
super.onDestroy();

View File

@@ -5,7 +5,10 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.service.carinfo.CarStateInfo;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.IV2XScenarioManager;
import com.mogo.module.v2x.scenario.scene.animation.V2XAnimationScenario;
import com.mogo.module.v2x.scenario.scene.fatigue.V2XFatigueDrivingScenario;
@@ -66,7 +69,6 @@ public class V2XScenarioManager implements IV2XScenarioManager {
LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent);
mV2XScenario = mV2XScenarioSet.get(v2XMessageEntity.getType());
// 如果没有拿到之前的,根据类型分发
if (mV2XScenario == null) {
switch (v2XMessageEntity.getType()) {

View File

@@ -5,6 +5,7 @@ import android.view.ViewGroup;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -57,6 +58,10 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
if (v2XRoadEventEntity != null) {
//上报路况
V2XServiceManager.getMoGoStatusManager().setUploadingStatus(ServiceConst.CARD_TYPE_ROAD_CONDITION, true);
V2XServiceManager.getTanluManager().uploadRoadCondition(v2XRoadEventEntity.getPoiType());
if (v2XMessageEntity.isShowState()) {
if (!isSameScenario(v2XMessageEntity)) {
// 更新要提醒的数据

View File

@@ -76,6 +76,13 @@ public class V2XSQLiteUtils {
return getScenarioHistoryDao().query(new V2XHistoryScenarioData(), "triggerTime", true);
}
/**
* 查询当天的指定的V2X数据
*/
public static List<V2XHistoryScenarioData> getTargetScenarioHistoryData(V2XHistoryScenarioData scenarioData) {
return getScenarioHistoryDao().query(scenarioData, "triggerTime", true);
}
/**
* 查询当天的未评价V2X数据
*/
@@ -99,7 +106,26 @@ public class V2XSQLiteUtils {
}
/**
* 存储本地数据
* 修改指定的数据为已经操作的数据
*/
public static void updateScenarioHistoryDataIsDispose(V2XHistoryScenarioData oldScenarioData) {
try {
V2XHistoryScenarioData newScenarioData = new V2XHistoryScenarioData();
newScenarioData.setDispose(true);
newScenarioData.setTriggerTime(TimeUtils.getNowMills());
newScenarioData.setEventJsonData(oldScenarioData.getEventJsonData());
newScenarioData.setScenarioType(oldScenarioData.getScenarioType());
int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData);
Logger.d(V2XConst.MODULE_NAME, "修改数据成功:" + result);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 存储本地数据,每个数据只能存在一次,所以存储之前先查询数据库如果已经存在则修改触碰时间
*
* @param markerExploreWay 要存储的场景
*/
@@ -108,10 +134,20 @@ public class V2XSQLiteUtils {
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(scenarioType);
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
List<V2XHistoryScenarioData> historyScenarioData = getTargetScenarioHistoryData(v2XHistoryScenarioData);
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setDispose(false);
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
if (historyScenarioData != null && historyScenarioData.size() > 0) {
// 更新数据
V2XSQLiteUtils.getScenarioHistoryDao().update(historyScenarioData.get(0), v2XHistoryScenarioData);
} else {
// 存储新数据
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
}
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/surrounding_card_background"/>
<corners android:radius="@dimen/module_v2x_surrounding_item_bottom_size" />
</shape>

View File

@@ -40,9 +40,11 @@
android:text="待援助"
android:textColor="#ffffff"
android:textSize="@dimen/dp_28"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tagEventType"
app:layout_constraintStart_toEndOf="@+id/tagEventType"
app:layout_constraintTop_toTopOf="@+id/tagEventType" />
app:layout_constraintTop_toTopOf="@+id/tagEventType"
tools:visibility="visible" />
<com.mogo.service.imageloader.MogoImageView
android:id="@+id/ivFaultHelpHead"
@@ -69,7 +71,7 @@
android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_30"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_34"
android:textSize="@dimen/dp_33"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/tvFaultHelpDistance"
app:layout_constraintStart_toEndOf="@id/ivFaultHelpHead"
@@ -82,11 +84,12 @@
android:id="@+id/tvFaultHelpEventTime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_24"
android:alpha="0.59"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_30"
android:textSize="@dimen/dp_29"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tvFaultHelpDistance"
app:layout_constraintStart_toStartOf="@id/tvFaultHelpName"
@@ -102,10 +105,9 @@
android:textColor="#FFF"
android:textSize="@dimen/dp_80"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/ivFaultHelpEventCall"
app:layout_constraintBottom_toBottomOf="@+id/tvFaultHelpEventTime"
app:layout_constraintEnd_toStartOf="@+id/ivFaultHelpEventCall"
app:layout_constraintStart_toEndOf="@+id/tvFaultHelpEventTime"
app:layout_constraintTop_toTopOf="@+id/ivFaultHelpEventCall"
tools:text="300M" />
<ImageView

View File

@@ -4,7 +4,7 @@
android:id="@+id/clPanelContainer"
android:layout_width="642px"
android:layout_height="532px"
android:background="@color/surrounding_card_background">
android:background="@drawable/bg_v2x_event_surrounding_item">
<!--顶部layout-->
<RelativeLayout

View File

@@ -16,7 +16,7 @@
"distance":670,
"fileType":1,
"generateTime":1593587904096,
"infoId":"727905963169587200",
"infoId":"72790596316958720000",
"items":[
{
"illegalCount":0,

View File

@@ -25,4 +25,9 @@
<dimen name="module_v2x_history_event_icon_size">80px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_size">6px</dimen>
<dimen name="tanlu_module_map_left">550px</dimen>
<dimen name="tanlu_module_map_top">200px</dimen>
<dimen name="tanlu_module_map_right">200px</dimen>
<dimen name="tanlu_module_map_bottom">100px</dimen>
</resources>

View File

@@ -26,5 +26,9 @@
<dimen name="module_v2x_history_event_icon_size">40px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_size">6px</dimen>
<dimen name="module_v2x_surrounding_item_size">16px</dimen>
<dimen name="tanlu_module_map_left">550px</dimen>
<dimen name="tanlu_module_map_top">200px</dimen>
<dimen name="tanlu_module_map_right">200px</dimen>
<dimen name="tanlu_module_map_bottom">100px</dimen>
</resources>