From d159c8c27619911ef864cde589c8f1b7bbb57537 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Wed, 30 Dec 2020 15:25:32 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=AE=8C=E6=88=90=E5=90=8E=E5=9C=A8=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/map/impl/custom/AMapViewWrapper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 13f8f5a4d5..61a8b483b0 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -697,7 +697,9 @@ public class AMapViewWrapper implements IMogoMapView, } NaviClient.getInstance( getContext() ).syncCarLocation( sysLocation ); - MapStyleController.getInstance().onLocationChanged( location, this ); + if ( checkAMapView() ) { + MapStyleController.getInstance().onLocationChanged( location, this ); + } } @Override From 3ae09925b9955336e6ffda8dcb8d99efde5b2043 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Wed, 30 Dec 2020 16:08:33 +0800 Subject: [PATCH 02/28] opt --- app/functions/httpdns.gradle | 16 ++++++++-------- .../map/impl/custom/CustomMapApiBuilder.java | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/functions/httpdns.gradle b/app/functions/httpdns.gradle index 176938bc92..0da084c406 100644 --- a/app/functions/httpdns.gradle +++ b/app/functions/httpdns.gradle @@ -8,10 +8,10 @@ project.dependencies { d8xxImplementation rootProject.ext.dependencies.httpdnsnoop d80xImplementation rootProject.ext.dependencies.httpdnsnoop em4Implementation rootProject.ext.dependencies.httpdnsnoop - e8xxImplementation rootProject.ext.dependencies.httpdnstencent - f8xxImplementation rootProject.ext.dependencies.httpdnstencent - f80xImplementation rootProject.ext.dependencies.httpdnstencent - f8AmapImplementation rootProject.ext.dependencies.httpdnstencent + e8xxImplementation rootProject.ext.dependencies.httpdnsnoop + f8xxImplementation rootProject.ext.dependencies.httpdnsnoop + f80xImplementation rootProject.ext.dependencies.httpdnsnoop + f8AmapImplementation rootProject.ext.dependencies.httpdnsnoop em3Implementation rootProject.ext.dependencies.httpdnsnoop } else { bydautoImplementation project(':foudations:httpdns-noop') @@ -20,10 +20,10 @@ project.dependencies { d8xxImplementation project(':foudations:httpdns-noop') d80xImplementation project(':foudations:httpdns-noop') em4Implementation project(':foudations:httpdns-noop') - e8xxImplementation project(':foudations:httpdns-tencent') - f8xxImplementation project(':foudations:httpdns-tencent') - f80xImplementation project(':foudations:httpdns-tencent') - f8AmapImplementation project(':foudations:httpdns-tencent') + e8xxImplementation project(':foudations:httpdns-noop') + f8xxImplementation project(':foudations:httpdns-noop') + f80xImplementation project(':foudations:httpdns-noop') + f8AmapImplementation project(':foudations:httpdns-noop') em3Implementation project(':foudations:httpdns-noop') } } \ No newline at end of file diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java index 2dd9320480..4656d28323 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java @@ -3,6 +3,7 @@ package com.mogo.map.impl.custom; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.debug.DebugConfig; import com.mogo.map.CoordinatesTransformer; import com.mogo.map.IMogoMapApiBuilder; import com.mogo.map.IMogoMapView; @@ -92,7 +93,7 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder { @Override public IMogoMapView getMapView( Context context ) { NavAutoApi.INSTANCE.init( context, MapParams.Companion.init() - .setDebugMode( true ) + .setDebugMode( DebugConfig.isDebug() ) .setCoordinateType( MapParams.COORDINATETYPE_GCJ02 ) .setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D ) .setZoom( 16 ) From 61bc8475967634f2655420ceb8c3c406bb1b6185 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 30 Dec 2020 16:21:05 +0800 Subject: [PATCH 03/28] =?UTF-8?q?vr=E6=A8=A1=E5=BC=8F=E9=9A=90=E8=97=8Fugc?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/v2x/scenario/impl/V2XScenarioManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java index 41e131b359..666cbca23a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java @@ -1,6 +1,7 @@ package com.mogo.module.v2x.scenario.impl; import android.content.Intent; +import android.util.Log; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -91,7 +92,11 @@ public class V2XScenarioManager implements IV2XScenarioManager { mV2XScenario = new V2XIllegalParkScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING: - mV2XScenario = new V2XEventUgcScenario(); + if (V2XServiceManager.getMoGoStatusManager().isVrMode() == false) { + mV2XScenario = new V2XEventUgcScenario(); + } else { + mV2XScenario = null; + } break; case V2XMessageEntity.V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW: mV2XScenario = new V2XVoiceCallLiveScenario(); From e5c88cce3f12fc4134e28972c60cd644e13a79dc Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 30 Dec 2020 16:23:46 +0800 Subject: [PATCH 04/28] no message --- .../mogo/module/v2x/scenario/impl/V2XScenarioManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java index 666cbca23a..05ace32d78 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java @@ -92,10 +92,10 @@ public class V2XScenarioManager implements IV2XScenarioManager { mV2XScenario = new V2XIllegalParkScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING: - if (V2XServiceManager.getMoGoStatusManager().isVrMode() == false) { - mV2XScenario = new V2XEventUgcScenario(); - } else { + if (V2XServiceManager.getMoGoStatusManager().isVrMode()) { mV2XScenario = null; + } else { + mV2XScenario = new V2XEventUgcScenario(); } break; case V2XMessageEntity.V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW: From c34291d4cf5ebd955d8d53e2e33668d9c5c094f1 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 30 Dec 2020 16:30:26 +0800 Subject: [PATCH 05/28] =?UTF-8?q?vr=E6=A8=A1=E5=BC=8F=E9=9A=90=E8=97=8Fugc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/v2x/scenario/impl/V2XScenarioManager.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java index 05ace32d78..154e90da24 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java @@ -92,11 +92,7 @@ public class V2XScenarioManager implements IV2XScenarioManager { mV2XScenario = new V2XIllegalParkScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING: - if (V2XServiceManager.getMoGoStatusManager().isVrMode()) { - mV2XScenario = null; - } else { - mV2XScenario = new V2XEventUgcScenario(); - } + mV2XScenario = V2XServiceManager.getMoGoStatusManager().isVrMode() ? null : new V2XEventUgcScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW: mV2XScenario = new V2XVoiceCallLiveScenario(); From be237dd3237ded70fad66f8dcaecb718eed683d6 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Wed, 30 Dec 2020 16:35:39 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E5=B0=86http=20dns=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E6=88=90noop=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 +++- .../java/com/mogo/base/websocket/WebSocketConstant.java | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 87bfe5dff1..35ae13fe20 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -484,6 +484,7 @@ dependencies { implementation rootProject.ext.dependencies.moduleextensions implementation rootProject.ext.dependencies.modulemap implementation rootProject.ext.dependencies.moduleSmallMap + implementation rootProject.ext.dependencies.httpdnsnoop } else { implementation project(':foudations:mogo-commons') implementation project(':foudations:mogo-base-websocket-sdk') @@ -501,6 +502,7 @@ dependencies { implementation project(':modules:mogo-module-extensions') implementation project(':modules:mogo-module-map') implementation project(':modules:mogo-module-smp') + implementation project(':foudations:httpdns-noop') } apply from: "./functions/basedmap.gradle" @@ -513,7 +515,7 @@ dependencies { apply from: "./functions/crashreport.gradle" apply from: "./functions/widgets.gradle" apply from: "./functions/tts.gradle" - apply from: "./functions/httpdns.gradle" +// apply from: "./functions/httpdns.gradle" apply from: "./functions/backwidget.gradle" apply from: "./functions/mediaui.gradle" apply from: "./functions/bizguide.gradle" diff --git a/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java b/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java index f0e5ec13b7..df1706b0c5 100644 --- a/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java +++ b/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java @@ -8,11 +8,11 @@ import com.mogo.commons.debug.DebugConfig; @Keep public class WebSocketConstant { - private static final String HOST_DEV = "ws://62.234.196.121"; - private static final String HOST_QA = "ws://62.234.196.121"; - private static final String HOST_DEMO = "ws://62.234.196.121"; + private static final String HOST_DEV = "ws://119.45.249.167"; + private static final String HOST_QA = "ws://119.45.249.167"; + private static final String HOST_DEMO = "ws://119.45.249.167"; @Keep - private static final String HOST_RELEASE = "ws://62.234.196.121"; + private static final String HOST_RELEASE = "ws://119.45.249.167"; // private static final String PORT = ":14001/ws"; @Keep public static final String PATH = "/ws"; From 63002f1bd668cad2676bfa34532816c08570bd2b Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Wed, 30 Dec 2020 16:08:33 +0800 Subject: [PATCH 07/28] bugfix --- .../java/com/mogo/module/service/MogoServices.java | 12 +++++++----- .../mogo/service/impl/adas/MogoADASController.java | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java index fb0db8e17d..dcb08560b4 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java @@ -932,11 +932,13 @@ public class MogoServices implements IMogoMapListener, @Override public void onMapModeChanged( EnumMapUI ui ) { if ( ui == EnumMapUI.Type_VR ) { - MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true ); - MapCenterPointStrategy.resetByChangeMode(); - MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); - AIAssist.getInstance( mContext ).speakTTSVoice( "你已进入鹰眼模式" ); - mLastStatusIsVr = true; + if ( !mLastStatusIsVr ) { + MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true ); + MapCenterPointStrategy.resetByChangeMode(); + MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); + AIAssist.getInstance( mContext ).speakTTSVoice( "你已进入鹰眼模式" ); + mLastStatusIsVr = true; + } } else { if ( mLastStatusIsVr ) { mLastStatusIsVr = false; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java index f82bf29011..f828ef9ab8 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java @@ -323,6 +323,10 @@ public class MogoADASController implements IMogoADASController { return; } + if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { + return; + } + try { AutopilotServiceManage.getInstance().showAdas(); } catch ( Exception e ) { From 80ecc411fb04b0a9d4c979fcfe5676aeaabba3f2 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Wed, 30 Dec 2020 17:10:09 +0800 Subject: [PATCH 08/28] =?UTF-8?q?http=20dns=20noop=20=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BC=A0=E5=85=A5=E7=9A=84host?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/gradle.xml | 1 + .../src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 426ff6b360..8efbfa420e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -85,6 +85,7 @@ diff --git a/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java b/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java index fdf50007aa..5cd0e7df49 100644 --- a/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java +++ b/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java @@ -26,13 +26,13 @@ class HttpDnsNoop implements IMogoHttpDns { @Override public String getCachedHttpDnsIps( String host,int type ) { - return null; + return host; } @Override public void getHttpDnsIp( String host,int type, boolean useCache, IHttpDnsCallback callback ) { if ( callback != null ) { - callback.onParsed( null ); + callback.onParsed( host ); } } From eb3fd2eea8cadabf1c48fd792065f8778ea1dc3b Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Wed, 30 Dec 2020 17:59:03 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E5=B0=86=E8=87=AA=E5=8A=A8=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E9=B9=B0=E7=9C=BC=E6=A8=A1=E5=BC=8F=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=BF=9B=E8=A1=8C=E5=BB=B6=E6=97=B6=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=92=8C=E5=88=9D=E5=A7=8B=E5=8C=96=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/map/impl/custom/AMapViewWrapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 61a8b483b0..ca6c432960 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -698,7 +698,10 @@ public class AMapViewWrapper implements IMogoMapView, NaviClient.getInstance( getContext() ).syncCarLocation( sysLocation ); if ( checkAMapView() ) { - MapStyleController.getInstance().onLocationChanged( location, this ); + // 避免设置之后被其他初始化给重置为其他模式 + UiThreadHandler.postDelayed( () -> { + MapStyleController.getInstance().onLocationChanged( location, this ); + }, 5_000L ); } } From a588c7f22bebc31680aa85a367b05abf0e346460 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Wed, 30 Dec 2020 18:04:55 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=AA=E7=A0=94?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=89=88=E6=9C=AC=E4=B8=BA1.0.0-vr-7.5.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/map-custom/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/map-custom/build.gradle b/libraries/map-custom/build.gradle index e6d6a83127..b7408bfcc7 100644 --- a/libraries/map-custom/build.gradle +++ b/libraries/map-custom/build.gradle @@ -67,7 +67,7 @@ dependencies { implementation project(':foudations:mogo-commons') } - implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.5.5' + implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.5.7' // implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.5-log-1' } From 90c95f632437c6461f6f179fc17fefdf3a0b7a51 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Thu, 31 Dec 2020 10:59:19 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/map/impl/custom/AMapViewWrapper.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index ca6c432960..e8672f9503 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -86,6 +86,7 @@ public class AMapViewWrapper implements IMogoMapView, private Location mLastDriveLocationShadow = null; private EnumMapUI mCurrentUI; private boolean mIsLightStyle = false; + private boolean mMapLoaded = false; public AMapViewWrapper( MapAutoView mMapView ) { startTime = System.currentTimeMillis(); @@ -344,7 +345,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void moveToCenter( MogoLatLng latLng ) { - + moveToCenter( latLng, true ); } private void setUIMode( EnumMapUI ui ) { @@ -697,7 +698,7 @@ public class AMapViewWrapper implements IMogoMapView, } NaviClient.getInstance( getContext() ).syncCarLocation( sysLocation ); - if ( checkAMapView() ) { + if ( checkAMapView() && mMapLoaded ) { // 避免设置之后被其他初始化给重置为其他模式 UiThreadHandler.postDelayed( () -> { MapStyleController.getInstance().onLocationChanged( location, this ); @@ -717,6 +718,7 @@ public class AMapViewWrapper implements IMogoMapView, public void onMapLoaded() { Logger.i( TAG, "autoop--onMapLoaded: " ); MogoMapListenerHandler.getInstance().onMapLoaded(); + mMapLoaded = true; CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition(); if ( cameraPosition != null ) { Trace.beginSection( "timer.onCameraChangeFinish" ); @@ -726,9 +728,6 @@ public class AMapViewWrapper implements IMogoMapView, cameraPosition.getBearing() ); Trace.endSection(); } - - getMap().getUIController().setAnchorRate( 0.01f ); - getMap().getUIController().setAnchorScale( 1.2f, 2.7f ); } @Override From 789d983021a74119afdd5713af9acd45ef201078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 31 Dec 2020 11:41:19 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E6=95=B4=E7=90=86hook=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mogo-module-common/CMakeLists.txt | 65 ++++++++----------- modules/mogo-module-common/build.gradle | 2 +- modules/mogo-module-common/src/main/cpp/Api.h | 16 +++++ .../src/main/cpp/method-hook-lib.cpp | 12 +++- 4 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 modules/mogo-module-common/src/main/cpp/Api.h diff --git a/modules/mogo-module-common/CMakeLists.txt b/modules/mogo-module-common/CMakeLists.txt index e66e013af7..33493ce303 100644 --- a/modules/mogo-module-common/CMakeLists.txt +++ b/modules/mogo-module-common/CMakeLists.txt @@ -1,44 +1,33 @@ -# For more information about using CMake with Android Studio, read the -# documentation: https://d.android.com/studio/projects/add-native-code.html - -# Sets the minimum version of CMake required to build the native library. +# 更多关于在Android Studio中使用CMake的信息,请阅读文档 +# https://d.android.com/studio/projects/add-native-code.html +# 设置构建本机库所需的CMake的最小版本。 cmake_minimum_required(VERSION 3.4.1) -# Creates and names a library, sets it as either STATIC -# or SHARED, and provides the relative paths to its source code. -# You can define multiple libraries, and CMake builds them for you. -# Gradle automatically packages shared libraries with your APK. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -frtti -fexceptions") -add_library( # Sets the name of the library. - method-hook-lib +# 指定的源文件生成链接文件,然后添加到工程中去 +add_library( + # 设置库的名称。对应 System.loadLibrary("native-lib"); 使用的名称 + method-hook-lib + # 将库设置为共享库。 + SHARED + # 提供了到源文件的相对路径。 + src/main/cpp/method-hook-lib.cpp) - # Sets the library as a shared library. - SHARED +# 搜索指定的预构建库并将路径存储为变量。 +# 因为CMake在搜索路径中默认包含系统库, +# 所以你只需要指定你想要添加的公共NDK库的名称, +# CMake在完成它的构建之前会验证这个库是否存在。 +find_library( + # 设置path变量的名称。 + log-lib + # 指定你想要CMake定位的NDK库的名称。 + log) - # Provides a relative path to your source file(s). - src/main/cpp/method-hook-lib.cpp ) - -# Searches for a specified prebuilt library and stores the path as a -# variable. Because CMake includes system libraries in the search path by -# default, you only need to specify the name of the public NDK library -# you want to add. CMake verifies that the library exists before -# completing its build. - -find_library( # Sets the name of the path variable. - log-lib - - # Specifies the name of the NDK library that - # you want CMake to locate. - log ) - -# Specifies libraries CMake should link to your target library. You -# can link multiple libraries, such as libraries you define in this -# build script, prebuilt third-party libraries, or system libraries. - -target_link_libraries( # Specifies the target library. - method-hook-lib - - # Links the target library to the log library - # included in the NDK. - ${log-lib} ) \ No newline at end of file +# 为native-lib添加ffmpeg编译连接库 +target_link_libraries( + # 指定目标库。 + method-hook-lib + # 将目标库链接到包含在NDK中的日志库。 + ${log-lib}) \ No newline at end of file diff --git a/modules/mogo-module-common/build.gradle b/modules/mogo-module-common/build.gradle index 783a180702..23ea152ed1 100644 --- a/modules/mogo-module-common/build.gradle +++ b/modules/mogo-module-common/build.gradle @@ -14,7 +14,7 @@ android { externalNativeBuild { cmake { - cppFlags "-std=c++11 -frtti -fexceptions" + cppFlags "" } } } diff --git a/modules/mogo-module-common/src/main/cpp/Api.h b/modules/mogo-module-common/src/main/cpp/Api.h new file mode 100644 index 0000000000..e61958e771 --- /dev/null +++ b/modules/mogo-module-common/src/main/cpp/Api.h @@ -0,0 +1,16 @@ +// +// Created by on 2020-05-08. +// + +#ifndef API_H +#define API_H + +#include + +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"Native_RtmpPusher",__VA_ARGS__) +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,"Native_RtmpPusher",__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,"Native_RtmpPusher",__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"Native_RtmpPusher",__VA_ARGS__) + + +#endif //API_H diff --git a/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp b/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp index dd5111ea23..477a2c1a3f 100644 --- a/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp +++ b/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp @@ -1,7 +1,7 @@ #include #include +#include "Api.h" -// // Created by donghongyu on 12/10/20 1:34 PM. // 源码地址 https://github.com/pqpo/methodhook // 方法hook jni类 @@ -22,7 +22,10 @@ static struct { * @param destMethodObj 替换的方法对象 * @return */ -static jlong methodHook(JNIEnv *env, jclass type, jobject srcMethodObj, jobject destMethodObj) { +static jlong methodHook(JNIEnv *env, + jclass type, + jobject srcMethodObj, + jobject destMethodObj) { // 反射:获取了Java对象的在native层的 ArtMethod指针 void *srcMethod = reinterpret_cast(env->FromReflectedMethod(srcMethodObj)); void *destMethod = reinterpret_cast(env->FromReflectedMethod(destMethodObj)); @@ -45,7 +48,10 @@ static jlong methodHook(JNIEnv *env, jclass type, jobject srcMethodObj, jobject * @param methodPtr * @return */ -static jobject methodRestore(JNIEnv *env, jclass type, jobject srcMethod, jlong methodPtr) { +static jobject methodRestore(JNIEnv *env, + jclass type, + jobject srcMethod, + jlong methodPtr) { // 要还原的旧方法 指针 int *backupMethod = reinterpret_cast(methodPtr); // 获取了Java对象的在native层的 ArtMethod指针 From d582bc3c4172278e9457dd49c45f8a7792c13dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 31 Dec 2020 16:43:05 +0800 Subject: [PATCH 13/28] =?UTF-8?q?=E5=B0=86hook=E5=8D=95=E7=8B=AC=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E5=BA=93=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/gradle.xml | 1 - .../map/impl/custom/CustomMapApiBuilder.java | 10 +- modules/mogo-module-common/CMakeLists.txt | 33 ------ modules/mogo-module-common/build.gradle | 12 +- modules/mogo-module-common/src/main/cpp/Api.h | 16 --- .../src/main/cpp/method-hook-lib.cpp | 108 ------------------ .../mogo/module/common/hook/HookManager.java | 67 ----------- .../mogo/module/common/hook/MethodHook.java | 100 ---------------- .../module/small/map/SmallVisionProvider.java | 2 +- 9 files changed, 10 insertions(+), 339 deletions(-) delete mode 100644 modules/mogo-module-common/CMakeLists.txt delete mode 100644 modules/mogo-module-common/src/main/cpp/Api.h delete mode 100644 modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp delete mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/HookManager.java delete mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/MethodHook.java diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8efbfa420e..426ff6b360 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -85,7 +85,6 @@ diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java index 4656d28323..5660221fb5 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java @@ -99,8 +99,14 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder { .setZoom( 16 ) .setPointToCenter( 0.734375f, 0.5f ) .setStyleMode( MapParams.MAP_STYLE_NIGHT ), NavParams.Companion.init() ); - MapAutoView mapAutoView = new MapAutoView( context ); - IMogoMapView mapView = new AMapViewWrapper( mapAutoView ); + MapAutoView mapAutoView = new MapAutoView(context); + Logger.w(TAG, "mapAutoView==" + mapAutoView); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + IMogoMapView mapView = new AMapViewWrapper(mapAutoView); return mapView; } diff --git a/modules/mogo-module-common/CMakeLists.txt b/modules/mogo-module-common/CMakeLists.txt deleted file mode 100644 index 33493ce303..0000000000 --- a/modules/mogo-module-common/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# 更多关于在Android Studio中使用CMake的信息,请阅读文档 -# https://d.android.com/studio/projects/add-native-code.html - -# 设置构建本机库所需的CMake的最小版本。 -cmake_minimum_required(VERSION 3.4.1) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -frtti -fexceptions") - -# 指定的源文件生成链接文件,然后添加到工程中去 -add_library( - # 设置库的名称。对应 System.loadLibrary("native-lib"); 使用的名称 - method-hook-lib - # 将库设置为共享库。 - SHARED - # 提供了到源文件的相对路径。 - src/main/cpp/method-hook-lib.cpp) - -# 搜索指定的预构建库并将路径存储为变量。 -# 因为CMake在搜索路径中默认包含系统库, -# 所以你只需要指定你想要添加的公共NDK库的名称, -# CMake在完成它的构建之前会验证这个库是否存在。 -find_library( - # 设置path变量的名称。 - log-lib - # 指定你想要CMake定位的NDK库的名称。 - log) - -# 为native-lib添加ffmpeg编译连接库 -target_link_libraries( - # 指定目标库。 - method-hook-lib - # 将目标库链接到包含在NDK中的日志库。 - ${log-lib}) \ No newline at end of file diff --git a/modules/mogo-module-common/build.gradle b/modules/mogo-module-common/build.gradle index 23ea152ed1..e6efc88b0b 100644 --- a/modules/mogo-module-common/build.gradle +++ b/modules/mogo-module-common/build.gradle @@ -11,17 +11,6 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' - - externalNativeBuild { - cmake { - cppFlags "" - } - } - } - externalNativeBuild { - cmake { - path "CMakeLists.txt" - } } buildTypes { release { @@ -44,6 +33,7 @@ dependencies { implementation rootProject.ext.dependencies.androidxconstraintlayout implementation rootProject.ext.dependencies.arouter implementation rootProject.ext.dependencies.callchatprovider + api "com.mogo.libs:hook:1.0" if (Boolean.valueOf(RELEASE)) { api rootProject.ext.dependencies.mogomap api rootProject.ext.dependencies.mogomapapi diff --git a/modules/mogo-module-common/src/main/cpp/Api.h b/modules/mogo-module-common/src/main/cpp/Api.h deleted file mode 100644 index e61958e771..0000000000 --- a/modules/mogo-module-common/src/main/cpp/Api.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// Created by on 2020-05-08. -// - -#ifndef API_H -#define API_H - -#include - -#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"Native_RtmpPusher",__VA_ARGS__) -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,"Native_RtmpPusher",__VA_ARGS__) -#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,"Native_RtmpPusher",__VA_ARGS__) -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"Native_RtmpPusher",__VA_ARGS__) - - -#endif //API_H diff --git a/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp b/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp deleted file mode 100644 index 477a2c1a3f..0000000000 --- a/modules/mogo-module-common/src/main/cpp/method-hook-lib.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include -#include "Api.h" - -// Created by donghongyu on 12/10/20 1:34 PM. -// 源码地址 https://github.com/pqpo/methodhook -// 方法hook jni类 -static const char *kClassMethodHookChar = "com/mogo/module/common/hook/MethodHook"; - -static struct { - jmethodID m1; - jmethodID m2; - size_t methodSize; -} methodHookClassInfo; - - -/** - * 替换指定类中的方法 - * @param env - * @param type - * @param srcMethodObj 目标方法对象 - * @param destMethodObj 替换的方法对象 - * @return - */ -static jlong methodHook(JNIEnv *env, - jclass type, - jobject srcMethodObj, - jobject destMethodObj) { - // 反射:获取了Java对象的在native层的 ArtMethod指针 - void *srcMethod = reinterpret_cast(env->FromReflectedMethod(srcMethodObj)); - void *destMethod = reinterpret_cast(env->FromReflectedMethod(destMethodObj)); - // 定义存储方法ID的数组 - int *backupMethod = new int[methodHookClassInfo.methodSize]; - // 使用的内存拷贝函数 - // 将旧方法ID拷贝到数组中 - memcpy(backupMethod, srcMethod, methodHookClassInfo.methodSize); - // 将新方法替换到旧方法地址上 - memcpy(srcMethod, destMethod, methodHookClassInfo.methodSize); - // 将旧方法ID返回给java层,用来做方法还原使用 - return reinterpret_cast(backupMethod); -} - -/** - * 恢复指定类中的方法 - * @param env - * @param type - * @param srcMethod 目标方法对象 - * @param methodPtr - * @return - */ -static jobject methodRestore(JNIEnv *env, - jclass type, - jobject srcMethod, - jlong methodPtr) { - // 要还原的旧方法 指针 - int *backupMethod = reinterpret_cast(methodPtr); - // 获取了Java对象的在native层的 ArtMethod指针 - void *artMethodSrc = reinterpret_cast(env->FromReflectedMethod(srcMethod)); - // 将旧方法指针,替换到 artMethodSrc 中 - memcpy(artMethodSrc, backupMethod, methodHookClassInfo.methodSize); - // 删除旧方法备份指针 - delete[]backupMethod; - // 返回旧方法 - return srcMethod; -} - -// 定义要注册的方法 -static JNINativeMethod gMethods[] = { - { - "hook_native", - "(Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;)J", - (void *) methodHook - }, - { - "restore_native", - "(Ljava/lang/reflect/Method;J)Ljava/lang/reflect/Method;", - (void *) methodRestore - } -}; - -extern "C" -JNIEXPORT jint JNICALL -/** - * 在jni加载的时候进行方法参数获取 - * @param vm - * @param reserved - * @return - */ -JNI_OnLoad(JavaVM *vm, void *reserved) { - JNIEnv *env = nullptr; - if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) { - return JNI_FALSE; - } - // 加载指定java class - jclass classEvaluateUtil = env->FindClass(kClassMethodHookChar); - // 注册 - if (env->RegisterNatives(classEvaluateUtil, gMethods, sizeof(gMethods) / sizeof(gMethods[0])) < - 0) { - return JNI_FALSE; - } - // 获取 MethodHook m1、m2 的方法ID - methodHookClassInfo.m1 = env->GetStaticMethodID(classEvaluateUtil, "m1", "()V"); - methodHookClassInfo.m2 = env->GetStaticMethodID(classEvaluateUtil, "m2", "()V"); - // 获取artMethod的大小, - methodHookClassInfo.methodSize = reinterpret_cast(methodHookClassInfo.m2) - - reinterpret_cast(methodHookClassInfo.m1); - return JNI_VERSION_1_4; -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/HookManager.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/HookManager.java deleted file mode 100644 index 6dc15753b1..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/HookManager.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.mogo.module.common.hook; - - -import android.util.Pair; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * 替换管理 - * Created by donghongyu on 12/29/20 1:34 PM - */ -public final class HookManager { - - private HookManager() { - } - - public static HookManager get() { - return InstanceHolder.sInstance; - } - - private static class InstanceHolder { - private static HookManager sInstance = new HookManager(); - } - - private Map, MethodHook> methodHookMap = new ConcurrentHashMap<>(); - - /** - * 替换方法 - * - * @param originMethod 原始方法 - * @param hookMethod 替换方法 - */ - public void hookMethod(Method originMethod, Method hookMethod) { - if (originMethod == null || hookMethod == null) { - throw new IllegalArgumentException("argument cannot be null"); - } - - Pair key = Pair.create(hookMethod.getDeclaringClass().getName(), hookMethod.getName()); - if (methodHookMap.containsKey(key)) { - MethodHook methodHook = methodHookMap.get(key); - methodHook.restore(); - } - MethodHook methodHook = new MethodHook(originMethod, hookMethod); - methodHookMap.put(key, methodHook); - methodHook.hook(); - } - - public void callOrigin(Object receiver, Object... args) { - StackTraceElement stackTrace = Thread.currentThread().getStackTrace()[3]; - String className = stackTrace.getClassName(); - String methodName = stackTrace.getMethodName(); - MethodHook methodHook = methodHookMap.get(Pair.create(className, methodName)); - if (methodHook != null) { - try { - methodHook.callOrigin(receiver, args); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/MethodHook.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/MethodHook.java deleted file mode 100644 index 8586ac1adc..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/hook/MethodHook.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.mogo.module.common.hook; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * 替换类与c++代码对应 - * Created by donghongyu on 12/29/20 1:34 PM - */ -public class MethodHook { - - public static void m1() { - } - - public static void m2() { - } - - // 目标方法 - private Method srcMethod; - // 要替换的方法 - private Method hookMethod; - - // 备份目标替换方法ID - private long backupMethodPtr; - - /** - * hook方法 - * - * @param src 要替换的方法对象 - * @param dest 被替换的方法对象 - */ - public MethodHook(Method src, Method dest) { - srcMethod = src; - hookMethod = dest; - srcMethod.setAccessible(true); - hookMethod.setAccessible(true); - } - - /** - * 调用 native 层,完成替换 - */ - public void hook() { - if (backupMethodPtr == 0) { - backupMethodPtr = hook_native(srcMethod, hookMethod); - } - } - - /** - * 调用 native 层,完成方法还原 - */ - public void restore() { - if (backupMethodPtr != 0) { - restore_native(srcMethod, backupMethodPtr); - backupMethodPtr = 0; - } - } - - /** - * 调用原来class 对象中的方法 - * - * @param receiver 接受对象 - * @param args 方法列表 - * @throws InvocationTargetException - * @throws IllegalAccessException - */ - public void callOrigin(Object receiver, Object... args) - throws InvocationTargetException, IllegalAccessException { - if (backupMethodPtr != 0) { - restore(); - srcMethod.invoke(receiver, args); - hook(); - } else { - srcMethod.invoke(receiver, args); - } - } - - /** - * 调用 native 方法完成 方法替换 - * - * @param src 旧方法 - * @param dest 新方法 - * @return 就方法ID - */ - private static native long hook_native(Method src, Method dest); - - /** - * 调用 native 方法完成 方法还原 - * - * @param src - * @param methodPtr - * @return - */ - private static native Method restore_native(Method src, long methodPtr); - - static { - // 加载本地方法 so - System.loadLibrary("method-hook-lib"); - } - -} diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java index 42503d9055..98e6bef0a9 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java @@ -14,8 +14,8 @@ import androidx.fragment.app.Fragment; import com.alibaba.android.arouter.facade.annotation.Route; import com.amap.api.col.n3.lg; import com.amap.api.col.n3.lg2; +import com.mogo.hook.HookManager; import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.hook.HookManager; import com.mogo.module.common.wm.WindowManagerView; import com.mogo.service.MogoServicePaths; import com.mogo.service.map.IMogoSmallMapProvider; From e270366602a39452e50b988a2b5997177e1583e6 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 31 Dec 2020 17:13:24 +0800 Subject: [PATCH 14/28] 1. opt ui 2. opt MapMarkerBaseView --- .../module/common/drawer/marker/MapMarkerBaseView.java | 4 +++- .../src/main/res/layout/include_navi_in_vr.xml | 10 ++++++++-- .../res/layout/merge_vertical_traffic_light_in_vr.xml | 3 ++- .../src/main/res/values/dimens.xml | 9 ++++++--- .../main/java/com/zhidao/mogo/module/obu/MockUtil.kt | 2 +- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java index c3cbc4149e..f01929b1e5 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java @@ -90,7 +90,9 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV } private void loadPoiTypeIconInUiThread(String url,int res) { - + if (mMarker != null) { + mMarker.setIcon( ViewUtils.fromView(MapMarkerBaseView.this)); + } if (!url.isEmpty()) { ivIcon.setPlaceHolder(res); ivIcon.setFailureHolder(res); diff --git a/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml b/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml index 507d0730b8..7f0e64e2f8 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml @@ -29,6 +29,7 @@ android:id="@+id/module_ext_id_tv_speed" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/module_ext_navi_in_vr_nav_common_margin_top" android:layout_marginStart="@dimen/module_ext_navi_in_vr_speed_margin_start" android:text="--" android:textColor="#fff" @@ -53,6 +54,8 @@ android:id="@+id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode" android:layout_width="@dimen/module_ext_navi_in_vr_navi_icon_size" android:layout_height="@dimen/module_ext_navi_in_vr_navi_icon_size" + android:layout_marginTop="@dimen/module_ext_navi_in_vr_nav_common_margin_top" + android:layout_marginStart="@dimen/module_ext_navi_in_vr_limit_speed_margin_start" android:src="@drawable/tc_11" app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg" app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_traffic_bg" @@ -65,6 +68,7 @@ android:text="200" android:textColor="#f1f1f1" android:textSize="@dimen/module_ext_navi_in_vr_next_info_txt_size" + app:layout_constraintBottom_toTopOf="@id/module_map_id_navi_next_info_road_in_vr_mode" app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode" app:layout_constraintTop_toTopOf="@id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode" /> @@ -85,6 +89,7 @@ android:text="北三环东路辅路" android:textColor="#f1f1f1" android:textSize="@dimen/module_ext_navi_in_vr_next_info_road_txt_size" + app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode" app:layout_constraintLeft_toLeftOf="@id/module_map_id_navi_next_info_distance_in_vr_mode" app:layout_constraintTop_toBottomOf="@id/module_map_id_navi_next_info_distance_in_vr_mode" /> @@ -94,6 +99,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/module_ext_navi_in_vr_limit_speed_margin_end" + android:layout_marginTop="@dimen/module_ext_navi_in_vr_limit_speed_margin_top" android:background="@drawable/module_ext_vr_mode_limit_speed_bg" android:gravity="center" android:text="80" @@ -148,14 +154,14 @@ android:layout_height="wrap_content" app:constraint_referenced_ids="module_ext_id_tv_speed,module_ext_id_tv_speed_unit" android:visibility="gone" - tools:visibility="gone" /> + tools:visibility="visible" /> diff --git a/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml b/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml index 9c14f81fb8..4dacff9734 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml @@ -23,12 +23,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="12" + android:layout_marginTop="@dimen/module_ext_navi_in_vr_traffic_light_left_time_margin_top" android:textColor="#fff" app:layout_constraintHorizontal_chainStyle="packed" android:textSize="@dimen/module_ext_navi_in_vr_traffic_light_left_time_txt_size" app:layout_constraintLeft_toLeftOf="@id/module_ext_id_traffic_light_icon" app:layout_constraintRight_toLeftOf="@id/module_ext_id_traffic_light_left_time_unit" - app:layout_constraintTop_toBottomOf="@id/module_ext_id_traffic_light_icon" /> + app:layout_constraintTop_toTopOf="@id/module_ext_id_traffic_light_icon" /> 60px 100px 30px - 30px + 15px 70px 22px 78px 66px - 43px + 23px + 30px + 20px 40px 20px 17px 36px + 60px 21px - 21px + 11px 400px 300px diff --git a/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/MockUtil.kt b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/MockUtil.kt index b67be3a6fe..ff4743d73e 100644 --- a/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/MockUtil.kt +++ b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/MockUtil.kt @@ -45,7 +45,7 @@ class MockUtil:Handler.Callback { if (msg.what == 1001) { Logger.d(TAG,"准备添加调试view") val api = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context) as IMogoServiceApis - api.windowManagerApi.addView(view, 500, 300, false) + api.windowManagerApi.addView(view, 800, 300, false) } return false } From b84c1c1c06f6f8472b8e57f35ac2a743455efcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 31 Dec 2020 17:50:52 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E9=99=8D=E4=BD=8E=E4=BA=86=E5=B0=8F?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=A7=86=E8=A7=92=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/small/map/SmallMapDirectionView.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java index dec53d8d38..237cb22f81 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java @@ -37,6 +37,7 @@ public class SmallMapDirectionView extends RelativeLayout { private AMapNaviView mAMapNaviView; private DirectionRotateAnimation mRotateAnimation; private int lastAngle = 0; + private int zoomLevel = 17; public SmallMapDirectionView(Context context) { this(context, null); @@ -133,19 +134,19 @@ public class SmallMapDirectionView extends RelativeLayout { options.setNaviArrowVisible(false); // 通过路线是否自动置灰,仅支持驾车导航 options.setAfterRouteAutoGray(false); - options.setZoom(((int) 9)); + //options.setZoom(((int) 9)); //options.setPointToCenter(0.7D, 0.5D); // 2D模式 options.setTilt(0); // 黑夜模式 -// options.setNaviNight(true); + // options.setNaviNight(true); // 自定义地图样式 options.setCustomMapStylePath(styleFilePath); mAMapNaviView.setViewOptions(options); } //设置希望展示的地图缩放级别 - CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12); + CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); aMap.moveCamera(cameraUpdate); aMap.setOnCameraChangeListener(new AMap.OnCameraChangeListener() { @@ -175,7 +176,7 @@ public class SmallMapDirectionView extends RelativeLayout { } //设置希望展示的地图缩放级别 - CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12); + CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); aMap.moveCamera(cameraUpdate); } }); @@ -218,7 +219,7 @@ public class SmallMapDirectionView extends RelativeLayout { } //设置希望展示的地图缩放级别 - CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12); + CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); aMap.moveCamera(cameraUpdate); } } From 52c96e68732e977d0bb3f651c0a196ea2b7058ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 31 Dec 2020 18:17:48 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E9=99=8D=E4=BD=8E=E4=BA=86=E5=B0=8F?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=A7=86=E8=A7=92=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/module/small/map/SmallMapDirectionView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java index 237cb22f81..64e56eb087 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java @@ -37,7 +37,7 @@ public class SmallMapDirectionView extends RelativeLayout { private AMapNaviView mAMapNaviView; private DirectionRotateAnimation mRotateAnimation; private int lastAngle = 0; - private int zoomLevel = 17; + private int zoomLevel = 15; public SmallMapDirectionView(Context context) { this(context, null); From 4fc4f39c41393fc84bb016208adc9f0e9f422c2c Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 31 Dec 2020 18:22:33 +0800 Subject: [PATCH 17/28] opt topview in vr mode --- .idea/gradle.xml | 1 + .../com/mogo/module/extensions/utils/TopViewAnimHelper.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 426ff6b360..8efbfa420e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -85,6 +85,7 @@ diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java index ad8f008f79..5871641bde 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java @@ -389,6 +389,7 @@ public class TopViewAnimHelper { } Logger.d("TopViewAnimHelper", "hideNaviView====="); + animNavInfoView.setTranslationY(0); animNavInfoView.setVisibility(View.GONE); vrModeNavInfoView.stopNav(); int scene = 0; @@ -441,6 +442,7 @@ public class TopViewAnimHelper { listener.onViewRemoved(child); } } + topContainer.setTranslationY(0); topContainer.removeAllViews(); hideNaviView(); MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS); From 5c005e6db9d1ff69df3a6b5a2538c4e1abb15235 Mon Sep 17 00:00:00 2001 From: liujing Date: Thu, 31 Dec 2020 19:10:23 +0800 Subject: [PATCH 18/28] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scene/road/V2XRoadVideoCarScenario.java | 2 +- .../src/main/res/layout/window_test_console.xml | 14 -------------- .../src/main/res/values-xhdpi/dimens.xml | 4 ---- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoCarScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoCarScenario.java index 853faca1d0..def8a1c7ac 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoCarScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoCarScenario.java @@ -59,7 +59,7 @@ public class V2XRoadVideoCarScenario extends AbsV2XScenario new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, (int) V2XUtils.getApp().getResources() - .getDimension(R.dimen.v2x_video_window_height)); + .getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode()? R.dimen.dp_394:R.dimen.v2x_video_window_height)); V2XServiceManager .getMogoTopViewManager() .addViewNoLinkage(getV2XWindow().getView(), layoutParams, this); diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml b/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml index a7876cce9d..80497ce2ef 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml @@ -140,20 +140,6 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" /> -