diff --git a/.idea/misc.xml b/.idea/misc.xml index 707ee6e613..2dc54c489f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index a4df10bbff..e90b27d6bf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode - versionName "${rootProject.ext.android.versionName}_${getCurrentDate()}_${getGitCommit()}" + versionName "${rootProject.ext.android.versionName}" applicationId rootProject.ext.android.applicationId testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/libraries/map-amap/build.gradle b/libraries/map-amap/build.gradle index 5b36711ec6..555ca0b60e 100644 --- a/libraries/map-amap/build.gradle +++ b/libraries/map-amap/build.gradle @@ -20,6 +20,11 @@ android { } } + compileOptions { + sourceCompatibility 1.8 + targetCompatibility 1.8 + } + } dependencies { diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java index 90adca4adb..b163ede5f4 100644 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java +++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java @@ -82,7 +82,7 @@ public class AMapNaviViewWrapper implements IMogoMapView, this.mMapView = mapView; this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView, this ); try { - new BnHooker( mMapView.getMap() ); + new BnHooker( mMapView.getMap(), mapView.getContext() ); } catch ( Exception e ) { e.printStackTrace(); } diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java index d40ead278a..06edf1be18 100644 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java +++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java @@ -1,9 +1,12 @@ package com.mogo.map.impl.amap.hook; +import android.content.Context; + import com.amap.api.maps.AMap; import com.autonavi.amap.mapcore.interfaces.IAMap; import com.autonavi.base.amap.api.mapcore.IAMapDelegate; import com.autonavi.base.amap.mapcore.interfaces.IAMapListener; +import com.mogo.map.impl.amap.navi.NaviClient; import com.mogo.utils.logger.Logger; import java.lang.reflect.Field; @@ -20,11 +23,13 @@ import java.lang.reflect.Proxy; public class BnHooker implements InvocationHandler { private static final String TAG = "BnHooker"; + private final Context mContext; private Object host; - public BnHooker( AMap map ) throws Exception { + public BnHooker( AMap map, Context context ) throws Exception { + mContext = context; if ( map == null ) { return; @@ -48,7 +53,9 @@ public class BnHooker implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { if ( method.getName().equals( "setRenderFps" ) ) { - return method.invoke( host, 10 ); + if ( !NaviClient.getInstance( mContext ).isNaviing() ) { + return method.invoke( host, 10 ); + } } if ( method.getName().equals( "drawFrame" ) ) { Logger.d( TAG, "drawFrame" ); diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java index 845e751f23..bf95e060c4 100644 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java +++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java @@ -24,6 +24,7 @@ import com.mogo.map.navi.MogoCalculatePath; import com.mogo.map.navi.MogoNaviListenerHandler; import com.mogo.map.navi.MogoTraffic; import com.mogo.map.navi.OnCalculatePathItemClickInteraction; +import com.mogo.utils.UiThreadHandler; import com.mogo.utils.logger.Logger; import java.util.List; @@ -91,7 +92,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter { @Override public void onInitNaviSuccess() { MogoNaviListenerHandler.getInstance().onInitNaviSuccess(); - mAMapNavi.startAimlessMode(AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED); + mAMapNavi.startAimlessMode( AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED ); } @Override @@ -168,12 +169,21 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter { @Override public void onEndEmulatorNavi() { - stopNavi(); + stopNaviDelay(); } @Override public void onArriveDestination() { - stopNavi(); + stopNaviDelay(); + } + + /** + * 避免导航结束语音播报被立刻打断的情况 + */ + private void stopNaviDelay() { + UiThreadHandler.postDelayed( () -> { + stopNavi(); + }, 5_000L ); } @Override @@ -236,7 +246,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter { return null; } - public List getCalculatedPathPos() { + public List< MogoLatLng > getCalculatedPathPos() { if ( mNaviOverlayHelper != null ) { return mNaviOverlayHelper.getCalculatedPathPos(); } @@ -244,8 +254,6 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter { } - - public OnCalculatePathItemClickInteraction getItemClickInteraction() { if ( mNaviOverlayHelper != null ) { return mNaviOverlayHelper.getItemClickInteraction(); diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_default_user_head.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_default_user_head.png new file mode 100644 index 0000000000..a1349fc088 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_default_user_head.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue.png new file mode 100755 index 0000000000..53a17783bb Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue_dark.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue_dark.png new file mode 100755 index 0000000000..674ef02f31 Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue_dark.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green.png new file mode 100755 index 0000000000..b848a42232 Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green_dark.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green_dark.png new file mode 100644 index 0000000000..0feaf8ae71 Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green_dark.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_oragne.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_oragne.png new file mode 100755 index 0000000000..c9c886a543 Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_oragne.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_purple.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_purple.png new file mode 100755 index 0000000000..a1c6408a30 Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_purple.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_red.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_red.png new file mode 100644 index 0000000000..994e8b92c4 Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_red.png differ