opt
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -20,6 +20,11 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility 1.8
|
||||
targetCompatibility 1.8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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" );
|
||||
|
||||
@@ -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<MogoLatLng> 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();
|
||||
|
||||
|
After Width: | Height: | Size: 6.8 KiB |
BIN
modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_blue.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
BIN
modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_green.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
BIN
modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_oragne.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
modules/mogo-module-service/src/main/res/drawable-ldpi/bg_map_marker_purple.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |