diff --git a/gradle.properties b/gradle.properties index e47b270df9..1c95496670 100644 --- a/gradle.properties +++ b/gradle.properties @@ -70,7 +70,7 @@ MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT # 在线车辆F MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2 # v2x -MOGO_MODULE_V2X_VERSION=1.1.2 +MOGO_MODULE_V2X_VERSION=1.1.4 # 媒体卡片 MOGO_MODULE_MEDIA_VERSION=1.0.4.11 # 推送 diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java index fa5f1578d3..131daca1b0 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java @@ -42,7 +42,7 @@ public class MapCenterPointStrategy { { // 导航场景,定位视图右下角偏下 Map< Integer, MapCenterPoint > navi = new HashMap<>(); - navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.573333333333D ) ); + navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444D, 0.573333333333D ) ); navi.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.575D ) ); sStrategies.put( Scene.NAVI, navi ); } @@ -50,7 +50,7 @@ public class MapCenterPointStrategy { { // 导航场景 vs 道路事件展示场景,定位视图右下角偏下 Map< Integer, MapCenterPoint > naviWithRoadEvent = new HashMap<>(); - naviWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.68333333333D ) ); + naviWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.68333333333D ) ); naviWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.683333333333D ) ); sStrategies.put( Scene.NAVI_WITH_ROAD_EVENT, naviWithRoadEvent ); } @@ -58,7 +58,7 @@ public class MapCenterPointStrategy { { // 巡航场景,定位视图右下角偏下 Map< Integer, MapCenterPoint > aimless = new HashMap<>(); - aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.5D ) ); + aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.5D ) ); aimless.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.5D ) ); sStrategies.put( Scene.AIMLESS, aimless ); } @@ -66,7 +66,7 @@ public class MapCenterPointStrategy { { // 巡航场景 vs 道路事件展示场景,定位视图右下角偏下 Map< Integer, MapCenterPoint > aimlessWithRoadEvent = new HashMap<>(); - aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.585 ) ); + aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.585 ) ); aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.599074074D ) ); sStrategies.put( Scene.AIMLESS_WITH_ROAD_EVENT, aimlessWithRoadEvent ); } diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java index f5564894eb..8042eab36e 100644 --- a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java +++ b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java @@ -70,6 +70,7 @@ public class WebSocketManager { super.onOpen( handshakedata ); UiThreadHandler.post( () -> { TipToast.shortTip( "模拟GPS开启成功" ); + mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ).stop(); } ); } @@ -78,6 +79,7 @@ public class WebSocketManager { super.onClose( code, reason, remote ); UiThreadHandler.post( () -> { TipToast.shortTip( "模拟GPS关闭成功" ); + mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ).start(); } ); shutdownServiceQuietly(); } diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java index b367177ad7..1dfcd19655 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java @@ -16,6 +16,7 @@ import com.mogo.module.main.EventDispatchCenter; import com.mogo.module.main.cards.MogoModulesManager; import com.mogo.service.IMogoServiceApis; import com.mogo.service.MogoServicePaths; +import com.mogo.utils.UiThreadHandler; import com.mogo.utils.logger.Logger; import com.zhidao.roadcondition.service.MainService; @@ -50,9 +51,12 @@ class MogoMainService extends Service implements IMogoLocationListener { mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(); initAndStartLocation(); initGpsSimulatorListener(); - loadBaseModules(); - startTanluService(); - initADAS(); + UiThreadHandler.postDelayed( () -> { + loadBaseModules(); + startTanluService(); + initADAS(); + }, 2_000L + ); return START_STICKY; } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java index 960153e1b1..c76e7b3193 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java @@ -194,11 +194,11 @@ public class MarkerServiceHandler { * 绘制Marker * 建议使用 * - * @see MapMarkerManager#drawMapMarker(MarkerShowEntity) + * @see MapMarkerManager#drawMapMarker(MarkerShowEntity, int) */ @Deprecated public static IMogoMarker drawMapMarker( MarkerShowEntity markerShowEntity ) { - return getMapMarkerManager().drawMapMarker( markerShowEntity ); + return getMapMarkerManager().drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH ); } /** diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java index ab0ccef734..a89c3b1ddd 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java @@ -113,6 +113,9 @@ public class ServiceConst { */ public static final int MSG_LOCK_CAR = 0x202; + public static final int MARKER_Z_INDEX_HIGH = 100; + public static final int MARKER_Z_INDEX_LOW = 2; + /** * 切换卡片内容-上一个 diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java index 8e704eedf7..9aa60447de 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java @@ -320,7 +320,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, String sn = getCarSnFromEntity( markerOnlineCar ); IMogoMarker mogoMarker = existCarMap.get( sn ); if ( mogoMarker == null ) { - mogoMarker = drawMapMarker( markerShowEntity ); + mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_LOW ); } startSmooth( mogoMarker, markerOnlineCar, markerLocation ); } @@ -360,7 +360,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoMarker mogoMarker = existCarMap.get( sn ); if ( mogoMarker == null ) { Logger.d( TAG, "draw road condition, sn = %s", sn ); - drawMapMarker( markerShowEntity ); + drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH ); } } } @@ -392,7 +392,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, String sn = getCarSnFromEntity( markerShareMusic ); IMogoMarker mogoMarker = existCarMap.get( sn ); if ( mogoMarker == null ) { - drawMapMarker( markerShowEntity ); + drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH ); } } } @@ -425,7 +425,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, String sn = getCarSnFromEntity( noveltyInfo ); IMogoMarker mogoMarker = existCarMap.get( sn ); if ( mogoMarker == null ) { - drawMapMarker( markerShowEntity ); + drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH ); } } } @@ -634,20 +634,20 @@ public class MapMarkerManager implements IMogoMarkerClickListener, * @param markerShowEntity marker 绘制数据实体 * @return 绘制的Marker */ - public synchronized IMogoMarker drawMapMarker( MarkerShowEntity markerShowEntity ) { + public synchronized IMogoMarker drawMapMarker( MarkerShowEntity markerShowEntity, int zIndex ) { try { - return drawMapMarkerImpl( markerShowEntity ); + return drawMapMarkerImpl( markerShowEntity, zIndex ); } catch ( Exception e ) { e.printStackTrace(); return null; } } - private IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity ) { + private IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, int zIndex ) { if ( markerShowEntity == null || markerShowEntity.getMarkerLocation() == null ) { return null; } - MogoMarkerOptions options = new MogoMarkerOptions().owner( markerShowEntity.getMarkerType() ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() ); + MogoMarkerOptions options = new MogoMarkerOptions().owner( markerShowEntity.getMarkerType() ).zIndex( zIndex ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() ); IMarkerView markerView = MapMarkerAdapter.getMarkerView( mContext, markerShowEntity, options ); if ( markerView instanceof OnlineCarMarkerView ) { try { diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MogoMarkerServiceImpl.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MogoMarkerServiceImpl.java index 28cddde085..6e820c88a2 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MogoMarkerServiceImpl.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MogoMarkerServiceImpl.java @@ -8,6 +8,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.map.marker.IMogoMarker; import com.mogo.module.common.entity.MarkerShowEntity; import com.mogo.module.service.MarkerServiceHandler; +import com.mogo.module.service.ServiceConst; import com.mogo.service.MogoServicePaths; import com.mogo.service.module.IMogoMarkerService; import com.mogo.utils.logger.Logger; @@ -27,7 +28,7 @@ public class MogoMarkerServiceImpl implements IMogoMarkerService { @Override public IMogoMarker drawMarker( Object object ) { if ( object instanceof MarkerShowEntity ) { - return MarkerServiceHandler.getMapMarkerManager().drawMapMarker( ( ( MarkerShowEntity ) object ) ); + return MarkerServiceHandler.getMapMarkerManager().drawMapMarker( ( ( MarkerShowEntity ) object ), ServiceConst.MARKER_Z_INDEX_HIGH ); } Logger.w( TAG, "object must instance of [com.mogo.module.common.entity.MarkerShowEntity]" ); return null; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java b/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java index 8e10fd796b..16856adb4f 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java @@ -10,7 +10,9 @@ public enum StatusDescriptor { /** * adas UI + * Deprecated, use {@link #V2X_UI} instead. */ + @Deprecated ADAS_UI, /** @@ -20,10 +22,7 @@ public enum StatusDescriptor { /** * v2x UI - *

- * Deprecated, use {@link #ADAS_UI} instead. */ - @Deprecated V2X_UI, /** diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java b/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java index 3d4940d28b..61768e6676 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java @@ -133,7 +133,7 @@ public class MogoStatusManager implements IMogoStatusManager { @Override public void setV2XUIShow( String tag, boolean show ) { - Logger.e( TAG, "do not implement" ); + doSetStatus( tag, StatusDescriptor.V2X_UI, show ); } @Override