diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 3aa58b6658..2c9f3703ae 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -24,6 +24,9 @@
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 69a11edf58..602717b7c6 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -172,6 +172,8 @@ dependencies {
implementation rootProject.ext.dependencies.mogomoduleback
implementation rootProject.ext.dependencies.mogomoduleguide
implementation rootProject.ext.dependencies.mogomoduleauth
+ debugImplementation rootProject.ext.dependencies.gpssimulatordebug
+ releaseImplementation rootProject.ext.dependencies.gpssimulatornoop
} else {
implementation project(':modules:mogo-module-main')
implementation project(':foudations:mogo-commons')
@@ -180,6 +182,8 @@ dependencies {
implementation project(':modules:mogo-module-back')
implementation project(':modules:mogo-module-guide')
implementation project(':modules:mogo-module-authorize')
+ debugImplementation project(':modules:mogo-module-gps-simulator-debug')
+ releaseImplementation project(':modules:mogo-module-gps-simulator-noop')
}
}
diff --git a/config.gradle b/config.gradle
index cc4b9526a3..1d47272fe2 100644
--- a/config.gradle
+++ b/config.gradle
@@ -6,7 +6,7 @@ ext {
buildToolsVersion : "29.0.2",
minSdkVersion : 19,
targetSdkVersion : 22,
- versionName : "8.0.4",
+ versionName : "8.0.4",
]
dependencies = [
@@ -136,5 +136,10 @@ ext {
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1",
aspectj : "org.aspectj:aspectjrt:1.8.9",
+
+ // gps 模拟
+ gpssimulator : "com.mogo.module:module-gps-simulator:${MOGO_MODULE_GPS_SIMULATOR_VERSION}",
+ gpssimulatordebug : "com.mogo.module:mogo-module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
+ gpssimulatornoop : "com.mogo.module:mogo-module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
]
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 9d82fb2ce4..a1710e93d7 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -45,6 +45,10 @@ MOGO_MODULE_SERVICE_VERSION=1.0.3.1
MOGO_MODULE_EXTENSIONS_VERSION=1.0.3.1
MOGO_MODULE_SEARCH_VERSION=1.0.3.1
MOGO_MODULE_BACK_VERSION=1.0.3.1
+MOGO_MODULE_GPS_SIMULATOR_VERSION=1.0.3.1
+MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.0.3.1
+MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.0.3.1
+
MOGO_MODULE_AUTHORIZE_VERSION=1.0.0
MOGO_MODULE_GUIDE_VERSION=1.0.0
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 cd3c9e8f0c..5a52bb6726 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,8 +82,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
private AMapMarkerClickHandler mMarkerClickHandler;
private EnumMapUI mCurrentUIMode;
- // 自定义定位源的回调信息,前瞻线
- private LocationSource.OnLocationChangedListener mOnLocationChangedListener;
private boolean mIsCarLocked = false;
private float mDefaultZoomLevel = 16.0f;
@@ -212,7 +210,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
initMapView();
initListeners();
initMyLocation();
-// initLocationSource();
}
}
@@ -554,21 +551,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
style.strokeWidth( 0 );
style.radiusFillColor( Color.TRANSPARENT );
mMapView.getMap().setMyLocationStyle( style );
- }
- }
-
- private void initLocationSource() {
- if ( checkAMapView() ) {
- mMapView.getMap().setLocationSource( new LocationSource() {
- @Override
- public void activate( OnLocationChangedListener onLocationChangedListener ) {
- AMapNaviViewWrapper.this.mOnLocationChangedListener = onLocationChangedListener;
- }
-
- @Override
- public void deactivate() {
-
- }
+ mMapView.getMap().setOnMyLocationChangeListener( location -> {
+ Logger.d( TAG, "%s", location );
} );
}
}
@@ -835,9 +819,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
@Override
public void changeMyLocation( Location location ) {
- if ( mOnLocationChangedListener != null ) {
- mOnLocationChangedListener.onLocationChanged( location );
- }
}
@Override
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java
index ea5dd63b88..1a9f774e16 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java
@@ -4,12 +4,14 @@ import android.content.Context;
import android.graphics.Rect;
import android.location.Location;
+import com.amap.api.maps.LocationSource;
import com.amap.api.maps.model.Polyline;
import com.amap.api.navi.AMapNavi;
import com.amap.api.navi.enums.AimLessMode;
import com.amap.api.navi.enums.NaviType;
import com.amap.api.navi.model.NaviLatLng;
import com.mogo.map.MogoLatLng;
+import com.mogo.map.impl.amap.AMapWrapper;
import com.mogo.map.impl.amap.message.AMapMessageManager;
import com.mogo.map.impl.amap.utils.ObjectUtils;
import com.mogo.map.navi.IMogoCarLocationChangedListener;
@@ -51,6 +53,7 @@ public class NaviClient implements IMogoNavi {
private Location mCarLocation;
private IMogoCarLocationChangedListener mCarLocationChangedListener;
+ private LocationSource.OnLocationChangedListener mOnLocationChangedListener;
private NaviClient( Context context ) {
mAMapNavi = AMapNavi.getInstance( context );
@@ -289,4 +292,45 @@ public class NaviClient implements IMogoNavi {
mAMapNaviListener.displayOverview();
}
}
+
+ @Override
+ public void setUseExtraGPSData( boolean use ) {
+ Logger.d( TAG, "设置外部gps源状态 %s", use );
+ mAMapNavi.setIsUseExtraGPSData( use );
+ if ( use ) {
+ AMapWrapper.getAMap().setLocationSource( new LocationSource() {
+ @Override
+ public void activate( OnLocationChangedListener onLocationChangedListener ) {
+ NaviClient.this.mOnLocationChangedListener = onLocationChangedListener;
+ }
+
+ @Override
+ public void deactivate() {
+ }
+ } );
+ } else {
+ AMapWrapper.getAMap().setLocationSource( null );
+ mOnLocationChangedListener = null;
+ }
+ }
+
+ @Override
+ public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
+ if ( !mAMapNavi.getIsUseExtraGPSData() ) {
+ Logger.d( TAG, "拒绝外部GPS数据" );
+ return;
+ }
+ Location location = new Location( "外部GPS源" );
+ location.setLongitude( lon );
+ location.setLatitude( lat );
+ location.setSpeed( speed );
+ location.setAccuracy( accuracy );
+ location.setBearing( bearing );
+ location.setTime( timestamp );
+ //type字段传1时代表WGS84坐标
+ mAMapNavi.setExtraGPSData( 2, location );
+ if ( mOnLocationChangedListener != null ) {
+ mOnLocationChangedListener.onLocationChanged( location );
+ }
+ }
}
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java
index 1b5561d217..4a780f8b61 100644
--- a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java
@@ -1,8 +1,10 @@
package com.mogo.map.navi;
import android.graphics.Rect;
+import android.location.Location;
import com.mogo.map.MogoLatLng;
+import com.mogo.map.location.MogoLocation;
import java.util.List;
@@ -163,4 +165,16 @@ public interface IMogoNavi {
* 查看全程
*/
void displayOverview();
+
+ /**
+ * 设置使用外部定位源
+ *
+ * @param use true - 使用,false - 不适用
+ */
+ void setUseExtraGPSData( boolean use );
+
+ /**
+ * 设置外部数据源
+ */
+ void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp );
}
diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java
index 72feccfefd..b3d7c0c75c 100644
--- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java
+++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java
@@ -2,6 +2,7 @@ package com.mogo.map;
import android.content.Context;
import android.graphics.Rect;
+import android.location.Location;
import com.mogo.map.impl.amap.navi.NaviClient;
import com.mogo.map.navi.IMogoCarLocationChangedListener;
@@ -201,4 +202,18 @@ public class MogoNavi implements IMogoNavi {
mDelegate.displayOverview();
}
}
+
+ @Override
+ public void setUseExtraGPSData( boolean use ) {
+ if ( mDelegate != null ) {
+ mDelegate.setUseExtraGPSData( use );
+ }
+ }
+
+ @Override
+ public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
+ if ( mDelegate != null ) {
+ mDelegate.setExtraGPSData( lon, lat, speed, accuracy, bearing, timestamp );
+ }
+ }
}
diff --git a/modules/mogo-module-gps-simulator-debug/.gitignore b/modules/mogo-module-gps-simulator-debug/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/modules/mogo-module-gps-simulator-debug/build.gradle b/modules/mogo-module-gps-simulator-debug/build.gradle
new file mode 100644
index 0000000000..2382df5823
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/build.gradle
@@ -0,0 +1,53 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ // buildToolsVersion rootProject.ext.android.buildToolsVersion
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+ versionCode Integer.valueOf(VERSION_CODE)
+ versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
+
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = [AROUTER_MODULE_NAME: project.getName()]
+ }
+ }
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles 'consumer-rules.pro'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ targetCompatibility 1.8
+ sourceCompatibility 1.8
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation rootProject.ext.dependencies.arouter
+ annotationProcessor rootProject.ext.dependencies.aroutercompiler
+ implementation "org.java-websocket:Java-WebSocket:1.4.0"
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.mogocommons
+ implementation rootProject.ext.dependencies.gpssimulator
+ implementation rootProject.ext.dependencies.mogoserviceapi
+ } else {
+ implementation project(':foudations:mogo-utils')
+ implementation project(":foudations:mogo-commons")
+ implementation project(':modules:mogo-module-gps-simulator')
+ implementation project(':services:mogo-service-api')
+ }
+}
diff --git a/modules/mogo-module-gps-simulator-debug/consumer-rules.pro b/modules/mogo-module-gps-simulator-debug/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/modules/mogo-module-gps-simulator-debug/gradle.properties b/modules/mogo-module-gps-simulator-debug/gradle.properties
new file mode 100644
index 0000000000..cbfd2771ac
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-gps-simulator-debug
+VERSION_CODE=1
diff --git a/modules/mogo-module-gps-simulator-debug/proguard-rules.pro b/modules/mogo-module-gps-simulator-debug/proguard-rules.pro
new file mode 100644
index 0000000000..f1b424510d
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml b/modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..6c73c51a7e
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java
new file mode 100644
index 0000000000..b30af88de6
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/CationVo.java
@@ -0,0 +1,134 @@
+package com.mogo.module.gps.simulator;
+
+
+/**
+ * @author zyz
+ * 2020-04-08.
+ */
+public class CationVo {
+
+ /**
+ * vehicleSpeed : 1.0
+ * instantSpeed : 1.0
+ * lon : 116.401615
+ * lat : 39.968812
+ * carStatus : 1
+ * direction : 267
+ * sn : ZD801C1928L00371
+ * locationTime : 1586339911534
+ * distance : 0.0
+ * adCode : 2
+ * cityCode : 3
+ * vehicleType : 0
+ */
+
+ private float vehicleSpeed;
+ private double instantSpeed;
+ private double lon;
+ private double lat;
+ private int carStatus;
+ private int direction;
+ private String sn;
+ private long locationTime;
+ private double distance;
+ private String adCode;
+ private String cityCode;
+ private int vehicleType;
+
+ public float getVehicleSpeed() {
+ return vehicleSpeed;
+ }
+
+ public void setVehicleSpeed( float vehicleSpeed ) {
+ this.vehicleSpeed = vehicleSpeed;
+ }
+
+ public double getInstantSpeed() {
+ return instantSpeed;
+ }
+
+ public void setInstantSpeed( double instantSpeed ) {
+ this.instantSpeed = instantSpeed;
+ }
+
+ public double getLon() {
+ return lon;
+ }
+
+ public void setLon( double lon ) {
+ this.lon = lon;
+ }
+
+ public double getLat() {
+ return lat;
+ }
+
+ public void setLat( double lat ) {
+ this.lat = lat;
+ }
+
+ public int getCarStatus() {
+ return carStatus;
+ }
+
+ public void setCarStatus( int carStatus ) {
+ this.carStatus = carStatus;
+ }
+
+ public int getDirection() {
+ return direction;
+ }
+
+ public void setDirection( int direction ) {
+ this.direction = direction;
+ }
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn( String sn ) {
+ this.sn = sn;
+ }
+
+ public long getLocationTime() {
+ return locationTime;
+ }
+
+ public void setLocationTime( long locationTime ) {
+ this.locationTime = locationTime;
+ }
+
+ public double getDistance() {
+ return distance;
+ }
+
+ public void setDistance( double distance ) {
+ this.distance = distance;
+ }
+
+ public String getAdCode() {
+ return adCode;
+ }
+
+ public void setAdCode( String adCode ) {
+ this.adCode = adCode;
+ }
+
+ public String getCityCode() {
+ return cityCode;
+ }
+
+ public void setCityCode( String cityCode ) {
+ this.cityCode = cityCode;
+ }
+
+ public int getVehicleType() {
+ return vehicleType;
+ }
+
+ public void setVehicleType( int vehicleType ) {
+ this.vehicleType = vehicleType;
+ }
+
+}
diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java
new file mode 100644
index 0000000000..f193bbfd7d
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/JWebSocketClient.java
@@ -0,0 +1,47 @@
+package com.mogo.module.gps.simulator;
+
+import com.mogo.utils.logger.Logger;
+
+import org.java_websocket.client.WebSocketClient;
+import org.java_websocket.drafts.Draft_6455;
+import org.java_websocket.handshake.ServerHandshake;
+
+import java.net.URI;
+
+/**
+ * @author zyz
+ * 2020-04-07.
+ */
+public class JWebSocketClient extends WebSocketClient {
+
+ public JWebSocketClient( URI serverUri ) {
+ super( serverUri, new Draft_6455() );
+ }
+
+ @Override
+ public void onOpen( ServerHandshake handshakedata ) {
+ Logger.e( "JWebSocketClient", "onOpen()" );
+ bindSN();
+ }
+
+ private void bindSN() {
+ String data = String.format( "{ \"sn\": \"%s\", \"bind\": true }", Utils.getSn() );
+ send( data );
+ }
+
+ @Override
+ public void onMessage( String message ) {
+ Logger.e( "JWebSocketClient", "onMessage()" );
+ }
+
+ @Override
+ public void onClose( int code, String reason, boolean remote ) {
+ Logger.e( "JWebSocketClient", "onClose()" );
+ }
+
+ @Override
+ public void onError( Exception ex ) {
+ Logger.e( "JWebSocketClient", "onError()" );
+ ex.printStackTrace();
+ }
+}
diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java
new file mode 100644
index 0000000000..5bc0d32a02
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerDebug.java
@@ -0,0 +1,33 @@
+package com.mogo.module.gps.simulator;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+
+
+/**
+ * @author congtaowang
+ * @since 2020-04-13
+ *
+ * 描述
+ */
+@Route( path = GpsSimulatorConstants.API_PATH )
+public class MogoGpsSimulatorManagerDebug implements IMogoGpsSimulatorManager {
+
+ private static final String TAG = "MogoGpsSimulatorManagerDebug";
+
+ @Override
+ public void open() {
+ WebSocketManager.getInstance().connect( true );
+ }
+
+ @Override
+ public void close() {
+ WebSocketManager.getInstance().disConnect();
+ }
+
+ @Override
+ public void init( Context context ) {
+
+ }
+}
diff --git a/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java
new file mode 100644
index 0000000000..4978caa21e
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/Utils.java
@@ -0,0 +1,43 @@
+package com.mogo.module.gps.simulator;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Created by congtaowang on 2018/3/29.
+ */
+
+class Utils {
+
+ public static final String GET = "get";
+ public static final String GSM_SERIAL = "gsm.serial";
+ public static final String FOTA_VERSION = "ro.fota.version";
+ public static final String PROPERTIES = "android.os.SystemProperties";
+
+ public static String getSn() {
+ return getSystemProperties( GSM_SERIAL );
+ }
+
+ public static String getFotaVersion() {
+ return getSystemProperties( FOTA_VERSION );
+ }
+
+ public static String getSystemProperties( String name ) {
+ String value = "";
+
+ try {
+ Class< ? > c = Class.forName( PROPERTIES );
+ Method get = c.getMethod( GET, String.class );
+ value = ( String ) get.invoke( c, name );
+ } catch ( ClassNotFoundException var3 ) {
+ var3.printStackTrace();
+ } catch ( NoSuchMethodException var4 ) {
+ var4.printStackTrace();
+ } catch ( InvocationTargetException var5 ) {
+ var5.printStackTrace();
+ } catch ( IllegalAccessException var6 ) {
+ var6.printStackTrace();
+ }
+ return value;
+ }
+}
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
new file mode 100644
index 0000000000..13e4baaa30
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/java/com/mogo/module/gps/simulator/WebSocketManager.java
@@ -0,0 +1,122 @@
+package com.mogo.module.gps.simulator;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.commons.AbsMogoApplication;
+import com.mogo.map.navi.IMogoNavi;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import org.json.JSONObject;
+
+import java.net.URI;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * @author zyz
+ * 2020-04-07.
+ */
+public class WebSocketManager {
+
+ private static final String TAG = "WebSocketManager";
+
+ private static Object sLock = new Object();
+ private static WebSocketManager sWebSocketManager;
+
+ private IMogoNavi mNavi;
+ private JWebSocketClient mClient;
+ private URI mUri;
+
+ private ExecutorService mService = Executors.newSingleThreadExecutor();
+
+ public static WebSocketManager getInstance() {
+ if ( sWebSocketManager == null ) {
+ synchronized ( sLock ) {
+ if ( sWebSocketManager == null ) {
+ sWebSocketManager = new WebSocketManager();
+ }
+ }
+ }
+ return sWebSocketManager;
+ }
+
+ private WebSocketManager() {
+ final IMogoServiceApis mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
+ mNavi = mServiceApis.getMapServiceApi().getNavi( AbsMogoApplication.getApp() );
+ mUri = URI.create( "ws://152.136.10.223:4001/realtimeLocations-ws" );
+ mClient = new JWebSocketClient( mUri ) {
+ @Override
+ public void onMessage( String message ) {
+ try {
+ parseMessage( message );
+ } catch ( Exception e ) {
+ Logger.e( TAG, e, "error." );
+ }
+ }
+ };
+ }
+
+ private void parseMessage( String jsonStr ) throws Exception {
+ //message就是接收到的消息
+ Logger.d( TAG, jsonStr );
+ JSONObject jsonObject = new JSONObject( jsonStr );
+ if ( jsonObject.has( "detailMsg" ) ) {
+ Logger.d( TAG, "绑定成功" );
+ } else if ( jsonObject.has( "realTimeLocationVo" ) ) {
+ Logger.d( TAG, "收到定位消息" );
+ CationVo realTimeLocationVo = GsonUtil.objectFromJson( jsonObject.getString( "realTimeLocationVo" ), CationVo.class );
+ mNavi.setExtraGPSData(
+ realTimeLocationVo.getLon(),
+ realTimeLocationVo.getLat(),
+ realTimeLocationVo.getVehicleSpeed(),
+ 1,
+ realTimeLocationVo.getDirection(),
+ realTimeLocationVo.getLocationTime()
+ );
+ }
+ }
+
+ public void connect( final boolean block ) {
+ if ( mClient == null ) {
+ return;
+ }
+ if ( mClient.isOpen() ) {
+ return;
+ }
+ mService.execute( () -> {
+ if ( block ) {
+ try {
+ if ( mClient.isClosed() ) {
+ mClient.reconnectBlocking();
+ } else {
+ mClient.connectBlocking();
+ }
+ } catch ( InterruptedException e ) {
+ Logger.e( TAG, e, "error." );
+ }
+ } else {
+ if ( mClient.isClosed() ) {
+ mClient.reconnect();
+ } else {
+ mClient.connect();
+ }
+ }
+ } );
+ }
+
+ public void disConnect() {
+ if ( mClient == null ) {
+ return;
+ }
+ if ( mClient.isClosing() || mClient.isClosed() || !mClient.isOpen() ) {
+ return;
+ }
+ try {
+ mService.execute( () -> { mClient.close(); } );
+ } catch ( Exception e ) {
+ Logger.e( TAG, e, "error." );
+ }
+ }
+}
diff --git a/modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml b/modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..9d884d77ea
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ mogo-module-gps-simulator
+
diff --git a/modules/mogo-module-gps-simulator-noop/.gitignore b/modules/mogo-module-gps-simulator-noop/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/modules/mogo-module-gps-simulator-noop/build.gradle b/modules/mogo-module-gps-simulator-noop/build.gradle
new file mode 100644
index 0000000000..7427dc421a
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/build.gradle
@@ -0,0 +1,48 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ // buildToolsVersion rootProject.ext.android.buildToolsVersion
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+ versionCode Integer.valueOf(VERSION_CODE)
+ versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
+
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = [AROUTER_MODULE_NAME: project.getName()]
+ }
+ }
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles 'consumer-rules.pro'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ targetCompatibility 1.8
+ sourceCompatibility 1.8
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation rootProject.ext.dependencies.arouter
+ annotationProcessor rootProject.ext.dependencies.aroutercompiler
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.gpssimulator
+ } else {
+ implementation project(':foudations:mogo-utils')
+ implementation project(':modules:mogo-module-gps-simulator')
+ }
+}
diff --git a/modules/mogo-module-gps-simulator-noop/consumer-rules.pro b/modules/mogo-module-gps-simulator-noop/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/modules/mogo-module-gps-simulator-noop/gradle.properties b/modules/mogo-module-gps-simulator-noop/gradle.properties
new file mode 100644
index 0000000000..20578a681b
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-gps-simulator-noop
+VERSION_CODE=1
diff --git a/modules/mogo-module-gps-simulator-noop/proguard-rules.pro b/modules/mogo-module-gps-simulator-noop/proguard-rules.pro
new file mode 100644
index 0000000000..f1b424510d
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml b/modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..3cea50c50c
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java b/modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java
new file mode 100644
index 0000000000..9a2478f9c4
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/src/main/java/com/mogo/module/gps/simulator/MogoGpsSimulatorManagerNoop.java
@@ -0,0 +1,32 @@
+package com.mogo.module.gps.simulator;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.mogo.utils.logger.Logger;
+
+/**
+ * @author congtaowang
+ * @since 2020-04-13
+ *
+ * 描述
+ */
+@Route( path = GpsSimulatorConstants.API_PATH )
+public class MogoGpsSimulatorManagerNoop implements IMogoGpsSimulatorManager {
+
+ private static final String TAG = "MogoGpsSimulatorManagerNoop";
+
+ @Override
+ public void open() {
+ Logger.e( TAG, "no operation when release." );
+ }
+
+ @Override
+ public void close() {
+ Logger.e( TAG, "no operation when release." );
+ }
+
+ @Override
+ public void init( Context context ) {
+ }
+}
diff --git a/modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml b/modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..9d884d77ea
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ mogo-module-gps-simulator
+
diff --git a/modules/mogo-module-gps-simulator/.gitignore b/modules/mogo-module-gps-simulator/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/modules/mogo-module-gps-simulator/build.gradle b/modules/mogo-module-gps-simulator/build.gradle
new file mode 100644
index 0000000000..b3a5b2a6a6
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/build.gradle
@@ -0,0 +1,39 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ // buildToolsVersion rootProject.ext.android.buildToolsVersion
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+ versionCode Integer.valueOf(VERSION_CODE)
+ versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
+
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles 'consumer-rules.pro'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ targetCompatibility 1.8
+ sourceCompatibility 1.8
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation rootProject.ext.dependencies.arouter
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.mogomoduleauth
+ } else {
+ implementation project(':modules:mogo-module-authorize')
+ }
+}
diff --git a/modules/mogo-module-gps-simulator/consumer-rules.pro b/modules/mogo-module-gps-simulator/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/modules/mogo-module-gps-simulator/gradle.properties b/modules/mogo-module-gps-simulator/gradle.properties
new file mode 100644
index 0000000000..44f440bc58
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-gps-simulator
+VERSION_CODE=1
diff --git a/modules/mogo-module-gps-simulator/proguard-rules.pro b/modules/mogo-module-gps-simulator/proguard-rules.pro
new file mode 100644
index 0000000000..f1b424510d
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml b/modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..dc9013c712
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java b/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java
new file mode 100644
index 0000000000..dc87986716
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/GpsSimulatorConstants.java
@@ -0,0 +1,12 @@
+package com.mogo.module.gps.simulator;
+
+/**
+ * @author congtaowang
+ * @since 2020-04-13
+ *
+ * 描述
+ */
+public class GpsSimulatorConstants {
+
+ public static final String API_PATH = "/gpssimulator/api";
+}
diff --git a/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java b/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java
new file mode 100644
index 0000000000..aa3bdfff17
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/src/main/java/com/mogo/module/gps/simulator/IMogoGpsSimulatorManager.java
@@ -0,0 +1,22 @@
+package com.mogo.module.gps.simulator;
+
+import com.alibaba.android.arouter.facade.template.IProvider;
+
+/**
+ * @author congtaowang
+ * @since 2020-04-13
+ *
+ * gps 模拟控制开关
+ */
+public interface IMogoGpsSimulatorManager extends IProvider {
+
+ /**
+ * 打开 gps 模拟
+ */
+ void open();
+
+ /**
+ * 关闭 gps 模拟
+ */
+ void close();
+}
diff --git a/modules/mogo-module-gps-simulator/src/main/res/values/strings.xml b/modules/mogo-module-gps-simulator/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..9d884d77ea
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ mogo-module-gps-simulator
+
diff --git a/modules/mogo-module-search/build.gradle b/modules/mogo-module-search/build.gradle
index c4cd7396dc..e2733a4fa9 100644
--- a/modules/mogo-module-search/build.gradle
+++ b/modules/mogo-module-search/build.gradle
@@ -3,80 +3,72 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
- compileSdkVersion rootProject.ext.android.compileSdkVersion
- // buildToolsVersion rootProject.ext.android.buildToolsVersion
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ // buildToolsVersion rootProject.ext.android.buildToolsVersion
- defaultConfig {
- minSdkVersion rootProject.ext.android.minSdkVersion
- targetSdkVersion rootProject.ext.android.targetSdkVersion
- versionCode Integer.valueOf(VERSION_CODE)
- versionName getValueFromRootProperties(
- "${project.name.replace("-", "_").toUpperCase()}_VERSION")
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+ versionCode Integer.valueOf(VERSION_CODE)
+ versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles 'consumer-rules.pro'
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles 'consumer-rules.pro'
- kapt {
- useBuildCache = false
- arguments {
- arg("AROUTER_MODULE_NAME", project.getName())
- }
+ kapt {
+ useBuildCache = false
+ arguments {
+ arg("AROUTER_MODULE_NAME", project.getName())
+ }
+ }
}
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
}
- }
}
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation rootProject.ext.dependencies.androidxappcompat
- implementation rootProject.ext.dependencies.androidxconstraintlayout
- implementation rootProject.ext.dependencies.arouter
- implementation rootProject.ext.dependencies.room
- kapt rootProject.ext.dependencies.roomAnnotationProcessor
- implementation rootProject.ext.dependencies.roomRxjava
- implementation rootProject.ext.dependencies.androidxrecyclerview
- implementation rootProject.ext.dependencies.androidxcardview
- kapt rootProject.ext.dependencies.aroutercompiler
-// implementation rootProject.ext.dependencies.jetbrainsannotationsjava5
- implementation rootProject.ext.dependencies.rxandroid
- // api project(path: ':modules:mogo-module-common')
- // api project(path: ':foudations:mogo-utils')
- // api project(path: ':modules:mogo-module-map')
- implementation rootProject.ext.dependencies.guideshowprovider
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.androidxconstraintlayout
+ implementation rootProject.ext.dependencies.arouter
+ implementation rootProject.ext.dependencies.room
+ kapt rootProject.ext.dependencies.roomAnnotationProcessor
+ implementation rootProject.ext.dependencies.roomRxjava
+ implementation rootProject.ext.dependencies.androidxrecyclerview
+ implementation rootProject.ext.dependencies.androidxcardview
+ kapt rootProject.ext.dependencies.aroutercompiler
+ implementation rootProject.ext.dependencies.rxandroid
+ implementation rootProject.ext.dependencies.guideshowprovider
- if (Boolean.valueOf(RELEASE)) {
- // implementation rootProject.ext.dependencies.mogomap
- implementation rootProject.ext.dependencies.mogomapapi
- implementation rootProject.ext.dependencies.mogoutils
- implementation rootProject.ext.dependencies.mogocommons
- implementation rootProject.ext.dependencies.mogoserviceapi
- implementation rootProject.ext.dependencies.modulecommon
- // implementation rootProject.ext.dependencies.modulemap
- } else {
- // implementation project(":libraries:mogo-map")
- implementation project(":libraries:mogo-map-api")
- implementation project(":foudations:mogo-utils")
- api project(":foudations:mogo-commons")
- api project(':services:mogo-service-api')
- api project(':modules:mogo-module-common')
- // implementation project(':modules:mogo-module-map')
- }
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
- implementation 'com.zhidaoauto.voice.controller:api:1.0.2'
-
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.mogomapapi
+ implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.mogocommons
+ implementation rootProject.ext.dependencies.mogoserviceapi
+ implementation rootProject.ext.dependencies.modulecommon
+ implementation rootProject.ext.dependencies.gpssimulator
+ } else {
+ implementation project(":libraries:mogo-map-api")
+ implementation project(":foudations:mogo-utils")
+ implementation project(":foudations:mogo-commons")
+ implementation project(':services:mogo-service-api')
+ implementation project(':modules:mogo-module-common')
+ implementation project(':modules:mogo-module-gps-simulator')
+ }
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+ implementation 'com.zhidaoauto.voice.controller:api:1.0.2'
}
diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt
index 119ae65f6d..49e7b50d4b 100644
--- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt
+++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt
@@ -10,6 +10,8 @@ import com.mogo.map.navi.IMogoNavi
import com.mogo.map.search.geo.IMogoGeoSearch
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.module.common.MogoModulePaths
+import com.mogo.module.gps.simulator.GpsSimulatorConstants
+import com.mogo.module.gps.simulator.IMogoGpsSimulatorManager
import com.mogo.module.guideshow.provider.GuideShowProviderConstant
import com.mogo.module.guideshow.provider.IGuideShowProvider
import com.mogo.service.MogoServicePaths
@@ -26,55 +28,53 @@ import com.mogo.service.statusmanager.IMogoStatusManager
* 2020-01-08.
*/
@SuppressLint("StaticFieldLeak")
-object SearchServiceHolder{
- // 单例对象,要使用Application Context
- private lateinit var context: Context
+object SearchServiceHolder {
+ // 单例对象,要使用Application Context
+ private lateinit var context: Context
- val fragmentManager: IMogoFragmentManager = ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation() as IMogoFragmentManager
- val mapService: IMogoMapService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation() as IMogoMapService
- val listenerCenter: IMogoRegisterCenter = ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation() as IMogoRegisterCenter
- val statusManager: IMogoStatusManager = ARouter.getInstance().build(MogoServicePaths.PATH_STATUS_MANAGER).navigation() as IMogoStatusManager
- val analyticsManager: IMogoAnalytics = ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation() as IMogoAnalytics
- val guideShowProvider: IGuideShowProvider = ARouter.getInstance().build(GuideShowProviderConstant.GUIDE_SHOW_PROVIDER).navigation() as IGuideShowProvider
- val mogoLauncher: IMogoLauncher = ARouter.getInstance().build(MogoServicePaths.PATH_LAUNCHER_API).navigation() as IMogoLauncher
+ val fragmentManager: IMogoFragmentManager = ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation() as IMogoFragmentManager
+ val mapService: IMogoMapService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation() as IMogoMapService
+ val listenerCenter: IMogoRegisterCenter = ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation() as IMogoRegisterCenter
+ val statusManager: IMogoStatusManager = ARouter.getInstance().build(MogoServicePaths.PATH_STATUS_MANAGER).navigation() as IMogoStatusManager
+ val analyticsManager: IMogoAnalytics = ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation() as IMogoAnalytics
+ val guideShowProvider: IGuideShowProvider = ARouter.getInstance().build(GuideShowProviderConstant.GUIDE_SHOW_PROVIDER).navigation() as IGuideShowProvider
+ val mogoLauncher: IMogoLauncher = ARouter.getInstance().build(MogoServicePaths.PATH_LAUNCHER_API).navigation() as IMogoLauncher
+ val gpsSimulator = ARouter.getInstance().build(GpsSimulatorConstants.API_PATH).navigation() as IMogoGpsSimulatorManager
- var geoSearch: IMogoGeoSearch? = null
- fun init(context: Context) {
- this.context = context
- }
+ var geoSearch: IMogoGeoSearch? = null
+ fun init(context: Context) {
+ this.context = context
- fun push(
- fragment: Fragment,
- tag: String
- ) {
- val builder = FragmentDescriptor.Builder()
- builder.fragment(fragment)
- val build = builder.tag(tag)
- .build()
- fragmentManager.push(build)
- }
-
- fun getNavi(): IMogoNavi {
- return mapService.getNavi(context)
- }
-
- fun getLocationClient(): IMogoLocationClient {
- return mapService.getLocationClient(context)
- }
-
- fun getMapUIController(): IMogoMapUIController {
- return mapService.mapUIController
- }
-
- fun getMarkerManger(): IMogoMarkerManager {
- return mapService.getMarkerManager(context)
- }
-
- fun getGeoSearcher(): IMogoGeoSearch {
- if (geoSearch == null) {
- geoSearch = mapService.getGeoSearch(context)
}
- return geoSearch!!
- }
+
+ fun push(fragment: Fragment, tag: String) {
+ val builder = FragmentDescriptor.Builder()
+ builder.fragment(fragment)
+ val build = builder.tag(tag).build()
+ fragmentManager.push(build)
+ }
+
+ fun getNavi(): IMogoNavi {
+ return mapService.getNavi(context)
+ }
+
+ fun getLocationClient(): IMogoLocationClient {
+ return mapService.getLocationClient(context)
+ }
+
+ fun getMapUIController(): IMogoMapUIController {
+ return mapService.mapUIController
+ }
+
+ fun getMarkerManger(): IMogoMarkerManager {
+ return mapService.getMarkerManager(context)
+ }
+
+ fun getGeoSearcher(): IMogoGeoSearch {
+ if (geoSearch == null) {
+ geoSearch = mapService.getGeoSearch(context)
+ }
+ return geoSearch!!
+ }
}
\ No newline at end of file
diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/manager/SettingManager.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/manager/SettingManager.kt
index b5e757d036..66c998b9f9 100644
--- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/manager/SettingManager.kt
+++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/manager/SettingManager.kt
@@ -42,6 +42,11 @@ object SettingManager : IMogoSettingManager {
*/
private var isMonitor: Boolean = false
+ /**
+ * GPS 模拟
+ */
+ private var isGpsSimulator: Boolean = false
+
override fun getPathPrefer(): Int {
return settings!!.getInt(KEY_PAHT_PREFER, 0)
}
@@ -90,6 +95,14 @@ object SettingManager : IMogoSettingManager {
return isMonitor
}
+ fun setGpsSimulator(type:Boolean){
+ isGpsSimulator = type
+ }
+
+ fun isGpsSimulator(): Boolean {
+ return isGpsSimulator
+ }
+
/**
* 是否躲避拥堵
*/
diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt
index 4983a545c9..9cca8f6f94 100644
--- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt
+++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt
@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View
import android.widget.CompoundButton
import android.widget.CompoundButton.OnCheckedChangeListener
+import android.widget.CompoundButton.VISIBLE
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import com.alibaba.android.arouter.facade.annotation.Route
@@ -32,279 +33,259 @@ import org.greenrobot.eventbus.ThreadMode
*/
class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
- private var type: Int = 0
+ private var type: Int = 0
- override fun onCheckedChanged(
- buttonView: CompoundButton?,
- isChecked: Boolean
- ) {
- if (buttonView?.id == R.id.rb_navi_fee) {
- SettingManager.cost(isChecked)
- if (isChecked) {
- type = 2
- rb_navi_high_way.isChecked = false
- }
- } else if (buttonView?.id == R.id.rb_navi_high_way) {
- SettingManager.highSpeed(isChecked)
- type = 4
+ override fun onCheckedChanged(
+ buttonView: CompoundButton?,
+ isChecked: Boolean) {
+ if (buttonView?.id == R.id.rb_navi_fee) {
+ SettingManager.cost(isChecked)
+ if (isChecked) {
+ type = 2
+ rb_navi_high_way.isChecked = false
+ }
+ } else if (buttonView?.id == R.id.rb_navi_high_way) {
+ SettingManager.highSpeed(isChecked)
+ type = 4
- if (isChecked) {
- rb_navi_no_high_way.isChecked = false
- rb_navi_fee.isChecked = false
- }
- } else if (buttonView?.id == R.id.rb_navi_no_high_way) {
- SettingManager.avoidSpeed(isChecked)
- type = 3
+ if (isChecked) {
+ rb_navi_no_high_way.isChecked = false
+ rb_navi_fee.isChecked = false
+ }
+ } else if (buttonView?.id == R.id.rb_navi_no_high_way) {
+ SettingManager.avoidSpeed(isChecked)
+ type = 3
- if (isChecked) {
- rb_navi_high_way.isChecked = false
- }
- } else if (buttonView?.id == R.id.rb_navi_jam) {
- SettingManager.congestion(isChecked)
- type = 1
+ if (isChecked) {
+ rb_navi_high_way.isChecked = false
+ }
+ } else if (buttonView?.id == R.id.rb_navi_jam) {
+ SettingManager.congestion(isChecked)
+ type = 1
+
+ }
+ if (isChecked) {
+ SearchServiceHolder.analyticsManager.track("Navigation_preference", mapOf("type" to type))
+ }
}
- if (isChecked) {
- SearchServiceHolder.analyticsManager.track("Navigation_preference", mapOf("type" to type))
+
+ override fun getLayoutId(): Int {
+ return R.layout.fragment_navi_setting
}
- }
+ override fun onViewCreated(
+ view: View,
+ savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
- override fun getLayoutId(): Int {
- return R.layout.fragment_navi_setting
- }
-
- override fun onViewCreated(
- view: View,
- savedInstanceState: Bundle?
- ) {
- super.onViewCreated(view, savedInstanceState)
-
- iv_back.setOnClickListener {
- SearchServiceHolder.fragmentManager.pop()
- }
- initViews()
- initEvent()
- EventBus.getDefault()
- .register(this)
-
- }
-
- private fun initViews() {
-
- rb_navi_high_way.isChecked = SettingManager.isHighSpeed()
- rb_navi_jam.isChecked = SettingManager.isCongestion()
- rb_navi_no_high_way.isChecked = SettingManager.isAvoidSpeed()
- rb_navi_fee.isChecked = SettingManager.isCost()
-
- sb_navi_volume_progress.progress = SettingManager.volume
-
- rb_navi_day.isChecked = SettingManager.mapType == R.id.rb_navi_day
- rb_navi_night.isChecked = SettingManager.mapType == R.id.rb_navi_night
- rb_navi_auto.isChecked = SettingManager.mapType == R.id.rb_navi_auto
- rb_navi_detail.isChecked = SettingManager.voiceStyle == R.id.rb_navi_detail
- rb_navi_draft.isChecked = SettingManager.voiceStyle == R.id.rb_navi_draft
-
-
- updateHome()
- updateCompany()
-
- }
-
- private fun initEvent() {
- iv_sound_plus.setOnClickListener {
- VolumeManager.getInstance(context)
- .incVolume()
- sb_navi_volume_progress.progress = sb_navi_volume_progress.progress.plus(10)
- SettingManager.volume = sb_navi_volume_progress.progress
- }
- iv_sound_minus.setOnClickListener {
- VolumeManager.getInstance(context)
- .decVolume()
- sb_navi_volume_progress.progress = sb_navi_volume_progress.progress.minus(10)
- SettingManager.volume = sb_navi_volume_progress.progress
+ iv_back.setOnClickListener {
+ SearchServiceHolder.fragmentManager.pop()
+ }
+ initViews()
+ initEvent()
+ EventBus.getDefault().register(this)
}
- rb_navi_jam.setOnCheckedChangeListener(this)
- rb_navi_high_way.setOnCheckedChangeListener(this)
- rb_navi_no_high_way.setOnCheckedChangeListener(this)
- rb_navi_fee.setOnCheckedChangeListener(this)
+ private fun initViews() {
- sb_navi_volume_progress.max = VolumeManager.getInstance(context)
- .getMaxVol()
- sb_navi_volume_progress.progress = VolumeManager.getInstance(context)
- .sysVolume
+ rb_navi_high_way.isChecked = SettingManager.isHighSpeed()
+ rb_navi_jam.isChecked = SettingManager.isCongestion()
+ rb_navi_no_high_way.isChecked = SettingManager.isAvoidSpeed()
+ rb_navi_fee.isChecked = SettingManager.isCost()
+
+ sb_navi_volume_progress.progress = SettingManager.volume
+
+ rb_navi_day.isChecked = SettingManager.mapType == R.id.rb_navi_day
+ rb_navi_night.isChecked = SettingManager.mapType == R.id.rb_navi_night
+ rb_navi_auto.isChecked = SettingManager.mapType == R.id.rb_navi_auto
+ rb_navi_detail.isChecked = SettingManager.voiceStyle == R.id.rb_navi_detail
+ rb_navi_draft.isChecked = SettingManager.voiceStyle == R.id.rb_navi_draft
- sb_navi_volume_progress.setOnSeekBarChangeListener(object : OnSeekBarChangeListener {
- override fun onProgressChanged(
- seekBar: SeekBar?,
- progress: Int,
- fromUser: Boolean
- ) {
- if (fromUser) {
- VolumeManager.getInstance(context)
- .setSysVolume(progress)
- SettingManager.volume = sb_navi_volume_progress.progress
+ updateHome()
+ updateCompany()
+
+ }
+
+ private fun initEvent() {
+ iv_sound_plus.setOnClickListener {
+ VolumeManager.getInstance(context).incVolume()
+ sb_navi_volume_progress.progress = sb_navi_volume_progress.progress.plus(10)
+ SettingManager.volume = sb_navi_volume_progress.progress
+ }
+ iv_sound_minus.setOnClickListener {
+ VolumeManager.getInstance(context).decVolume()
+ sb_navi_volume_progress.progress = sb_navi_volume_progress.progress.minus(10)
+ SettingManager.volume = sb_navi_volume_progress.progress
+ }
+
+ rb_navi_jam.setOnCheckedChangeListener(this)
+ rb_navi_high_way.setOnCheckedChangeListener(this)
+ rb_navi_no_high_way.setOnCheckedChangeListener(this)
+ rb_navi_fee.setOnCheckedChangeListener(this)
+
+ sb_navi_volume_progress.max = VolumeManager.getInstance(context).getMaxVol()
+ sb_navi_volume_progress.progress = VolumeManager.getInstance(context).sysVolume
+
+
+ sb_navi_volume_progress.setOnSeekBarChangeListener(object : OnSeekBarChangeListener {
+ override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+ if (fromUser) {
+ VolumeManager.getInstance(context)
+ .setSysVolume(progress)
+ SettingManager.volume = sb_navi_volume_progress.progress
+
+ }
+
+// audioManager.setStreamVolume( AudioManager.STREAM_MUSIC, progress, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE )
+
+ }
+
+ override fun onStartTrackingTouch(seekBar: SeekBar?) {
+ }
+
+ override fun onStopTrackingTouch(seekBar: SeekBar?) {
+ }
+ })
+
+
+ rg_navi_day_night.setOnCheckedChangeListener { group, checkedId ->
+ SettingManager.mapType = checkedId
+ when (checkedId) {
+ R.id.rb_navi_day -> {
+ SearchServiceHolder.getMapUIController().changeMapMode(EnumMapUI.Type_Light)
+ }
+ R.id.rb_navi_night -> {
+ SearchServiceHolder.getMapUIController().changeMapMode(EnumMapUI.Type_Night)
+ }
+ R.id.rb_navi_auto -> {
+ SearchServiceHolder.getMapUIController().changeMapMode(EnumMapUI.Type_AUTO_LIGHT_Night)
+ }
+ }
+ }
+ rg_navi_sound_type.setOnCheckedChangeListener { group, checkedId ->
+ SettingManager.voiceStyle = checkedId
+ SearchServiceHolder.getNavi().setBroadcastMode(
+ if (checkedId == R.id.rb_navi_detail) BroadcastMode.DETAIL else BroadcastMode.CONCISE
+ )
+
+ if (checkedId == R.id.rb_navi_detail) {
+ SearchServiceHolder.analyticsManager.track("Navigation_guide_type", mapOf("type" to 1))
+ } else {
+ SearchServiceHolder.analyticsManager.track("Navigation_guide_type", mapOf("type" to 2))
+ }
+ }
+
+
+ tv_navi_clear_home_address.setOnClickListener {
+ AddressManager.deleteHome(context!!)
+ clearHome()
+ }
+
+ tv_navi_clear_company_address.setOnClickListener {
+ AddressManager.deleteCompany(context!!)
+ clearCompany()
+ }
+
+ tv_navi_company_address.setOnClickListener {
+ if (!AddressManager.hasCompany()) {
+ AddressManager.goCompany()
+ }
+ }
+
+ tv_navi_home_address.setOnClickListener {
+ if (!AddressManager.hasHome()) {
+ AddressManager.goHome()
+ }
+ }
+
+ if (DebugConfig.isDebug()) {
+ tb_navi.setOnCheckedChangeListener { _, isChecked ->
+ SettingManager.setMonitor(isChecked)
+ }
+ tb_navi.isChecked = SettingManager.isMonitor()
+ tb_gps.isChecked = SettingManager.isGpsSimulator()
+
+ tb_gps.setOnCheckedChangeListener { _, isChecked ->
+
+ if (SettingManager.isGpsSimulator() == isChecked) {
+ return@setOnCheckedChangeListener
+ }
+
+ SettingManager.setGpsSimulator(isChecked)
+ SearchServiceHolder.getNavi().setUseExtraGPSData(isChecked)
+
+ if (isChecked) {
+ SearchServiceHolder.gpsSimulator.open()
+ } else {
+ SearchServiceHolder.gpsSimulator.close()
+ }
+ }
+
+ ll_navi_simulator.visibility = View.VISIBLE
+ tv_navi_simulator.visibility = View.VISIBLE
+ } else {
+ ll_navi_simulator.visibility = View.GONE
+ tv_navi_simulator.visibility = View.GONE
+ }
+
+
+ }
+
+ private fun updateHome() {
+
+ if (AddressManager.hasHome()) {
+ tv_navi_home_address.text = AddressManager.homeAddress?.address
+ tv_navi_clear_home_address.visibility = View.VISIBLE
+ } else {
+ tv_navi_clear_home_address.visibility = View.GONE
+ }
+ }
+
+ private fun clearHome() {
+ tv_navi_clear_home_address.visibility = View.GONE
+ tv_navi_home_address.text = getString(R.string.navi_set_home)
+ }
+
+ private fun clearCompany() {
+ tv_navi_clear_company_address.visibility = View.GONE
+ tv_navi_company_address.text = getString(R.string.navi_set_company)
+
+ }
+
+ private fun updateCompany() {
+ if (AddressManager.hasCompany()) {
+ tv_navi_company_address.text = AddressManager.companyAddress?.address
+ tv_navi_clear_company_address.visibility = View.VISIBLE
+ } else {
+ tv_navi_clear_company_address.visibility = View.GONE
+ }
+ }
+
+ /**
+ * 分享弹框
+ * @param event
+ */
+ @Subscribe(threadMode = ThreadMode.MAIN)
+ fun onEventBus(searchPoi: SearchPoi?) {
+ if (searchPoi == null) {
+ return
+ }
+ if (searchPoi?.type == DataConstants.TYPE_COMPANY_ADDRESS) {
+ tv_navi_company_address.text = searchPoi.address
+ tv_navi_clear_company_address.visibility = View.VISIBLE
+ } else {
+ tv_navi_home_address.text = searchPoi.address
+ tv_navi_clear_home_address.visibility = View.VISIBLE
}
-// audioManager.setStreamVolume(
-// AudioManager.STREAM_MUSIC, progress, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
-// )
-
- }
-
- override fun onStartTrackingTouch(seekBar: SeekBar?) {
- }
-
- override fun onStopTrackingTouch(seekBar: SeekBar?) {
- }
- }
- )
-
-
- rg_navi_day_night.setOnCheckedChangeListener { group, checkedId ->
- SettingManager.mapType = checkedId
-
- when (checkedId) {
- R.id.rb_navi_day -> {
- SearchServiceHolder.getMapUIController()
- .changeMapMode(EnumMapUI.Type_Light)
- }
- R.id.rb_navi_night -> {
- SearchServiceHolder.getMapUIController()
- .changeMapMode(EnumMapUI.Type_Night)
- }
- R.id.rb_navi_auto -> {
- SearchServiceHolder.getMapUIController()
- .changeMapMode(EnumMapUI.Type_AUTO_LIGHT_Night)
- }
- }
- }
- rg_navi_sound_type.setOnCheckedChangeListener { group, checkedId ->
- SettingManager.voiceStyle = checkedId
- SearchServiceHolder.getNavi()
- .setBroadcastMode(
- if (checkedId == R.id.rb_navi_detail) BroadcastMode.DETAIL else BroadcastMode.CONCISE
- )
-
- if (checkedId == R.id.rb_navi_detail) {
- SearchServiceHolder.analyticsManager.track("Navigation_guide_type", mapOf("type" to 1))
- } else {
- SearchServiceHolder.analyticsManager.track("Navigation_guide_type", mapOf("type" to 2))
- }
- }
-
-
- tv_navi_clear_home_address.setOnClickListener {
- AddressManager.deleteHome(context!!)
- clearHome()
- }
-
- tv_navi_clear_company_address.setOnClickListener {
- AddressManager.deleteCompany(context!!)
- clearCompany()
- }
-
- tv_navi_company_address.setOnClickListener {
- if (!AddressManager.hasCompany()) {
- AddressManager.goCompany()
- }
- }
-
- tv_navi_home_address.setOnClickListener {
- if (!AddressManager.hasHome()) {
- AddressManager.goHome()
- }
- }
-
- if (DebugConfig.isDebug()) {
- sb_navi_fps_progress.setOnSeekBarChangeListener(object : OnSeekBarChangeListener{
- override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
- if (progress == 0) {
- tv_fps_value.text = "-1"
- SearchServiceHolder.getMapUIController().setRenderFps(-1)
- } else {
- tv_fps_value.text = "${progress}"
- SearchServiceHolder.getMapUIController().setRenderFps(progress)
- }
- }
-
- override fun onStartTrackingTouch(seekBar: SeekBar?) {
- }
-
- override fun onStopTrackingTouch(seekBar: SeekBar?) {
- }
- })
-
- cb_navi.setOnCheckedChangeListener { buttonView, isChecked ->
- SettingManager.setMonitor(isChecked)
- }
- cb_navi.isChecked=SettingManager.isMonitor()
- } else {
- tv_navi_fps.visibility = View.GONE
- ll_navi_fps.visibility = View.GONE
- cb_navi.visibility = View.GONE
- }
-
-
- }
-
- private fun updateHome() {
-
- if (AddressManager.hasHome()) {
- tv_navi_home_address.text = AddressManager.homeAddress?.address
- tv_navi_clear_home_address.visibility = View.VISIBLE
- } else {
- tv_navi_clear_home_address.visibility = View.GONE
- }
- }
-
- private fun clearHome() {
- tv_navi_clear_home_address.visibility = View.GONE
- tv_navi_home_address.text = getString(R.string.navi_set_home)
- }
-
- private fun clearCompany() {
- tv_navi_clear_company_address.visibility = View.GONE
- tv_navi_company_address.text = getString(R.string.navi_set_company)
-
- }
-
- private fun updateCompany() {
- if (AddressManager.hasCompany()) {
- tv_navi_company_address.text = AddressManager.companyAddress?.address
- tv_navi_clear_company_address.visibility = View.VISIBLE
- } else {
- tv_navi_clear_company_address.visibility = View.GONE
- }
- }
-
- /**
- * 分享弹框
- * @param event
- */
- @Subscribe(threadMode = ThreadMode.MAIN)
- fun onEventBus(searchPoi: SearchPoi?) {
- if (searchPoi == null) {
- return
- }
- if (searchPoi?.type == DataConstants.TYPE_COMPANY_ADDRESS) {
- tv_navi_company_address.text = searchPoi.address
- tv_navi_clear_company_address.visibility = View.VISIBLE
- } else {
- tv_navi_home_address.text = searchPoi.address
- tv_navi_clear_home_address.visibility = View.VISIBLE
}
-
- }
-
- override fun onDestroyView() {
- super.onDestroyView()
- EventBus.getDefault()
- .unregister(this)
- }
+ override fun onDestroyView() {
+ super.onDestroyView()
+ EventBus.getDefault().unregister(this)
+ }
}
diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml b/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml
index c5059d120c..1c4a00bfa9 100644
--- a/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml
+++ b/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml
@@ -406,12 +406,13 @@
+
+ app:layout_constraintTop_toBottomOf="@id/tv_navi_simulator">
-
-
-
-
-
-
+
+
+ android:textColor="@color/white_80"
+ android:textSize="@dimen/module_search_txt_setting_width"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
-
-
-
-
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 cea9c0ea54..792fd7be00 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
@@ -811,6 +811,12 @@ public class MogoServices implements IMogoMapListener,
if ( TextUtils.equals( "打开", operation ) ) {
switchCard2( ServiceConst.CARD_TYPE_CARS_CHATTING );
}
+ } else {
+ if ( TextUtils.equals( app, "探路" ) ) {
+ if ( TextUtils.equals( "打开", operation ) ) {
+ switchCard2( ServiceConst.CARD_TYPE_ROAD_CONDITION );
+ }
+ }
}
} catch ( JSONException e ) {
e.printStackTrace();
diff --git a/settings.gradle b/settings.gradle
index 8fd8f035d7..03d4c6868f 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -21,3 +21,6 @@ include ':libraries:mogo-map-api'
include ':modules:mogo-module-apps'
include ':modules:mogo-module-extensions'
include ':foudations:mogo-connection'
+include ':modules:mogo-module-gps-simulator'
+include ':modules:mogo-module-gps-simulator-debug'
+include ':modules:mogo-module-gps-simulator-noop'