(java.lang.Throwable);
+}
+
+#-----Netty-----
+-keepattributes Signature,InnerClasses
+-keep class io.netty.** {*;}
+-keep class org.apache.** {*;}
+-keep class org.apache.logging.**{*;}
+-keepclasseswithmembers class io.netty.** {*;}
+-keepclasseswithmembers class org.apache.logging.**{*;}
+-keep class org.apache.http.**{*;}
+-dontwarn io.netty.**
+-dontwarn sun.**
+
+#-----ZhiDaoService-----
+-keep class com.zhidao.auto.platform.**{*;}
+-keep class com.zhidao.auto.carcorder.**{*;}
+-keep class com.zhidaohulian.**{*;}
+-keep class com.zhidao.boot.**{*;}
+-keep class com.elegant.**{*;}
+-keep class com.zhidao.socketsdk.**{*;}
+-keep class com.zhidao.socket.**{*;}
+-keep class com.zhidao.ptech.**{*;}
+-keep class com.zhidao.autopilotcore.**{*;}
+-keep class com.zhidao.autopilot.support.**{*;}
+-keep class com.zhidao.voice.library.**{*;}
+-keep class com.zhidao.voicesdk.**{*;}
+-keep class com.zhidao.smartv2x.**{*;}
+-keep class com.zhidao.accountsdk.**{*;}
+-keep class com.zhidao.account.**{*;}
+-keep class com.zhidao.locupload.**{*;}
+-keep class com.zhidao.tcloginsdk.**{*;}
+-keep class com.zhidao.utils.**{*;}
+-keep class com.hw.videoprocessor.**{*;}
+-dontwarn com.elegant.network.**
+
+-keep class com.bytedance.boost_multidex.**{*;}
+
+
+
+
diff --git a/app/src/em4/AndroidManifest.xml b/app/src/em4/AndroidManifest.xml
new file mode 100644
index 0000000000..d755054676
--- /dev/null
+++ b/app/src/em4/AndroidManifest.xml
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java
index 369ec564f2..449ebf20d4 100644
--- a/app/src/main/java/com/mogo/launcher/MogoApplication.java
+++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java
@@ -2,6 +2,7 @@ package com.mogo.launcher;
import android.content.Context;
import android.content.Intent;
+import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
@@ -9,6 +10,8 @@ import com.auto.zhidao.logsdk.CrashSystem;
import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
+import com.mogo.commons.network.Utils;
+import com.mogo.commons.storage.SpStorage;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
import com.mogo.module.carchatting.card.CallChatConstant;
import com.mogo.module.common.MogoModule;
@@ -19,11 +22,15 @@ import com.mogo.module.push.base.PushUIConstants;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.module.v2x.V2XConst;
+import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
-import com.mogo.service.connection.IMogoSocketManager;
+import com.mogo.service.passport.IMogoTicketCallback;
+import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
import com.zhidao.boot.persistent.lib.PersistentManager;
+import com.zhidao.mogo.module.event.panel.EventPanelConstants;
+import com.zhidao.mogo.module.left.panel.LeftPanelConst;
/**
* @author congtaowang
@@ -41,59 +48,111 @@ public class MogoApplication extends AbsMogoApplication {
super.onCreate();
// Crash 日志收集
final long start = System.currentTimeMillis();
- CrashSystem crashSystem = CrashSystem.getInstance(this);
+ CrashSystem crashSystem = CrashSystem.getInstance( this );
crashSystem.init();
//设置debug模式,日志不上传
- crashSystem.setDebug(BuildConfig.DEBUG);
- Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
+ crashSystem.setDebug( BuildConfig.DEBUG );
+ Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
- MogoModulePaths.addModule(new MogoModule(AuthorizeConstant.PATH_AGREEMENT_FRAGMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME));
+// MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
+ MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
//运营位卡片,需要默认显示,放在第一个加载
- if (DebugConfig.isLauncher()) {
- MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
+ if (DebugConfig.isLauncher() ) {
+ MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
}
-
- MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
- MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
- MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
-
- MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
- MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));
- MogoModulePaths.addModule(new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME));
-
- if (!DebugConfig.isLauncher()) {
- PersistentManager.getInstance().initManager(this);
- Intent intent = new Intent(this, MogoMainService.class);
- startService(intent);
+ if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
+ MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
}
- Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
+ MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
+ MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
+
+ MogoModulePaths.addModule( new MogoModule( EventPanelConstants.PATH_NAME,
+ EventPanelConstants.MODULE_NAME ) );
+ MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME,
+ LeftPanelConst.MODULE_NAME ) );
+
+ MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
+ MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI ) );
+ MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
+
+ if ( !DebugConfig.isLauncher() ) {
+ PersistentManager.getInstance().initManager( this );
+ Intent intent = new Intent( this, MogoMainService.class );
+ startService( intent );
+ }
+ Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
- private void initDebugConfig(){
- DebugConfig.setNetMode(BuildConfig.NET_ENV);
- DebugConfig.setDebug(BuildConfig.DEBUG);
- DebugConfig.setAIType(BuildConfig.AIType);
- DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE);
- DebugConfig.setUseCustomNavi(BuildConfig.USE_CUSTOM_NAVI);
- DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
+ private void initDebugConfig() {
+ DebugConfig.setNetMode( BuildConfig.NET_ENV );
+ DebugConfig.setDebug( BuildConfig.DEBUG );
+ DebugConfig.setAIType( BuildConfig.AIType );
+ DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
+ DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
+ DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
+ DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
+ DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
+ DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
}
@Override
protected void init() {
super.init();
- IMogoSocketManager mMogoSocketManager = ARouter.getInstance().navigation(IMogoSocketManager.class);
- if (mMogoSocketManager != null) {
- mMogoSocketManager.init(getApplicationContext(), "com.mogo.launcher");
- } else {
- Logger.e(TAG, "init socket server error.");
- }
+ prepareBaseService(2_000L);
+ }
+
+ /**
+ * 基础服务:passport、location、socket
+ */
+ private void prepareBaseService(long delay) {
+ UiThreadHandler.postDelayed( () -> {
+ final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
+ // 第三方平台的sn是服务端生成的,所以必须在返回后才能开启
+ if ( TextUtils.isEmpty( Utils.getSn() ) ) {
+ preparePassportEnvironment( apis, () -> {
+ prepareSocketAndLocationServices( apis );
+ } );
+ } else {
+ preparePassportEnvironment( apis, null );
+ prepareSocketAndLocationServices( apis );
+ }
+ }, delay );
+ }
+
+ private void preparePassportEnvironment( IMogoServiceApis apis, Runnable after ) {
+ apis.getPassportManagerApi().requestTicket( new IMogoTicketCallback() {
+ @Override
+ public void onTicketGot( String ticket ) {
+ Logger.d( TAG, "ticket = %s", ticket );
+ }
+
+ @Override
+ public void onError( int code, String msg ) {
+ Logger.w( TAG, "code = %s, msg = %s", code, msg );
+ }
+
+ @Override
+ public void onLoginSuccess( String token, String sn ) {
+ if ( after != null ) {
+ after.run();
+ }
+ }
+ } );
+ }
+
+ private void prepareSocketAndLocationServices( IMogoServiceApis apis ) {
+ apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() );
+ apis.getLocationInfoApi().start();
+ apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
+ apis.getLocationInfoApi().provideLocation( location );
+ } );
}
@Override
- protected void attachBaseContext(Context base) {
- super.attachBaseContext(base);
- BoostMultiDex.install(base);
+ protected void attachBaseContext( Context base ) {
+ super.attachBaseContext( base );
+ BoostMultiDex.install( base );
}
}
diff --git a/app/src/main/res/values-xhdpi-1920x1000/strings.xml b/app/src/main/res/values-xhdpi-1920x1000/strings.xml
new file mode 100644
index 0000000000..4b537bbf4c
--- /dev/null
+++ b/app/src/main/res/values-xhdpi-1920x1000/strings.xml
@@ -0,0 +1,3 @@
+
+ 蘑菇知途
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index f474f88ac7..8c30469045 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
- 智慧驾驶
+ 蘑菇出行
diff --git a/build.gradle b/build.gradle
index 2ff4df7631..32a0f5815c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,7 +22,6 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.alibaba:arouter-register:1.0.2"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
-// classpath "com.mogo.module.pluginhook:module-pluginhook:${HOOKPLUGIN_VERSION}"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
diff --git a/config.gradle b/config.gradle
index c85e51e62a..f0a58756c4 100644
--- a/config.gradle
+++ b/config.gradle
@@ -4,12 +4,12 @@ ext {
android = [
// applicationId : "com.mogo.launcher",
// zhidadoApplicationId: "com.zhidao.launcher",
- launcherApplicationId : "com.mogo.launcher",
- independentApplicationId: "com.mogo.launcher.app",
- compileSdkVersion : 28,
- buildToolsVersion : "29.0.2",
- minSdkVersion : 19,
- targetSdkVersion : 22,
+launcherApplicationId : "com.mogo.launcher",
+independentApplicationId: "com.mogo.launcher.app",
+compileSdkVersion : 28,
+buildToolsVersion : "29.0.2",
+minSdkVersion : 19,
+targetSdkVersion : 22,
]
dependencies = [
@@ -21,6 +21,8 @@ ext {
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
androidxcardview : "androidx.cardview:cardview:1.0.0",
+ // flexbox
+ flexbox : 'com.google.android:flexbox:2.0.1',
// 测试
junit : "junit:junit:4.12",
androidxjunit : "androidx.test.ext:junit:1.1.0",
@@ -73,11 +75,6 @@ ext {
// rxjava2 with room
roomRxjava : "android.arch.persistence.room:rxjava2:1.1.1",
-
- // leakcanary
- leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.5.4',
- leakcanarynoop : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4',
-
// material
material : 'com.google.android.material:material:1.0.0',
@@ -104,8 +101,8 @@ ext {
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
carcall : "com.mogo.module.carchatting:module-carchatting:${CARCHATTING_VERSION}",
carcallprovider : "com.mogo.module.carchatting:module-carchatting-provider:${CARCHATTINGPROVIDER_VERSION}",
- guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
- guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
+// guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
+// guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
// 在线车辆
moduleonlinecar : "com.mogo.module:module-onlinecar:${MOGO_MODULE_ONLINECAR_VERSION}",
// V2X
@@ -126,6 +123,8 @@ ext {
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.4',
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
socketsdkprotobufjava : 'com.google.protobuf:protobuf-java:3.5.1',
+ // OBU
+ moduleobu : "com.mogo.module:module-obu:${MOGO_MODULE_OBU_VERSION}",
//
jetbrainsannotationsjava5: "org.jetbrains:annotations-java5:15.0",
@@ -157,5 +156,21 @@ ext {
// 个人中心的SDK
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
tanluupload : "com.mogo.module:module-tanlu-upload:${TANLULIB_VERSION}",
+
+ // obu sdk
+ obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.1",
+ //事件面板
+ moduleventpanel : "com.mogo.module:module-event-panel:${MOGO_MODULE_EVENT_PANEL_VERSION}",
+ // 事件面板空实现
+ moduleventpanelnoop : "com.mogo.module:module-event-panel-noop:${MOGO_MODULE_EVENT_PANEL_VERSION}",
+ // 左侧面板
+ moduleleftpanel : "com.mogo.module:module-left-panel:${MOGO_MODULE_LEFT_PANEL_VERSION}",
+ // 左侧面板空实现
+ moduleleftpanelnoop : "com.mogo.module:module-left-panel-noop:${MOGO_MODULE_LEFT_PANEL_VERSION}",
+ // 闪屏页
+ modulesplash : "com.mogo.module:module-splash:${MOGO_MODULE_SPLASH_VERSION}",
+ // 基础服务实现
+ mogobaseservicesdk : "com.mogo.base:services-sdk:${MOGO_BASE_SERVICES_SDK_VERSION}",
+ mogobaseserviceapk : "com.mogo.base:services-apk:${MOGO_BASE_SERVICES_APK_VERSION}",
]
}
\ No newline at end of file
diff --git a/foudations/mogo-base-services-apk/.gitignore b/foudations/mogo-base-services-apk/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/foudations/mogo-base-services-apk/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/foudations/mogo-base-services-apk/README.md b/foudations/mogo-base-services-apk/README.md
new file mode 100644
index 0000000000..b6ee9eafae
--- /dev/null
+++ b/foudations/mogo-base-services-apk/README.md
@@ -0,0 +1,7 @@
+## 基实现功能
+
+基础服务apk实现对应功能:位置上报、长连接、passport
+
+位置上报:com.zhidao.locationinfo
+长链:com.zhidao.socketservice
+passport:
\ No newline at end of file
diff --git a/foudations/mogo-connection/build.gradle b/foudations/mogo-base-services-apk/build.gradle
similarity index 75%
rename from foudations/mogo-connection/build.gradle
rename to foudations/mogo-base-services-apk/build.gradle
index db342def5f..943521aac6 100644
--- a/foudations/mogo-connection/build.gradle
+++ b/foudations/mogo-base-services-apk/build.gradle
@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
-apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -10,14 +9,9 @@ android {
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles 'consumer-rules.pro'
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = [AROUTER_MODULE_NAME: project.getName()]
- }
- }
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
@@ -26,24 +20,32 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
}
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation rootProject.ext.dependencies.arouter
api rootProject.ext.dependencies.socketsdk
api rootProject.ext.dependencies.socketsdkconnsvrprotoco
api rootProject.ext.dependencies.socketsdkprotobufjava
- implementation rootProject.ext.dependencies.arouter
- annotationProcessor rootProject.ext.dependencies.aroutercompiler
+ implementation rootProject.ext.dependencies.accountsdk
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.mogoserviceapi
} else {
implementation project(":foudations:mogo-utils")
+ implementation project(":foudations:mogo-commons")
implementation project(":services:mogo-service-api")
}
+
}
-apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/foudations/mogo-connection/consumer-rules.pro b/foudations/mogo-base-services-apk/consumer-rules.pro
similarity index 100%
rename from foudations/mogo-connection/consumer-rules.pro
rename to foudations/mogo-base-services-apk/consumer-rules.pro
diff --git a/foudations/mogo-base-services-apk/gradle.properties b/foudations/mogo-base-services-apk/gradle.properties
new file mode 100644
index 0000000000..aae1d6638c
--- /dev/null
+++ b/foudations/mogo-base-services-apk/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.base
+POM_ARTIFACT_ID=services-apk
+VERSION_CODE=1
diff --git a/foudations/mogo-connection/proguard-rules.pro b/foudations/mogo-base-services-apk/proguard-rules.pro
similarity index 94%
rename from foudations/mogo-connection/proguard-rules.pro
rename to foudations/mogo-base-services-apk/proguard-rules.pro
index f1b424510d..481bb43481 100644
--- a/foudations/mogo-connection/proguard-rules.pro
+++ b/foudations/mogo-base-services-apk/proguard-rules.pro
@@ -18,4 +18,4 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
-#-renamesourcefileattribute SourceFile
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/foudations/mogo-base-services-apk/src/main/AndroidManifest.xml b/foudations/mogo-base-services-apk/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..a82c409551
--- /dev/null
+++ b/foudations/mogo-base-services-apk/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationInfoServices.java b/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationInfoServices.java
new file mode 100644
index 0000000000..5a6c31d624
--- /dev/null
+++ b/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationInfoServices.java
@@ -0,0 +1,63 @@
+package com.mogo.base.services.locationinfo;
+
+import android.content.Context;
+
+import androidx.annotation.Keep;
+
+import com.mogo.map.location.MogoLocation;
+import com.mogo.service.locationinfo.IMogoLocationInfoService;
+import com.mogo.utils.logger.Logger;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 位置服务
+ */
+@Keep
+class MogoLocationInfoServices implements IMogoLocationInfoService {
+
+ private static final String TAG = "MogoLocationInfoServices-apk";
+
+ private static volatile MogoLocationInfoServices sInstance;
+
+ private MogoLocationInfoServices() {
+ }
+
+ @Keep
+ public static MogoLocationInfoServices getInstance() {
+ if ( sInstance == null ) {
+ synchronized ( MogoLocationInfoServices.class ) {
+ if ( sInstance == null ) {
+ sInstance = new MogoLocationInfoServices();
+ }
+ }
+ }
+ return sInstance;
+ }
+
+ public synchronized void release() {
+ sInstance = null;
+ }
+
+ @Override
+ public void provideLocation( MogoLocation location ) {
+ Logger.d( TAG, "apk - provideLocation" );
+ }
+
+ @Override
+ public void start() {
+ Logger.d( TAG, "apk - start" );
+ }
+
+ @Override
+ public void stop() {
+ Logger.d( TAG, "apk - stop" );
+ }
+
+ @Override
+ public void init( Context context ) {
+ Logger.d( TAG, "apk - init" );
+ }
+}
diff --git a/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/passport/PassportManager.java b/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/passport/PassportManager.java
new file mode 100644
index 0000000000..2a23051695
--- /dev/null
+++ b/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/passport/PassportManager.java
@@ -0,0 +1,87 @@
+package com.mogo.base.services.passport;
+
+import android.content.Context;
+
+import androidx.annotation.Keep;
+
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.commons.storage.SpStorage;
+import com.mogo.service.passport.IMogoPassportManager;
+import com.mogo.service.passport.IMogoTicketCallback;
+import com.mogo.utils.logger.Logger;
+import com.zhidao.account.sdk.AccountClientManager;
+import com.zhidao.account.sdk.callback.TicketInfoCallback;
+import com.zhidao.account.sdk.network.NetEnvironManager;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 描述
+ */
+@Keep
+class PassportManager implements IMogoPassportManager {
+
+ private static final String TAG = "PassportManager-apk";
+
+ private static volatile PassportManager sInstance;
+
+ private PassportManager(){}
+
+ @Keep
+ public static PassportManager getInstance(){
+ if( sInstance == null ){
+ synchronized( PassportManager.class ) {
+ if( sInstance == null ){
+ sInstance = new PassportManager();
+ }
+ }
+ }
+ return sInstance;
+ }
+
+ public synchronized void release(){
+ sInstance = null;
+ }
+
+ @Override
+ public void requestTicket( final IMogoTicketCallback callback ) {
+ getTicket( new TicketInfoCallback() {
+ @Override
+ public void onSuccess( String ticket ) {
+ Logger.d( TAG, "success" );
+ SpStorage.setTicket( ticket );
+ if ( callback != null ) {
+ callback.onTicketGot( ticket );
+ }
+ }
+
+ @Override
+ public void onFailure( int code, String msg ) {
+ Logger.d( TAG, "fail" );
+ if ( callback != null ) {
+ callback.onError( code, msg );
+ }
+ }
+ } );
+ }
+
+ private static void getTicket( TicketInfoCallback callback ) {
+ if ( DebugConfig.isLauncher() ) {
+ AccountClientManager.getTicket( callback );
+ } else {
+ AccountClientManager.getAppTicket( callback );
+ }
+ }
+
+ @Override
+ public void init( Context context ) {
+ int mode = DebugConfig.getNetMode();
+ if ( mode == DebugConfig.NET_MODE_DEMO ) {
+ // 演示环境用 qa 的
+ mode = DebugConfig.NET_MODE_QA;
+ }
+ AccountClientManager.init( context.getApplicationContext(), mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
+ }
+}
diff --git a/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/SocketManager.java b/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/socket/SocketManager.java
similarity index 97%
rename from foudations/mogo-connection/src/main/java/com/mogo/connection/socket/SocketManager.java
rename to foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/socket/SocketManager.java
index 735eefdd9e..22e6fb427c 100644
--- a/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/SocketManager.java
+++ b/foudations/mogo-base-services-apk/src/main/java/com/mogo/base/services/socket/SocketManager.java
@@ -1,11 +1,11 @@
-package com.mogo.connection.socket;
+package com.mogo.base.services.socket;
import android.content.Context;
+import androidx.annotation.Keep;
+
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
-import com.mogo.map.listener.IMogoMapListener;
-import com.mogo.service.connection.IMessageResponse;
import com.mogo.service.connection.IMogoMsgAckListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.connection.IMogoSocketManager;
@@ -31,10 +31,10 @@ import java.util.concurrent.ConcurrentHashMap;
*
* 长链实现:基于 netty
*/
-
+@Keep
public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallback, OnSocketAckCallback {
- private static final String TAG = "SocketManager";
+ private static final String TAG = "SocketManager-apk";
public static final int MSG_PRODUCT_LINE = MogoCommon.Product.mogoBussiness_VALUE;
private static final int MSG_HEADER_TYPE = MogoConnsvr.MsgType.mogoMsgTypeDispatchSvrNoRspReq_VALUE;
@@ -47,6 +47,7 @@ public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallbac
mSocketConnManager.addSocketAckCallback( this );
}
+ @Keep
public static SocketManager getInstance( Context context ) {
if ( sInstance == null ) {
synchronized ( SocketManager.class ) {
diff --git a/foudations/mogo-base-services-sdk/.gitignore b/foudations/mogo-base-services-sdk/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/README.md b/foudations/mogo-base-services-sdk/README.md
new file mode 100644
index 0000000000..d5fa09de5b
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/README.md
@@ -0,0 +1,3 @@
+## sdk实现功能
+
+脱离基础服务apk实现对应功能:位置上报、长连接、passport
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/build.gradle b/foudations/mogo-base-services-sdk/build.gradle
new file mode 100644
index 0000000000..7237542631
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/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")
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation rootProject.ext.dependencies.arouter
+ // 上报位置
+ implementation 'com.zhidao.locupload:loc-upload-sdk:1.1.3'
+ // 长链
+ implementation 'com.zhidao.socket:built-in-socket:1.0.15'
+ // passport
+ implementation 'com.zhidao.tcloginsdk:tclogin:1.1.0'
+
+ annotationProcessor 'com.elegant.spi:compiler:1.0.3'
+
+
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.mogocommons
+ implementation rootProject.ext.dependencies.mogoserviceapi
+ } else {
+ implementation project(":foudations:mogo-utils")
+ implementation project(":foudations:mogo-commons")
+ implementation project(":services:mogo-service-api")
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/consumer-rules.pro b/foudations/mogo-base-services-sdk/consumer-rules.pro
new file mode 100644
index 0000000000..e4c27a022e
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----MogoBaseServiceSdk-----
+-keep class com.mogo.base.services.locationinfo.MogoLocationSource.*{*;}
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/gradle.properties b/foudations/mogo-base-services-sdk/gradle.properties
new file mode 100644
index 0000000000..ce31a0de78
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.base
+POM_ARTIFACT_ID=services-sdk
+VERSION_CODE=1
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/proguard-rules.pro b/foudations/mogo-base-services-sdk/proguard-rules.pro
new file mode 100644
index 0000000000..ba8f820823
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/proguard-rules.pro
@@ -0,0 +1,24 @@
+# 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
+
+#-----MogoBaseServiceSdk-----
+-keep class com.mogo.base.services.locationinfo.MogoLocationSource.*{*;}
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/src/androidTest/java/com/mogo/base/services/ExampleInstrumentedTest.java b/foudations/mogo-base-services-sdk/src/androidTest/java/com/mogo/base/services/ExampleInstrumentedTest.java
new file mode 100644
index 0000000000..856a560f77
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/androidTest/java/com/mogo/base/services/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.mogo.base.services;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith( AndroidJUnit4.class )
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals( "com.mogo.base.services.test", appContext.getPackageName() );
+ }
+}
\ No newline at end of file
diff --git a/foudations/mogo-connection/src/main/AndroidManifest.xml b/foudations/mogo-base-services-sdk/src/main/AndroidManifest.xml
similarity index 55%
rename from foudations/mogo-connection/src/main/AndroidManifest.xml
rename to foudations/mogo-base-services-sdk/src/main/AndroidManifest.xml
index 639efc7d99..d7ee25b198 100644
--- a/foudations/mogo-connection/src/main/AndroidManifest.xml
+++ b/foudations/mogo-base-services-sdk/src/main/AndroidManifest.xml
@@ -1,2 +1,5 @@
+ package="com.mogo.base.services">
+
+ /
+
\ No newline at end of file
diff --git a/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/BaseServicesConstants.java b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/BaseServicesConstants.java
new file mode 100644
index 0000000000..5d4c38a17a
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/BaseServicesConstants.java
@@ -0,0 +1,16 @@
+package com.mogo.base.services;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/23
+ *
+ * 描述
+ */
+interface BaseServicesConstants {
+
+ /**
+ * 建立长链的通道ID
+ */
+ String SOCKET_CHANNEL_ID = "dataCrawler";
+}
diff --git a/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationInfoServices.java b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationInfoServices.java
new file mode 100644
index 0000000000..8ecd0cb034
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationInfoServices.java
@@ -0,0 +1,80 @@
+package com.mogo.base.services.locationinfo;
+
+import android.content.Context;
+
+import androidx.annotation.Keep;
+
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.map.location.MogoLocation;
+import com.mogo.service.locationinfo.IMogoLocationInfoService;
+import com.mogo.utils.logger.Logger;
+import com.zhidao.locupload.LocEnvironment;
+import com.zhidao.locupload.LocUploadConfig;
+import com.zhidao.locupload.LocUploadManager;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 位置服务
+ */
+@Keep
+class MogoLocationInfoServices implements IMogoLocationInfoService {
+
+ private static final String TAG = "MogoLocationInfoServices-sdk";
+
+ private static volatile MogoLocationInfoServices sInstance;
+ private MogoLocation mLocation;
+
+ private MogoLocationInfoServices() {
+ }
+
+ @Keep
+ public static MogoLocationInfoServices getInstance() {
+ if ( sInstance == null ) {
+ synchronized ( MogoLocationInfoServices.class ) {
+ if ( sInstance == null ) {
+ sInstance = new MogoLocationInfoServices();
+ }
+ }
+ }
+ return sInstance;
+ }
+
+ public synchronized void release() {
+ sInstance = null;
+ }
+
+ @Override
+ public void provideLocation( MogoLocation location ) {
+ mLocation = location;
+ Logger.d( TAG, "sdk - provideLocation" );
+ }
+
+ public MogoLocation getLocation() {
+ return mLocation;
+ }
+
+ @Override
+ public void start() {
+ LocUploadManager.getInstance().startUpload();
+ Logger.d( TAG, "sdk - start" );
+ }
+
+ @Override
+ public void stop() {
+ LocUploadManager.getInstance().stopUpload();
+ Logger.d( TAG, "sdk - stop" );
+ }
+
+ @Override
+ public void init( Context context ) {
+ LocUploadConfig.instance().
+ setAppId( DebugConfig.getSocketAppId() ).
+ setContext( context.getApplicationContext() ).
+ setLoggable( DebugConfig.isDebug() ).
+ setLocInterval( 2000L );
+ Logger.d( TAG, "sdk - init" );
+ }
+}
diff --git a/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationSource.java b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationSource.java
new file mode 100644
index 0000000000..844abb4a98
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/locationinfo/MogoLocationSource.java
@@ -0,0 +1,133 @@
+package com.mogo.base.services.locationinfo;
+
+import com.elegant.spi.annotations.Service;
+import com.zhidao.locupload.location.LocationServiceProvider;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 描述
+ */
+@Service( value = LocationServiceProvider.class )
+class MogoLocationSource extends LocationServiceProvider {
+
+ @Override
+ public float getBearing() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getBearing();
+ }
+ return 0;
+ }
+
+ @Override
+ public float getAccuracy() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getAccuracy();
+ }
+ return 0;
+ }
+
+ @Override
+ public String getProvider() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getProvider();
+ }
+ return null;
+ }
+
+ @Override
+ public float getSpeed() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getSpeed();
+ }
+ return 0;
+ }
+
+ @Override
+ public double getAltitude() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getAltitude();
+ }
+ return 0;
+ }
+
+ @Override
+ public String getAdCode() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getAdCode();
+ }
+ return null;
+ }
+
+ @Override
+ public int getLocType() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getLocType();
+ }
+ return 0;
+ }
+
+ @Override
+ public double getLatitude() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getLatitude();
+ }
+ return 0;
+ }
+
+ @Override
+ public double getLongitude() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getLongitude();
+ }
+ return 0;
+ }
+
+ @Override
+ public long getTime() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getTime();
+ }
+ return 0;
+ }
+
+ @Override
+ public String getCityCode() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getCityCode();
+ }
+ return null;
+ }
+
+ @Override
+ public String getCityName() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getCityName();
+ }
+ return null;
+ }
+
+ @Override
+ public int getGpsAccuracyStatus() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getGpsAccuracyStatus();
+ }
+ return 0;
+ }
+
+ @Override
+ public int getSatellites() {
+ if ( MogoLocationInfoServices.getInstance().getLocation() != null ) {
+ return MogoLocationInfoServices.getInstance().getLocation().getSatellite();
+ }
+ return 0;
+ }
+
+ @Override
+ public int getCarStatus() {
+ // 常开状态
+ return 1;
+ }
+}
diff --git a/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/passport/PassportManager.java b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/passport/PassportManager.java
new file mode 100644
index 0000000000..8f77ef1ecb
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/passport/PassportManager.java
@@ -0,0 +1,118 @@
+package com.mogo.base.services.passport;
+
+import android.content.Context;
+
+import androidx.annotation.Keep;
+
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.commons.storage.SpStorage;
+import com.mogo.service.passport.IMogoPassportManager;
+import com.mogo.service.passport.IMogoTicketCallback;
+import com.mogo.utils.logger.Logger;
+import com.zhidao.accountsdk.manager.CarPadClientManagerImpl;
+import com.zhidao.accountsdk.manager.TicketInfoCallback;
+import com.zhidao.tcloginsdk.LoginManager;
+import com.zhidao.tcloginsdk.model.TokenData;
+import com.zhidao.tcloginsdk.network.LoginCallback;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 描述
+ */
+@Keep
+class PassportManager implements IMogoPassportManager {
+
+ private static final String TAG = "PassportManager-sdk";
+ private Context mContext;
+
+ private static volatile PassportManager sInstance;
+
+ private PassportManager() {
+ }
+
+ @Keep
+ public static PassportManager getInstance() {
+ if ( sInstance == null ) {
+ synchronized ( PassportManager.class ) {
+ if ( sInstance == null ) {
+ sInstance = new PassportManager();
+ }
+ }
+ }
+ return sInstance;
+ }
+
+ public synchronized void release() {
+ sInstance = null;
+ }
+
+ @Override
+ public void requestTicket( final IMogoTicketCallback callback ) {
+ LoginManager.getInstance( mContext ).login( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE, DebugConfig.getProductFlavor(), new LoginCallback() {
+ @Override
+ public void onSuccess( TokenData.TokenResult result ) {
+ if ( callback != null ) {
+ callback.onLoginSuccess( result.token, result.sn );
+ }
+ getTicket( new TicketInfoCallback() {
+ @Override
+ public void onSuccess( String ticket ) {
+ Logger.d( TAG, "success" );
+ SpStorage.setTicket( ticket );
+ if ( callback != null ) {
+ callback.onTicketGot( ticket );
+ }
+ }
+
+ @Override
+ public void onFailure( int code ) {
+ Logger.d( TAG, "fail" );
+ if ( callback != null ) {
+ callback.onError( code, "getTicket error." );
+ }
+ }
+ } );
+ }
+
+ @Override
+ public void onFailure( int code, String msg ) {
+ if ( callback != null ) {
+ callback.onError( code, "login: " + msg );
+ }
+ }
+ } );
+
+ }
+
+ private void getTicket( TicketInfoCallback callback ) {
+ CarPadClientManagerImpl.getInstance( mContext ).getTicket( "os2.0-launcher", new TicketInfoCallback() {
+ @Override
+ public void onSuccess( String ticket ) {
+ if ( callback != null ) {
+ callback.onSuccess( ticket );
+ }
+ }
+
+ @Override
+ public void onFailure( int code ) {
+ if ( callback != null ) {
+ callback.onFailure( code );
+ }
+ }
+ } );
+ }
+
+ @Override
+ public void init( Context context ) {
+ mContext = context;
+ int mode = DebugConfig.getNetMode();
+ if ( mode == DebugConfig.NET_MODE_DEMO ) {
+ // 演示环境用 qa 的
+ mode = DebugConfig.NET_MODE_QA;
+ }
+ LoginManager.getInstance( context ).setNetEnviron( mode );
+ }
+}
diff --git a/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/socket/SocketManager.java b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/socket/SocketManager.java
new file mode 100644
index 0000000000..f9520decf1
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/main/java/com/mogo/base/services/socket/SocketManager.java
@@ -0,0 +1,231 @@
+package com.mogo.base.services.socket;
+
+import android.content.Context;
+
+import androidx.annotation.Keep;
+import androidx.annotation.NonNull;
+
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import com.mogo.base.services.BaseServicesConstants;
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.commons.network.Utils;
+import com.mogo.service.connection.IMogoMsgAckListener;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.service.connection.IMogoSocketManager;
+import com.mogo.service.connection.MsgBody;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+import com.zhidao.locupload.Platform;
+import com.zhidao.ptech.connsvr.protocol.MogoConnsvr;
+import com.zhidao.socket.Callback;
+import com.zhidao.socket.CallbackManager;
+import com.zhidao.socket.Environment;
+import com.zhidao.socket.SocketConfig;
+import com.zhidao.socket.SocketMessageDispatcher;
+import com.zhidao.socket.utils.RequestUtil;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 长链
+ */
+@Keep
+class SocketManager implements IMogoSocketManager, Callback {
+
+ private static final String TAG = "SocketManager-sdk";
+
+ private static volatile SocketManager sInstance;
+ private String mAppId;
+
+ public SocketManager( Context context ) {
+ CallbackManager.getInstance().register( this );
+ }
+
+ @Keep
+ public static SocketManager getInstance( Context context ) {
+ if ( sInstance == null ) {
+ synchronized ( SocketManager.class ) {
+ if ( sInstance == null ) {
+ sInstance = new SocketManager( context );
+ }
+ }
+ }
+ return sInstance;
+ }
+
+ /**
+ * 管理消息分发
+ *
+ * key - msgType
+ */
+ private Map< Integer, List< IMogoOnMessageListener > > mListeners = new ConcurrentHashMap<>();
+
+ /**
+ * 管理消息回执
+ *
+ * key - msgId
+ */
+ private Map< Long, IMogoMsgAckListener > mAckListeners = new ConcurrentHashMap<>();
+
+
+ public static final int MAX_CAP = 64; //保证充足的容量应对非常延时的推送
+ private ArrayList< Long > mReceivedMsgId = new ArrayList<>( MAX_CAP );
+ private int mCurrentIndex = 0;
+
+ @Override
+ public void init( Context context, String appId ) {
+ mAppId = appId;
+ SocketConfig.instance()
+ .setAppContext( context.getApplicationContext() )
+ .setEnvironment( getEnvironment() )
+ .setClient( Platform.getClient( Platform.car ) )
+ .setChannelId( BaseServicesConstants.SOCKET_CHANNEL_ID )
+ .setOpenAnalytics( true )
+ .setSn( Utils.getSn() )
+ .setDebug( DebugConfig.isDebug() );
+ SocketMessageDispatcher.getInstance().start( context );
+ }
+
+ private Environment getEnvironment() {
+ switch ( DebugConfig.getNetMode() ) {
+ case 1:
+ return Environment.dev;
+ case 2:
+ case 4:
+ return Environment.qa;
+ case 3:
+ default:
+ return Environment.release;
+ }
+ }
+
+ @Override
+ public void update( @NonNull CallbackManager manager, @NonNull byte[] content, String appId, long msgId ) {
+ try {
+ MogoConnsvr.Payload payload = MogoConnsvr.Payload.parseFrom( content );
+ int msgType = payload.getMsgType();
+ Logger.d( TAG, "received msg type = %d", msgType );
+ List< IMogoOnMessageListener > listeners = mListeners.get( msgType );
+ if ( listeners != null && !listeners.isEmpty() ) {
+ Iterator< IMogoOnMessageListener > iterator = listeners.iterator();
+ if ( msgId != 0 ) { //兼容老版本
+ if ( mReceivedMsgId.contains( msgId ) ) { // 避免消息重发
+ return;
+ }
+ cacheLastReceivedMsgId( msgId );
+ }
+ Object object = null;
+ while ( iterator.hasNext() ) {
+ IMogoOnMessageListener listener = iterator.next();
+ if ( object == null ) {
+ object = GsonUtil.objectFromJson( payload.getPayload().toStringUtf8(), listener.target() );
+ }
+ if ( listener != null ) {
+ Logger.d( TAG, "received msgId = %s, content = %s", msgId, payload.getPayload().toStringUtf8() );
+ listener.onMsgReceived( object );
+ }
+ }
+ }
+ } catch ( InvalidProtocolBufferException e ) {
+ Logger.e( TAG, e, "parse msg error." );
+ }
+ }
+
+ @Override
+ public void onAck( @NonNull CallbackManager manager, @NonNull byte[] headerBytes, byte[] content ) {
+ try {
+ MogoConnsvr.Header header = MogoConnsvr.Header.parseFrom( headerBytes );
+ int msgType = header.getMsgType();
+ String appId = header.getAppId();
+ int productLine = header.getProductLine();
+ long msgId = header.getMsgId();
+ IMogoMsgAckListener listener = mAckListeners.remove( msgId );
+ if ( listener != null ) {
+ listener.onAck( msgId );
+ }
+ Logger.d( TAG, "send message success: msgType = %d, appId = %s, productLine = %d", msgType, appId, productLine );
+ } catch ( InvalidProtocolBufferException e ) {
+ e.printStackTrace();
+ }
+ }
+
+ private void cacheLastReceivedMsgId( long msgId ) {
+ if ( msgId == 0 ) {
+ return;
+ }
+ synchronized ( this ) {
+ mReceivedMsgId.add( mCurrentIndex % MAX_CAP, msgId );
+ mCurrentIndex++;
+ }
+ }
+
+ @Override
+ public void registerOnMessageListener( int msgType, IMogoOnMessageListener listener ) {
+ if ( mListeners.containsKey( msgType ) ) {
+ Logger.w( TAG, "msgType %d is exist.", msgType );
+ }
+ if ( !mListeners.containsKey( msgType ) ) {
+ mListeners.put( msgType, new ArrayList< IMogoOnMessageListener >() );
+ }
+ mListeners.get( msgType ).add( listener );
+ }
+
+ @Override
+ public void unregisterOnMessageListener( int msgType ) {
+ mListeners.remove( msgType );
+ }
+
+ @Override
+ public void unregisterOnMessageListener( int msgType, IMogoOnMessageListener listener ) {
+ if ( listener == null ) {
+ return;
+ }
+ if ( !mListeners.containsKey( msgType ) ) {
+ return;
+ }
+ List< IMogoOnMessageListener > listeners = mListeners.get( msgType );
+ if ( listeners != null && listeners.contains( listener ) ) {
+ listeners.remove( listener );
+ }
+ }
+
+ @Override
+ public void sendMsg( MsgBody body, IMogoMsgAckListener listener ) {
+ Logger.d( TAG, "sendMsg." );
+ final byte[] pb = convertToPBBytes( body.getMsgType(), objectToBytes( body.getContent() ) );
+ RequestUtil.sendPayloadData( mAppId, 2, pb, 1, true, System.currentTimeMillis() );
+ }
+
+ public byte[] objectToBytes( Object obj ) {
+ String jsonStr = GsonUtil.jsonFromObject( obj );
+ return jsonStr.getBytes();
+ }
+
+ private byte[] convertToPBBytes( int msgType, byte[] payloadBytes ) {
+ MogoConnsvr.Payload payloadData = MogoConnsvr.Payload.newBuilder()
+ .setMsgType( msgType )
+ .setPayload( ByteString.copyFrom( payloadBytes ) ).build();
+ return payloadData.toByteArray();
+ }
+
+ public synchronized void release() {
+ mListeners.clear();
+ mListeners = null;
+ sInstance = null;
+ }
+
+
+ @Override
+ public void init( Context context ) {
+ }
+
+}
diff --git a/foudations/mogo-base-services-sdk/src/test/java/com/mogo/base/services/ExampleUnitTest.java b/foudations/mogo-base-services-sdk/src/test/java/com/mogo/base/services/ExampleUnitTest.java
new file mode 100644
index 0000000000..ec74ef013f
--- /dev/null
+++ b/foudations/mogo-base-services-sdk/src/test/java/com/mogo/base/services/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.mogo.base.services;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals( 4, 2 + 2 );
+ }
+}
\ No newline at end of file
diff --git a/foudations/mogo-commons/consumer-rules.pro b/foudations/mogo-commons/consumer-rules.pro
index e69de29bb2..e4e113ccaf 100644
--- a/foudations/mogo-commons/consumer-rules.pro
+++ b/foudations/mogo-commons/consumer-rules.pro
@@ -0,0 +1,6 @@
+#-----Foundation-Commons-----
+-keep class com.mogo.commons.data.BaseData.*{*;}
+-keep class com.mogo.commons.voice.VoiceIntentTrack
+-keep class com.mogo.commons.voice.VoiceTrack
+-keep class com.mogo.commons.voice.VoicePreemptType
+-keep interface * implements com.mogo.commons.mvp.IView
\ No newline at end of file
diff --git a/foudations/mogo-commons/proguard-rules.pro b/foudations/mogo-commons/proguard-rules.pro
index f1b424510d..c47b3c8771 100644
--- a/foudations/mogo-commons/proguard-rules.pro
+++ b/foudations/mogo-commons/proguard-rules.pro
@@ -19,3 +19,10 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----Foundation-Commons-----
+-keep class com.mogo.commons.data.BaseData.*{*;}
+-keep class com.mogo.commons.voice.VoiceIntentTrack
+-keep class com.mogo.commons.voice.VoiceTrack
+-keep class com.mogo.commons.voice.VoicePreemptType
+-keep interface * implements com.mogo.commons.mvp.IView
\ No newline at end of file
diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java
index 943ad1417d..360dbb622b 100644
--- a/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java
+++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java
@@ -1,9 +1,7 @@
package com.mogo.commons;
import android.app.Application;
-import android.content.Context;
import android.text.TextUtils;
-import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
@@ -20,11 +18,7 @@ import com.mogo.commons.network.X509TrustManagerImpl;
import com.mogo.commons.storage.SpStorage;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.TipToast;
-import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.NetConfig;
-import com.zhidao.account.sdk.AccountClientManager;
-import com.zhidao.account.sdk.callback.TicketInfoCallback;
-import com.zhidao.account.sdk.network.NetEnvironManager;
import java.io.IOException;
import java.security.SecureRandom;
@@ -98,7 +92,6 @@ public class AbsMogoApplication extends Application {
private void asyncInit() {
ThreadPoolService.execute( () -> {
initNetConfig();
- initAccountSdk();
// 初始化toast
// 初始化埋点
Analytics.getInstance().start( sApp );
@@ -109,36 +102,12 @@ public class AbsMogoApplication extends Application {
AnalyticsConfig.getInstance( sApp ).shouldLog( DebugConfig.isDebug() );
Devices.init( getApp() );
Devices.checkBindState();
+ asyncInitImpl();
} );
}
- private static void initAccountSdk() {
- int mode = DebugConfig.getNetMode();
- if ( mode == DebugConfig.NET_MODE_DEMO ) {
- // 演示环境用 qa 的
- mode = DebugConfig.NET_MODE_QA;
- }
- AccountClientManager.init( sApp, mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
- getTicket( new TicketInfoCallback() {
- @Override
- public void onSuccess( String ticket ) {
- SpStorage.setTicket( ticket );
- Logger.w( TAG, "request ticket success" );
- }
+ protected void asyncInitImpl(){
- @Override
- public void onFailure( int code, String msg ) {
- Logger.w( TAG, "request ticket error code = %d, msg = %s", code, msg );
- }
- } );
- }
-
- private static void getTicket( TicketInfoCallback callback ) {
- if ( DebugConfig.isLauncher() ) {
- AccountClientManager.getTicket( callback );
- } else {
- AccountClientManager.getAppTicket( callback );
- }
}
private static void initNetConfig() {
diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java
index 8d152859ba..fff915fbb3 100644
--- a/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java
+++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java
@@ -7,6 +7,8 @@ import com.mogo.utils.logger.Logger;
* @since 2019-12-23
*
* 各个模块递调试信息控制接口
+ *
+ * 注:该类已经不再是简单的调试配置,已经涉及到功能逻辑了 囧
*/
public class DebugConfig {
@@ -53,6 +55,11 @@ public class DebugConfig {
private static int sNetMode = NET_MODE_RELEASE;
+ /**
+ * 不使用语音助手
+ */
+ public static final int AI_TYPE_NOOP = 0;
+
/**
* 语音使用同行者
*/
@@ -64,6 +71,18 @@ public class DebugConfig {
private static int sAIType = AI_TYPE_TXZ;
+ /**
+ * 自研车机
+ */
+ public static final int CAR_MACHINE_TYPE_SELF_INNOVATE = 0;
+
+ /**
+ * 比亚迪的车机
+ */
+ public static final int CAR_MACHINE_TYPE_BYD = 1;
+
+ private static int sCarMachineType = CAR_MACHINE_TYPE_SELF_INNOVATE;
+
/**
* 获取网络环境类型
*
@@ -115,20 +134,39 @@ public class DebugConfig {
/**
* 设置使用哪个语音助手
- * @param aiType {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
+ *
+ * @param aiType {@link #AI_TYPE_NOOP} {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
*/
- public static void setAIType(int aiType){
- Logger.d("DebugConfig", "setAiType: " + aiType);
+ public static void setAIType( int aiType ) {
+ Logger.d( "DebugConfig", "setAiType: " + aiType );
sAIType = aiType;
}
/**
- * 使用哪个语音助手 {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
+ * 使用哪个语音助手 {@link #AI_TYPE_NOOP} {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
*/
- public static int getAIType(){
+ public static int getAIType() {
return sAIType;
}
+ /**
+ * 设置当前车机类型
+ *
+ * @param type {@link #CAR_MACHINE_TYPE_SELF_INNOVATE} {@link #CAR_MACHINE_TYPE_BYD}
+ */
+ public static void setCarMachineType( int type ) {
+ sCarMachineType = type;
+ }
+
+ /**
+ * 获取当前车机类型
+ *
+ * @return {@link #CAR_MACHINE_TYPE_SELF_INNOVATE} {@link #CAR_MACHINE_TYPE_BYD}
+ */
+ public static int getCarMachineType() {
+ return sCarMachineType;
+ }
+
/**
* 是否作为launcher运行
*/
@@ -164,4 +202,39 @@ public class DebugConfig {
public static void setActiveAIAssistFlag( boolean sActiveAIAssistFlag ) {
DebugConfig.sActiveAIAssistFlag = sActiveAIAssistFlag;
}
+
+ private static boolean useMockObuData;
+
+ public static void setUseMockObuData( boolean use ) {
+ useMockObuData = use;
+ }
+
+ public static boolean isUseMockObuData() {
+ return useMockObuData;
+ }
+
+ private static String sProductFlavor;
+
+ public static String getProductFlavor() {
+ return sProductFlavor;
+ }
+
+ /**
+ * 产品线
+ *
+ * @param sProductFlavor
+ */
+ public static void setProductFlavor( String sProductFlavor ) {
+ DebugConfig.sProductFlavor = sProductFlavor;
+ }
+
+ private static String sSocketAppId;
+
+ public static void setSocketAppId( String sSocketAppId ) {
+ DebugConfig.sSocketAppId = sSocketAppId;
+ }
+
+ public static String getSocketAppId() {
+ return sSocketAppId;
+ }
}
diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java
index 82ed20b2f0..c31eb8b869 100644
--- a/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java
+++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java
@@ -4,9 +4,14 @@ import android.content.Context;
import android.os.Bundle;
import android.view.MotionEvent;
+import android.view.Window;
+import android.view.WindowManager;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
+
+import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.SoftKeyBoardJobber;
/**
@@ -23,6 +28,10 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
@Override
protected void onCreate( @Nullable Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
+ if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD) {
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
setContentView( getLayoutId() );
initViews();
mPresenter = createPresenter();
diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/network/ParamsUtil.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/network/ParamsUtil.java
index 4eb76d1be3..b6645fa28c 100644
--- a/foudations/mogo-commons/src/main/java/com/mogo/commons/network/ParamsUtil.java
+++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/network/ParamsUtil.java
@@ -30,7 +30,7 @@ public class ParamsUtil {
public static Map< String, Object > getDynamicParams() {
Map< String, Object > params = new ArrayMap();
- final Map location = LocationHelper.getInstance().getLocationProperties();
+ final Map< String, Object > location = LocationHelper.getInstance().getLocationProperties();
if ( location != null ) {
params.putAll( location );
}
@@ -71,7 +71,8 @@ public class ParamsUtil {
public static Map< String, Object > getAnalyticsCustomParams() {
Map< String, Object > map = new ArrayMap<>();
map.put( "debug", DebugConfig.isDebug() ? 1 : 0 );
- map.put( "systemversion", Utils.getFotaVersion() );
+ String fota = Utils.getFotaVersion();
+ map.put( "systemversion", TextUtils.isEmpty( fota ) ? DebugConfig.getProductFlavor() : fota );
map.put( "sn", Utils.getSn() );
return map;
}
diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/network/SubscribeImpl.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/network/SubscribeImpl.java
index 26a38797cf..5d9217849e 100644
--- a/foudations/mogo-commons/src/main/java/com/mogo/commons/network/SubscribeImpl.java
+++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/network/SubscribeImpl.java
@@ -3,7 +3,6 @@ package com.mogo.commons.network;
import com.mogo.commons.data.BaseData;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
-import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.network.utils.Util;
import io.reactivex.Observer;
diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/network/Utils.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/network/Utils.java
index 21c8991b5a..90bc9e507d 100644
--- a/foudations/mogo-commons/src/main/java/com/mogo/commons/network/Utils.java
+++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/network/Utils.java
@@ -2,11 +2,17 @@ package com.mogo.commons.network;
import android.Manifest;
import android.content.Context;
+import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.telephony.CellLocation;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
+import android.text.TextUtils;
+
+import com.mogo.commons.AbsMogoApplication;
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.utils.storage.SharedPrefsMgr;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -55,10 +61,15 @@ public class Utils {
public static final String GET = "get";
public static final String GSM_SERIAL = "gsm.serial";
+ public static final String BYD_SERIAL = "ro.serialno";
public static final String FOTA_VERSION = "ro.fota.version";
public static final String PROPERTIES = "android.os.SystemProperties";
public static String getSn() {
+
+ if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
+ return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "allocated_sn" );
+ }
return getSystemProperties( GSM_SERIAL );
}
diff --git a/foudations/mogo-connection/gradle.properties b/foudations/mogo-connection/gradle.properties
deleted file mode 100644
index 3bf188938f..0000000000
--- a/foudations/mogo-connection/gradle.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-GROUP=com.mogo.connection
-POM_ARTIFACT_ID=mogo-connection
-VERSION_CODE=1
diff --git a/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/MsgBody.java b/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/MsgBody.java
deleted file mode 100644
index d2ff058a25..0000000000
--- a/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/MsgBody.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.mogo.connection.socket;
-
-import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
-import com.zhidao.ptech.connsvr.protocol.MogoConnsvr;
-
-/**
- * @author congtaowang
- * @since 2019-12-31
- *
- * 描述
- */
-public class MsgBody {
-
- private int mMsgType;
-
- /**
- * 服务端分发,业务线
- */
- private int mProductLine = MogoCommon.Product.mogoBussiness_VALUE;
-
- /**
- *
- */
- private int mHeaderType = MogoConnsvr.MsgType.mogoMsgTypeDispatchSvrNoRspReq_VALUE;
-
- /**
- * 是否回执
- */
- private boolean mAck = false;
-
- /**
- * 消息ID
- */
- private final long mMsgId = System.currentTimeMillis();
-
- private Object mContent;
-
- public MsgBody msgType( int msgType ) {
- this.mMsgType = msgType;
- return this;
- }
-
- public MsgBody ack( boolean ack ) {
- this.mAck = ack;
- return this;
- }
-
- public MsgBody content( Object content ) {
- this.mContent = content;
- return this;
- }
-
- public int getMsgType() {
- return mMsgType;
- }
-
- public int getProductLine() {
- return mProductLine;
- }
-
- public int getHeaderType() {
- return mHeaderType;
- }
-
- public boolean ismAck() {
- return mAck;
- }
-
- public long getMsgId() {
- return mMsgId;
- }
-
- public Object getContent() {
- return mContent;
- }
-}
diff --git a/foudations/mogo-connection/src/main/res/values/strings.xml b/foudations/mogo-connection/src/main/res/values/strings.xml
deleted file mode 100644
index b965c02986..0000000000
--- a/foudations/mogo-connection/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- mogo-connection
-
diff --git a/foudations/mogo-utils/build.gradle b/foudations/mogo-utils/build.gradle
index bbd4970b27..08408aa350 100644
--- a/foudations/mogo-utils/build.gradle
+++ b/foudations/mogo-utils/build.gradle
@@ -1,5 +1,6 @@
apply plugin: 'com.android.library'
-
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
@@ -30,6 +31,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api rootProject.ext.dependencies.glide
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.glideanno
implementation rootProject.ext.dependencies.glideokhttp3
implementation rootProject.ext.dependencies.supportannos
diff --git a/foudations/mogo-utils/consumer-rules.pro b/foudations/mogo-utils/consumer-rules.pro
index e69de29bb2..8deab7089d 100644
--- a/foudations/mogo-utils/consumer-rules.pro
+++ b/foudations/mogo-utils/consumer-rules.pro
@@ -0,0 +1,5 @@
+#-----MogoUtils-----
+-keep class com.mogo.utils.network.CallerType
+-keep class com.mogo.utils.network.CallerRestrictTo
+-keep class com.mogo.utils.glide.GlideRoundedCornersTransform.CornerType
+-keep class com.mogo.utils.logger.LogLevel
\ No newline at end of file
diff --git a/foudations/mogo-utils/proguard-rules.pro b/foudations/mogo-utils/proguard-rules.pro
index f1b424510d..664ac30532 100644
--- a/foudations/mogo-utils/proguard-rules.pro
+++ b/foudations/mogo-utils/proguard-rules.pro
@@ -19,3 +19,9 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----MogoUtils-----
+-keep class com.mogo.utils.network.CallerType
+-keep class com.mogo.utils.network.CallerRestrictTo
+-keep class com.mogo.utils.glide.GlideRoundedCornersTransform.CornerType
+-keep class com.mogo.utils.logger.LogLevel
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/ThreadPoolService.java b/foudations/mogo-utils/src/main/java/com/mogo/utils/ThreadPoolService.java
index 3cde9bf8a9..9fc2ac60eb 100644
--- a/foudations/mogo-utils/src/main/java/com/mogo/utils/ThreadPoolService.java
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/ThreadPoolService.java
@@ -7,7 +7,7 @@ import java.util.concurrent.ThreadFactory;
public class ThreadPoolService {
private static final ExecutorService SERVICE = Executors.newFixedThreadPool( 3, new ThreadFactoryImpl() );
-
+ private static final ExecutorService SINGLE_THREAD_SERVICE = Executors.newSingleThreadExecutor(new SingleThreadFactoryImpl());
private static class ThreadFactoryImpl implements ThreadFactory {
private static int mCounter = 1;
@@ -18,10 +18,26 @@ public class ThreadPoolService {
}
}
+ /**
+ * 单线程队列执行的ThreadFactory实现,应该只会new一个Thread
+ */
+ private static class SingleThreadFactoryImpl implements ThreadFactory{
+ private static int counter = 1;
+
+ @Override
+ public Thread newThread(Runnable r) {
+ return new Thread(r, "SingleThread - " + counter++);
+ }
+ }
+
private ThreadPoolService() {
}
public static void execute( Runnable task ) {
SERVICE.execute( task );
}
+
+ public static void singleExecute(Runnable task) {
+ SINGLE_THREAD_SERVICE.execute(task);
+ }
}
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDao.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDao.kt
new file mode 100644
index 0000000000..c755822a6b
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDao.kt
@@ -0,0 +1,423 @@
+package com.mogo.utils.sqlite
+
+import android.content.ContentValues
+import android.database.Cursor
+import android.database.sqlite.SQLiteDatabase
+import com.mogo.utils.sqlite.annotation.DbField
+import com.mogo.utils.sqlite.annotation.DbTable
+import java.lang.reflect.Field
+import java.util.*
+
+
+/**
+ *
数据类操作实现
+ *Created by donghongyu on 2019/9/6.
+ */
+//T必须指明上界是Any且不为null,下面会用到反射获取对象实例,默认是Any?
+open class BaseDao : IBaseDao {
+
+ //数据库操作的引用
+ private var sqLiteDatabase: SQLiteDatabase? = null
+ //要操作的数据实体的引用
+ private var entityClass: Class? = null
+ //要操作的数据表名称
+ private var tableName: String? = null
+ //记录数据表是否存在
+ private var isInit = false
+
+ //因为反射会消耗时间,这里使用缓存,进行性能优化
+ //缓存空间(key-字段名,标注的自定义注解 value-成员变量)
+ private var cacheField: HashMap? = null
+
+ override fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class): Boolean {
+ this.sqLiteDatabase = sqLiteDatabase
+ this.entityClass = entityClass
+ //自动建表(只创建一次)
+ if (!isInit) {
+ //获取表名
+ tableName = entityClass.getAnnotation(DbTable::class.java).tableName
+
+ //如果数据库没有建立连接跳出操作防止异常信息
+ if (!sqLiteDatabase.isOpen) {
+ return false
+ }
+
+ //执行Sql进行自动建表
+ val createTableSql = getCreateTableSql()
+ sqLiteDatabase.execSQL(createTableSql)
+
+ //初始化缓存空间
+ cacheField = HashMap()
+ initCacheField()
+
+ //标记已经创建过数据表
+ isInit = true
+ }
+
+ return isInit
+ }
+
+ /**
+ * 初始化字段缓存
+ */
+ private fun initCacheField() {
+ //1.取到所有的列名(查询一个空表获取表结构,不影响性能)
+ if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
+ val sqlQuery = "select * from $tableName limit 1,0"
+ val cursor = sqLiteDatabase!!.rawQuery(sqlQuery, null)
+ //获取所有的列名
+ val columnNames = cursor.columnNames
+ //关闭资源
+ cursor.close()
+ //2.取所有成员名
+ val columnFields = entityClass!!.declaredFields
+ //3.通过两层循环,进行对应关系建立
+ columnNames.forEach ColumnFor@{ columnName ->
+ columnFields.forEach FieldFor@{ columnField ->
+ if (columnName == columnField.getAnnotation(DbField::class.java).fieldName) {
+ columnField.isAccessible = true
+ cacheField!![columnName] = columnField
+ }
+ return@FieldFor
+ }
+ }
+ }
+ }
+
+ /**
+ * 拼装创建数据表的SQL语句
+ */
+ private fun getCreateTableSql(): String? {
+ //create table if not exists tb_name(_id integer,name varchar2(20))
+ val sqlCreateTable = StringBuffer()
+ sqlCreateTable.append("create table if not exists ")
+ sqlCreateTable.append("$tableName (")
+ //反射获取所有的数据对象内的成员变量
+ val fields = entityClass!!.declaredFields
+
+ fields.forEachIndexed { index, field ->
+ //字段名称
+ val columnName = field.getAnnotation(DbField::class.java).fieldName
+ //获取成员变量数据类型
+
+ when (val fieldType = field.type) {
+ String::class.java -> {
+ sqlCreateTable.append("$columnName TEXT,")
+ }
+ Integer::class.java -> {
+ sqlCreateTable.append("$columnName INTEGER,")
+ }
+ Long::class.java -> {
+ sqlCreateTable.append("$columnName BIGINT,")
+ }
+ Double::class.java -> {
+ sqlCreateTable.append("$columnName DOUBLE,")
+ }
+ ByteArray::class.java -> {
+ sqlCreateTable.append("$columnName BLOB,")
+ }
+ else -> {
+ //未知类型
+ throw UnsupportedOperationException("未定义的数据类型:fieldName= $columnName fieldType= $fieldType")
+ }
+ }
+
+ if (index == fields.size - 1) {
+ if (sqlCreateTable.endsWith(","))
+ sqlCreateTable.deleteCharAt(sqlCreateTable.length - 1)
+ }
+ }
+ sqlCreateTable.append(")")
+
+ return sqlCreateTable.toString()
+ }
+
+ /**
+ * 插入数据
+ */
+ override fun insert(entity: T): Long {
+ //1、准备好ContentValues中的数据
+ //2、设置插入的内容
+ val values: ContentValues = getContentValuesForInsert(entity)
+ //3、执行插入
+ return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
+ sqLiteDatabase!!.insert(tableName, null, values)
+ } else {
+ -1
+ }
+ }
+
+ /**
+ * 删除数据
+ */
+ override fun delete(where: T): Int {
+ val condition = Condition(getContentValuesForQuery(where))
+
+ return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
+ //受影响行数
+ sqLiteDatabase!!
+ .delete(
+ tableName,
+ condition.getWhereCause(),
+ condition.getWhereArgs()
+ )
+ } else {
+ -1
+ }
+ }
+
+ /**
+ * 更新数据
+ */
+ override fun update(where: T, newEntity: T): Int {
+ val condition = Condition(getContentValuesForQuery(where))
+
+ return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
+ //受影响行数
+ sqLiteDatabase!!
+ .update(
+ tableName,
+ getContentValuesForInsert(newEntity),
+ condition.getWhereCause(),
+ condition.getWhereArgs()
+ )
+ } else {
+ -1
+ }
+ }
+
+ /**
+ * 查询数据
+ * @param where 查询条件对象,同时也用来初始化对象使用
+ */
+ override fun query(where: T): MutableList {
+ return query(where, null, null, null)
+ }
+
+ /**
+ * 查询数据
+ * @param where 查询条件对象
+ * @param orderBy 排序规则
+ * @param startIndex 开始的位置
+ * @param limit 限制查询得到的数据个数
+ */
+ fun query(where: T, orderBy: String?, startIndex: Int?, limit: Int?): MutableList {
+ //拼接分页语句
+ var limitString: String? = null
+ if (startIndex != null && limit != null) {
+ limitString = "$startIndex,$limit"
+ }
+
+ val condition = Condition(getContentValuesForQuery(where))
+
+ var cursor: Cursor? = null
+
+ //定义查询结果
+ val result = mutableListOf()
+ if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
+ try {
+ //查询数据库
+ cursor = sqLiteDatabase!!
+ .query(
+ tableName,
+ null,
+ condition.getWhereCause(),
+ condition.getWhereArgs(),
+ null,
+ null,
+ orderBy,
+ limitString
+ )
+ //将查到结果添加到返回集合中
+ result.addAll(getQueryResult(cursor, where))
+ } catch (e: Exception) {
+ e.printStackTrace()
+ } finally {
+ cursor?.close()
+ }
+ }
+ return result
+ }
+
+ /**
+ * 获取查询使用的ContentValues
+ */
+ private fun getContentValuesForQuery(entity: T): ContentValues {
+ val contentValues = ContentValues()
+ try {
+ cacheField!!.forEach {
+ if (it.value.get(entity) == null) {
+ return@forEach
+ }
+ contentValues.put(it.key, it.value.get(entity).toString())
+ }
+ } catch (e: IllegalAccessError) {
+ e.printStackTrace()
+ }
+
+ return contentValues
+ }
+
+ /**
+ * 条件拼接
+ */
+ class Condition(whereContent: ContentValues) {
+ /**
+ * 条件拼接
+ * _id=?&&name=?
+ */
+ private var whereCause: String? = null
+
+ private var whereArgs: Array? = null
+
+ //根据传入的contentValues转换成查询条件
+ init {
+ //记录后面填充到查询语句“?”上的数据参数
+ val argList = mutableListOf()
+ //拼接查询语句
+ val whereCaseSb = StringBuilder()
+
+ /**
+ * 是为了链接下面的查询条件条件,也或者是替换没有查询条件的语句。
+ * 比如:要把检索条件作为一个参数传递给SQL,
+ * 那么,当这个检索语句不存在的话就可以给它赋值为1=1.
+ * 这样就避免了SQL出错,也就可以把加条件的SQL和不加条件的SQL合二为一。
+ */
+ whereCaseSb.append(" 1=1 ")
+
+ val keys = whereContent.keySet()
+ val iterator = keys.iterator()
+
+ //因为使用了“1=1”,所以即便是这里没有任何数据拼接,也是可以正常
+ while (iterator.hasNext()) {
+ val key = iterator.next() as String
+ val valueObject = whereContent.get(key)
+ if (valueObject != null) {
+ val value = valueObject as String
+ //拼接查询条件语句
+ //1:1 and _id=? and name=?
+ whereCaseSb.append(" and $key =?")
+
+ //记录?对应的value
+ argList.add(value)
+ }
+ }
+ //集合转成数组
+ this.whereArgs = argList.toTypedArray()
+ this.whereCause = whereCaseSb.toString()
+ }
+
+ fun getWhereCause(): String {
+ return this.whereCause!!
+ }
+
+ fun getWhereArgs(): Array {
+ return this.whereArgs!!
+ }
+ }
+
+ /**
+ * 获取查询db结果
+ */
+ private fun getQueryResult(cursor: Cursor, where: T): MutableList {
+ //定义查询结果
+ val result = mutableListOf()
+ //Cursor从头读到尾
+ //游标从头读到尾
+ cursor.moveToFirst()
+ //移动游标获取下一行数据
+ while (!cursor.isAfterLast) {
+ //通过反射构建一个查询结果对象
+ val item = where.javaClass.newInstance()
+
+ //拿到缓存的当前数据对象的成员变量与数据库的键值关系
+ val fieldIterator = cacheField!!.entries.iterator()
+ fieldIterator.forEach IteratorFor@{
+ //获取数据库字段名称
+ val columnName = it.key
+ //数据库字段名对应的数据对象的成员变量
+ val field = it.value
+ //获取指定列名对应的索引
+ val columnIndex = cursor.getColumnIndex(columnName)
+ //获取成员变量数据类型
+ val fieldType = field.type
+
+ if (columnIndex != -1) {
+ when (fieldType) {
+ String::class.java -> {
+ field.set(item, cursor.getString(columnIndex))
+ }
+ Integer::class.java -> {
+ field.set(item, cursor.getInt(columnIndex))
+ }
+ Long::class.java -> {
+ field.set(item, cursor.getLong(columnIndex))
+ }
+ Double::class.java -> {
+ field.set(item, cursor.getDouble(columnIndex))
+ }
+ ByteArray::class.java -> {
+ field.set(item, cursor.getBlob(columnIndex))
+ }
+ else -> {
+ //未知类型
+ throw UnsupportedOperationException("未定义的数据类型:columnName= $columnName fieldType= $fieldType")
+ }
+ }
+ }
+ }
+ //添加到结果集
+ result.add(item)
+ //移动到下一个位置
+ cursor.moveToNext()
+ }
+ cursor.close()
+ return result
+ }
+
+ /**
+ * 获取插入使用的ContentValues
+ */
+ private fun getContentValuesForInsert(entity: T): ContentValues {
+ val contentValues = ContentValues()
+
+ val fieldIterator = cacheField!!.entries.iterator()
+
+ fieldIterator.forEach IteratorFor@{
+ try {
+ //获取变量的值
+ val valueObject = it.value.get(entity) ?: return@IteratorFor
+ //获取列名
+ val columnName = it.key
+ //获取成员变量数据类型
+ val fieldType = it.value.type
+ when (fieldType) {
+ String::class.java -> {
+ contentValues.put(columnName, valueObject as String)
+ }
+ Integer::class.java -> {
+ contentValues.put(columnName, valueObject as Int)
+ }
+ Long::class.java -> {
+ contentValues.put(columnName, valueObject as Long)
+ }
+ Double::class.java -> {
+ contentValues.put(columnName, valueObject as Double)
+ }
+ ByteArray::class.java -> {
+ contentValues.put(columnName, valueObject as ByteArray)
+ }
+ else -> {
+ //未知类型
+ throw UnsupportedOperationException("未定义的数据类型:columnName= $columnName fieldType= $fieldType")
+ }
+ }
+ } catch (e: IllegalArgumentException) {
+ e.printStackTrace()
+ }
+ }
+
+ return contentValues
+ }
+
+}
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDaoFactory.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDaoFactory.kt
new file mode 100644
index 0000000000..605043bf5a
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDaoFactory.kt
@@ -0,0 +1,74 @@
+package com.mogo.utils.sqlite
+
+import android.content.Context
+import android.database.sqlite.SQLiteDatabase
+import com.mogo.utils.sqlite.annotation.DbDatabase
+import com.mogo.utils.sqlite.proxy.BaseDaoProxyLog
+
+
+/**
+ * 数据库处理工厂
+ * Created by donghongyu on 2019/9/6.
+ */
+open class BaseDaoFactory {
+
+ //默认数据库名称
+ private var dbName = "MoGoSQLite.db"
+
+ companion object {
+ //单利工厂
+ private var baseDaoFactory: BaseDaoFactory? = null
+
+ //数据库存储路径
+ private lateinit var sqLiteDatabasePath: String
+
+ //数据库操作类
+ private var sqLiteDatabase: SQLiteDatabase? = null
+
+ fun getInstance(): BaseDaoFactory {
+ if (baseDaoFactory == null) {
+ synchronized(BaseDaoFactory::class.java) {
+ if (baseDaoFactory == null) {
+ baseDaoFactory = BaseDaoFactory()
+ }
+ }
+ }
+ return baseDaoFactory!!
+ }
+ }
+
+ //获取数据库操作对象
+ fun getBaseDao(context: Context, entityClass: Class): IBaseDao? {
+ var baseDao: IBaseDao? = null
+
+ try {
+ //获取数据库名称,如果没有设置则使用默认名称
+ val dbDatabase = entityClass.getAnnotation(DbDatabase::class.java)
+ if (dbDatabase != null) {
+ dbName = dbDatabase.dbName
+ }
+ //openOrCreateDatabase 如果不存在则先创建再打开数据库,如果存在则直接打开。
+ sqLiteDatabasePath =
+ "${context.getDir("database", Context.MODE_APPEND).path}/$dbName"
+ sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(sqLiteDatabasePath, null)
+
+ // 这里为了演示,添加了日志工具的叠加使用,根据需要可以自己修改
+ // baseDao = BaseDaoProxyShow().bind(BaseDaoProxyLog().bind(BaseDao())) as IBaseDao
+ baseDao = BaseDaoProxyLog().bind(BaseDao()) as IBaseDao
+
+ baseDao.init(sqLiteDatabase!!, entityClass)
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+
+ return baseDao
+ }
+
+ /**
+ * 关闭数据库
+ */
+ fun closeDatabase() {
+ sqLiteDatabase?.close()
+ }
+
+}
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/IBaseDao.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/IBaseDao.kt
new file mode 100644
index 0000000000..7af36200b8
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/IBaseDao.kt
@@ -0,0 +1,35 @@
+package com.mogo.utils.sqlite
+
+import android.database.sqlite.SQLiteDatabase
+
+/**
+ * 操作SQLite数据库的顶层接口
+ * Created by donghongyu on 2019/9/6.
+ */
+interface IBaseDao {
+ /**
+ * 初始化数据库连接
+ */
+ fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class): Boolean
+
+ /**
+ * 将 [entity] 进行数据插入
+ */
+ fun insert(entity: T): Long
+
+ /**
+ * 根据条件 [where] 进行数据删除
+ */
+ fun delete(where: T): Int
+
+ /**
+ * 根据条件 [where] 进行数据更新,如果[where]==null 则代表删除所有数据
+ */
+ fun update(where: T, newEntity: T): Int
+
+ /**
+ * 根据条件 [where] 进行数据查询,如果[where]==null 则代表查询所有数据
+ */
+ fun query(where: T): MutableList
+
+}
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbDatabase.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbDatabase.kt
new file mode 100644
index 0000000000..4fade720b2
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbDatabase.kt
@@ -0,0 +1,15 @@
+package com.mogo.utils.sqlite.annotation
+
+
+/**
+ * 添加在要操作的数据对象名上面,用来设置数据库名称
+ *
+ * /**
+ * * @DbDatabase("AppSQLite.db")
+ * * class UserEntity {}
+ * */
+ * Created by donghongyu on 2019/9/6.
+ */
+@Retention(AnnotationRetention.RUNTIME)
+@Target(AnnotationTarget.CLASS)
+annotation class DbDatabase(val dbName: String)
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbField.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbField.kt
new file mode 100644
index 0000000000..cf63587d32
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbField.kt
@@ -0,0 +1,21 @@
+package com.mogo.utils.sqlite.annotation
+
+
+/**
+ * 添加在要处理的数据对象的字段之上,用来设置数据表的字段名称
+ * /**
+ * *@DbTable("tb_user")
+ * *class UserEntity {
+ * * @DbField("_id")
+ * * var id: Int = 0
+ * * @DbField("name")
+ * * var name: String? = null
+ * * @DbField("password")
+ * * var password: String? = null
+ * *}
+ * */
+ * Created by donghongyu on 2019/9/6.
+ */
+@Retention(AnnotationRetention.RUNTIME)
+@Target(AnnotationTarget.FIELD)
+annotation class DbField(val fieldName: String)
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbTable.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbTable.kt
new file mode 100644
index 0000000000..73aec8445f
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbTable.kt
@@ -0,0 +1,15 @@
+package com.mogo.utils.sqlite.annotation
+
+
+/**
+ * 添加在要操作的数据对象名上面,用来设置数据表名称
+ *
+ * /**
+ * * @DbTable("tb_user")
+ * * class UserEntity {}
+ * */
+ * Created by donghongyu on 2019/9/6.
+ */
+@Retention(AnnotationRetention.RUNTIME)
+@Target(AnnotationTarget.CLASS)
+annotation class DbTable(val tableName: String)
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxy.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxy.kt
new file mode 100644
index 0000000000..f48adc9f79
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxy.kt
@@ -0,0 +1,51 @@
+package com.mogo.utils.sqlite.proxy
+
+import android.database.sqlite.SQLiteDatabase
+import android.util.Log
+import com.mogo.utils.sqlite.IBaseDao
+
+/**
+ * 静态代理数据库操作类,用来记录日志
+ * Created by donghongyu on 2019/9/6.
+ */
+class BaseDaoProxy(var iBaseDao: IBaseDao) : IBaseDao by iBaseDao {
+ override fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class): Boolean {
+ Log.i("数据库代理", "初始化数据库连接……")
+ val isInitSuccess = iBaseDao.init(sqLiteDatabase, entityClass)
+ if (isInitSuccess) {
+ Log.i("数据库代理", "数据库连接成功……")
+ } else {
+ Log.e("数据库代理", "数据库连接失败……")
+ }
+ return isInitSuccess
+ }
+
+ override fun insert(entity: T): Long {
+ Log.i("数据库代理", "开始插入数据……")
+ val result = iBaseDao.insert(entity)
+ Log.i("数据库代理", "插入数据索引位置> $result <……")
+ return result
+ }
+
+ override fun delete(where: T): Int {
+ Log.i("数据库代理", "开始删除数据……")
+ val result = iBaseDao.delete(where)
+ Log.i("数据库代理", "删除了> $result <条数据……")
+ return result
+ }
+
+ override fun update(where: T, newEntity: T): Int {
+ Log.i("数据库代理", "开始更新数据……")
+ val result = iBaseDao.update(where, newEntity)
+ Log.i("数据库代理", "更新了> $result <条数据……")
+ return result
+ }
+
+ override fun query(where: T): MutableList {
+ Log.i("数据库代理", "开始查询数据……")
+ val result = iBaseDao.query(where)
+ Log.i("数据库代理", "查询到> ${result.size} <条数据……")
+ return result
+ }
+
+}
\ No newline at end of file
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyLog.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyLog.kt
new file mode 100644
index 0000000000..d65dd810dd
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyLog.kt
@@ -0,0 +1,50 @@
+package com.mogo.utils.sqlite.proxy
+
+import android.util.Log
+import java.lang.reflect.InvocationHandler
+import java.lang.reflect.Method
+import java.lang.reflect.Proxy
+
+/**
+ * 使用java实现动态代理数据库操作类加入日志功能
+ * Created by donghongyu on 2019/9/6.
+ */
+
+class BaseDaoProxyLog : InvocationHandler {
+
+ private var target: Any? = null
+
+ /**
+ * 绑定委托对象并返回一个【代理占位】
+ *
+ * @param target 真实对象
+ * @return 代理对象【占位】
+ */
+ fun bind(target: Any): Any {
+ this.target = target
+ //取得代理对象
+ return Proxy.newProxyInstance(
+ target.javaClass.classLoader,
+ target.javaClass.interfaces, this
+ )
+ }
+
+ /**
+ * 同过代理对象调用方法首先进入这个方法.
+ *
+ * @param proxy --代理对象
+ * @param method -- 方法,被调用方法.
+ * @param args -- 方法的参数
+ */
+ @Throws(Throwable::class)
+ override fun invoke(proxy: Any, method: Method, args: Array): Any? {
+ var result: Any? = null
+ //反射方法前调用
+ Log.i("数据库代理", "当前执行>>${method.name}")
+ //反射执行方法 相当于调用target.sayHelllo;
+ result = method.invoke(target, *args)
+ //反射方法后调用.
+ Log.i("数据库代理", "执行结果>>$result")
+ return result
+ }
+}
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyShow.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyShow.kt
new file mode 100644
index 0000000000..d924191ba1
--- /dev/null
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyShow.kt
@@ -0,0 +1,49 @@
+package com.mogo.utils.sqlite.proxy
+
+import android.util.Log
+import java.lang.reflect.InvocationHandler
+import java.lang.reflect.Method
+import java.lang.reflect.Proxy
+
+/**
+ * 使用java实现动态代理数据库操作类,加入更多额外的功能,来测试代理类的叠加功能
+ * Created by donghongyu on 2019/9/6.
+ */
+class BaseDaoProxyShow : InvocationHandler {
+
+ private var target: Any? = null
+
+ /**
+ * 绑定委托对象并返回一个【代理占位】
+ *
+ * @param target 真实对象
+ * @return 代理对象【占位】
+ */
+ fun bind(target: Any): Any {
+ this.target = target
+ //取得代理对象
+ return Proxy.newProxyInstance(
+ target.javaClass.classLoader,
+ target.javaClass.interfaces, this
+ )
+ }
+
+ /**
+ * 同过代理对象调用方法首先进入这个方法.
+ *
+ * @param proxy --代理对象
+ * @param method -- 方法,被调用方法.
+ * @param args -- 方法的参数
+ */
+ @Throws(Throwable::class)
+ override fun invoke(proxy: Any, method: Method, args: Array): Any? {
+ var result: Any? = null
+ //反射方法前调用
+ Log.i("数据库代理", "显示执行>>${method.name}")
+ //反射执行方法 相当于调用target.sayHelllo;
+ result = method.invoke(target, *args)
+ //反射方法后调用.
+ Log.i("数据库代理", "执行结果>>$result")
+ return result
+ }
+}
diff --git a/gradle.properties b/gradle.properties
index 316601007d..5f9477869a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,7 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
+#org.gradle.jvmargs=-Xmx1536m
+org.gradle.jvmargs=-Xmx4096m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -17,6 +18,7 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
+org.gradle.parallel=true
## maven 配置
RELEASE_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-releases/
@@ -27,51 +29,51 @@ PASSWORD=xintai2018
RELEASE=false
# 模块版本
## 工程内模块
-MOGO_COMMONS_VERSION=1.2.1.9
-MOGO_UTILS_VERSION=1.2.1.9
-MAP_AMAP_VERSION=1.2.1.9
-MAP_AUTONAVI_VERSION=1.2.1.9
-MOGO_MAP_VERSION=1.2.1.9
-MOGO_MAP_API_VERSION=1.2.1.9
-MOGO_SERVICE_VERSION=1.2.1.9
-MOGO_SERVICE_API_VERSION=1.2.1.9
-MOGO_CONNECTION_VERSION=1.2.1.9
-MOGO_MODULE_APPS_VERSION=1.2.1.9
-MOGO_MODULE_NAVI_VERSION=1.2.1.9
-MOGO_MODULE_SHARE_VERSION=1.2.1.18
-MOGO_MODULE_COMMON_VERSION=1.2.1.9
-MOGO_MODULE_MAIN_VERSION=1.2.1.9
-MOGO_MODULE_MAP_VERSION=1.2.1.9
-MOGO_MODULE_SERVICE_VERSION=1.2.1.9
-MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.9
-MOGO_MODULE_SEARCH_VERSION=1.2.1.9
-MOGO_MODULE_BACK_VERSION=1.2.1.9
-MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.9
-MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.9
-MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.9
-MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.9
-MOGO_MODULE_GUIDE_VERSION=1.2.1.9
-MOGO_MODULE_MEDIA_VERSION=1.2.1.9
-
-MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.9
-MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.9
-
+MOGO_COMMONS_VERSION=1.2.1.22
+MOGO_UTILS_VERSION=1.2.1.22
+MAP_AMAP_VERSION=1.2.1.22
+MAP_AUTONAVI_VERSION=1.2.1.22
+MOGO_MAP_VERSION=1.2.1.22
+MOGO_MAP_API_VERSION=1.2.1.22
+MOGO_SERVICE_VERSION=1.2.1.22
+MOGO_SERVICE_API_VERSION=1.2.1.22
+MOGO_CONNECTION_VERSION=1.2.1.22
+MOGO_MODULE_APPS_VERSION=1.2.1.22
+MOGO_MODULE_NAVI_VERSION=1.2.1.22
+MOGO_MODULE_SHARE_VERSION=1.2.1.22
+MOGO_MODULE_COMMON_VERSION=1.2.1.22
+MOGO_MODULE_MAIN_VERSION=1.2.1.22
+MOGO_MODULE_MAP_VERSION=1.2.1.22
+MOGO_MODULE_SERVICE_VERSION=1.2.1.22
+MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.22
+MOGO_MODULE_SEARCH_VERSION=1.2.1.22
+MOGO_MODULE_BACK_VERSION=1.2.1.22
+MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.22
+MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.22
+MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.22
+MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.22
+MOGO_MODULE_GUIDE_VERSION=1.2.1.22
+MOGO_MODULE_MEDIA_VERSION=1.2.1.22
+MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.22
+MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.22
+MOGO_MODULE_V2X_VERSION=1.2.1.22
+# 基础服务实现:passport、socket、location
+MOGO_BASE_SERVICES_APK_VERSION = 1.2.1.22
+MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
## 工程外部模块
# 探路
-MOGO_MODULE_TANLU_VERSION=1.2.1.15
+MOGO_MODULE_TANLU_VERSION=1.3.1.20
# 车聊聊
-CARCHATTING_VERSION=1.4.6
+CARCHATTING_VERSION=1.4.8
# 车聊聊接口
-CARCHATTINGPROVIDER_VERSION=1.2.0
+CARCHATTINGPROVIDER_VERSION=1.3.4
# 视频引导
MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT
# 视频引导接口
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
# 在线车辆F
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
-# v2x
-MOGO_MODULE_V2X_VERSION=1.1.534
# 推送
MOGO_MODULE_PUSH_VERSION=1.1.5.7
MOGO_MODULE_PUSH_BASE_VERSION=1.1.5.5
@@ -79,13 +81,25 @@ MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6
# 广告资源位
MOGO_MODULE_AD_CARD_VERSION=1.0.1
# 探路上报和分享模块
-TANLULIB_VERSION=1.2.1.15
+TANLULIB_VERSION=1.3.1.20
+MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT
+MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
+#左侧面板模块
+MOGO_MODULE_LEFT_PANEL_VERSION = 1.2.1.10-SNAPSHOT
+MOGO_MODULE_LEFT_PANEL_NOOP_VERSION = 1.2.1.10-SNAPSHOT
# Boost分包
BOOST_MULTIDEX_VERSION=1.0.0
# hook ARouter分包实现
HOOKPLUGIN_VERSION=1.0.0
+# obu
+MOGO_MODULE_OBU_VERSION = 1.2.1.10-SNAPSHOT
+
+# 闪屏页
+MOGO_MODULE_SPLASH_VERSION = 1.0.0-SNAPSHOT
+MOGO_MODULE_SPLASH_NOOP_VERSION = 1.0.0-SNAPSHOT
+
## 产品库必备配置
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
diff --git a/libraries/map-amap/consumer-rules.pro b/libraries/map-amap/consumer-rules.pro
index e69de29bb2..11e9ffd54b 100644
--- a/libraries/map-amap/consumer-rules.pro
+++ b/libraries/map-amap/consumer-rules.pro
@@ -0,0 +1,5 @@
+#-----library-MapAMap-----
+-keep class com.mogo.map.impl.amap.hook.BnHooker.*{*;}
+-keep class com.mogo.map.impl.amap.marker.CombineMovingPointOverlay.Status
+-keep class com.mogo.map.impl.amap.navi.PathPlanningErrorCodeConstants
+-keep class com.mogo.map.impl.amap.utils.MapStyleUtils.ColorEnum
\ No newline at end of file
diff --git a/libraries/map-amap/proguard-rules.pro b/libraries/map-amap/proguard-rules.pro
index f1b424510d..7959227525 100644
--- a/libraries/map-amap/proguard-rules.pro
+++ b/libraries/map-amap/proguard-rules.pro
@@ -19,3 +19,9 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----library-MapAMap-----
+-keep class com.mogo.map.impl.amap.hook.BnHooker.*{*;}
+-keep class com.mogo.map.impl.amap.marker.CombineMovingPointOverlay.Status
+-keep class com.mogo.map.impl.amap.navi.PathPlanningErrorCodeConstants
+-keep class com.mogo.map.impl.amap.utils.MapStyleUtils.ColorEnum
\ No newline at end of file
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 b02cbfaee4..aef3a1b430 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
@@ -321,6 +321,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
@Override
public void onNaviMapMode( int mode ) {
Logger.i( TAG, "mode=" + mode );
+ MogoMapListenerHandler.getInstance().onMapModeChanged( mode == 0 ? EnumMapUI.CarUp_2D : EnumMapUI.NorthUP_2D );
}
@Override
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java
index c373965b87..8935812bcd 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java
@@ -10,7 +10,9 @@ import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MarkerOptions;
+import com.amap.api.maps.model.animation.AlphaAnimation;
import com.amap.api.maps.model.animation.Animation;
+import com.amap.api.maps.model.animation.AnimationSet;
import com.amap.api.maps.model.animation.ScaleAnimation;
import com.amap.api.maps.model.animation.TranslateAnimation;
import com.amap.api.maps.utils.overlay.MovingPointOverlay;
@@ -382,6 +384,47 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
mMarker.startAnimation();
}
+ @Override
+ public void startScaleAnimationWithAlpha( float fromX, float toX, float fromY, float toY, float fromAlpha, float toAlpha, int duration, Interpolator interpolator, OnMarkerAnimationListener listener ) {
+ if ( isDestroyed() ) {
+ return;
+ }
+
+ ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
+ animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
+
+ AlphaAnimation alphaAnimation = new AlphaAnimation( fromAlpha, toAlpha );
+ alphaAnimation.setFillMode( Animation.FILL_MODE_FORWARDS );
+
+ AnimationSet animationSet = new AnimationSet( true );
+ animationSet.setDuration( duration );
+ animationSet.setInterpolator( interpolator);
+ animationSet.setAnimationListener( new Animation.AnimationListener() {
+ @Override
+ public void onAnimationStart() {
+ if ( isDestroyed() ) {
+ return;
+ }
+ if ( listener != null ) {
+ listener.onAnimStart();
+ }
+ }
+
+ @Override
+ public void onAnimationEnd() {
+ if ( isDestroyed() ) {
+ return;
+ }
+ if ( listener != null ) {
+ listener.onAnimEnd();
+ }
+ }
+ } );
+
+ mMarker.setAnimation( animationSet );
+ mMarker.startAnimation();
+ }
+
@Override
public void startJumpAnimation( float high, long duration, Interpolator interpolator, OnMarkerAnimationListener listener ) {
if ( isDestroyed() || high <= 0.0f || interpolator == null || duration < 0 ) {
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java
index fe16b38c0e..ab14875e9e 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java
@@ -66,7 +66,7 @@ public abstract class AMapNaviListenerAdapter implements AMapNaviListener {
public void onGetNavigationText( String s ) {
mLastSpeakWord = s;
Logger.d( TAG, s );
- TTSSpeaker.getInstance().speakTTS( s );
+// TTSSpeaker.getInstance().speakTTS( s );
}
@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 82b151c0a2..963a177155 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
@@ -11,6 +11,7 @@ import com.amap.api.navi.enums.AimLessMode;
import com.amap.api.navi.enums.NaviType;
import com.amap.api.navi.model.NaviLatLng;
import com.mogo.commons.AbsMogoApplication;
+import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.impl.amap.AMapWrapper;
@@ -78,7 +79,7 @@ public class NaviClient implements IMogoNavi {
mContext = context;
mAMapNavi = AMapNavi.getInstance( context );
mAMapNavi.setEmulatorNaviSpeed( 120 );
- mAMapNavi.setUseInnerVoice( false, true );
+ mAMapNavi.setUseInnerVoice( DebugConfig.isUseCustomNavi(), true );
mAMapNaviListener = new NaviListenerAdapter( context, mAMapNavi, this );
mAimlessModeListener = new AimlessModeListenerAdapter() {
};
diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-ldpi/map_api_ic_current_location2.png
new file mode 100644
index 0000000000..5d2d79c7e5
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable-ldpi/map_api_ic_current_location2.png differ
diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-mdpi/map_api_ic_current_location2.png
new file mode 100644
index 0000000000..5d2d79c7e5
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable-mdpi/map_api_ic_current_location2.png differ
diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png
new file mode 100644
index 0000000000..06fb9a934e
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png differ
diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png
new file mode 100644
index 0000000000..c24c56f3db
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png differ
diff --git a/libraries/mogo-map-api/consumer-rules.pro b/libraries/mogo-map-api/consumer-rules.pro
index e69de29bb2..0bd44f06e8 100644
--- a/libraries/mogo-map-api/consumer-rules.pro
+++ b/libraries/mogo-map-api/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----library-MapApi----
+-keep class com.mogo.map.**{*;}
\ No newline at end of file
diff --git a/libraries/mogo-map-api/proguard-rules.pro b/libraries/mogo-map-api/proguard-rules.pro
index f1b424510d..9ce36f6363 100644
--- a/libraries/mogo-map-api/proguard-rules.pro
+++ b/libraries/mogo-map-api/proguard-rules.pro
@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----library-MapApi----
+-keep class com.mogo.map.**{*;}
\ No newline at end of file
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarker.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarker.java
index 7cb519b426..8301124d8b 100644
--- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarker.java
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarker.java
@@ -267,9 +267,33 @@ public interface IMogoMarker {
Interpolator interpolator,
OnMarkerAnimationListener listener );
+ /**
+ * 缩放动画
+ *
+ * @param fromX
+ * @param toX
+ * @param fromY
+ * @param toY
+ * @param fromAlpha
+ * @param toAlpha
+ * @param duration
+ * @param interpolator
+ * @param listener
+ */
+ void startScaleAnimationWithAlpha( float fromX,
+ float toX,
+ float fromY,
+ float toY,
+ float fromAlpha,
+ float toAlpha,
+ int duration,
+ Interpolator interpolator,
+ OnMarkerAnimationListener listener );
+
/**
* 弹跳动画
+ *
* @param high
* @param duration
* @param interpolator
@@ -278,7 +302,7 @@ public interface IMogoMarker {
void startJumpAnimation( float high,
long duration,
Interpolator interpolator,
- OnMarkerAnimationListener listener);
+ OnMarkerAnimationListener listener );
/**
* 是否是否可点击
diff --git a/libraries/mogo-map-api/src/main/res/drawable-ldpi/map_api_ic_current_location2.png b/libraries/mogo-map-api/src/main/res/drawable-ldpi/map_api_ic_current_location2.png
index 5219b2f620..5d2d79c7e5 100644
Binary files a/libraries/mogo-map-api/src/main/res/drawable-ldpi/map_api_ic_current_location2.png and b/libraries/mogo-map-api/src/main/res/drawable-ldpi/map_api_ic_current_location2.png differ
diff --git a/libraries/mogo-map-api/src/main/res/drawable-mdpi/map_api_ic_current_location2.png b/libraries/mogo-map-api/src/main/res/drawable-mdpi/map_api_ic_current_location2.png
index 5219b2f620..5d2d79c7e5 100644
Binary files a/libraries/mogo-map-api/src/main/res/drawable-mdpi/map_api_ic_current_location2.png and b/libraries/mogo-map-api/src/main/res/drawable-mdpi/map_api_ic_current_location2.png differ
diff --git a/libraries/mogo-map-api/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png b/libraries/mogo-map-api/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png
new file mode 100644
index 0000000000..06fb9a934e
Binary files /dev/null and b/libraries/mogo-map-api/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png differ
diff --git a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png
index a293f02f62..c24c56f3db 100644
Binary files a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png and b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png differ
diff --git a/libraries/mogo-map/consumer-rules.pro b/libraries/mogo-map/consumer-rules.pro
index e69de29bb2..a742829747 100644
--- a/libraries/mogo-map/consumer-rules.pro
+++ b/libraries/mogo-map/consumer-rules.pro
@@ -0,0 +1,4 @@
+#-----MogoMap-----
+-keep class com.mogo.map.MogoNavi{
+ private ();
+}
\ No newline at end of file
diff --git a/libraries/mogo-map/proguard-rules.pro b/libraries/mogo-map/proguard-rules.pro
index f1b424510d..f10712073b 100644
--- a/libraries/mogo-map/proguard-rules.pro
+++ b/libraries/mogo-map/proguard-rules.pro
@@ -19,3 +19,8 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----MogoMap-----
+-keep class com.mogo.map.MogoNavi{
+ private ();
+}
diff --git a/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java b/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java
index 92368debb3..f085d39fdb 100644
--- a/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java
+++ b/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java
@@ -6,7 +6,11 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.main.MainActivity;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
/**
* 针对独立应用形式,做单独定制
@@ -27,11 +31,7 @@ public class MainIndependentActivity extends MainActivity {
FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() );
entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
mEntrance.setLayoutParams( entranceParams );
-
- FrameLayout.LayoutParams headerParams = ( ( FrameLayout.LayoutParams ) mHeader.getLayoutParams() );
- headerParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_header_fragment_container_marginLeft );
- mHeader.setLayoutParams( headerParams );
-
+ mLeftShadowFrame.setVisibility(View.VISIBLE);
mApps.setVisibility( View.GONE );
}
diff --git a/main-extensions/mogo-module-main-independent/src/main/res/values-xhdpi-1920x1000/dimens.xml b/main-extensions/mogo-module-main-independent/src/main/res/values-xhdpi-1920x1000/dimens.xml
new file mode 100644
index 0000000000..c436f9daca
--- /dev/null
+++ b/main-extensions/mogo-module-main-independent/src/main/res/values-xhdpi-1920x1000/dimens.xml
@@ -0,0 +1,5 @@
+
+
+ 635px
+ 366px
+
\ No newline at end of file
diff --git a/modules/mogo-module-apps/README.md b/modules/mogo-module-apps/README.md
new file mode 100644
index 0000000000..d1169f3461
--- /dev/null
+++ b/modules/mogo-module-apps/README.md
@@ -0,0 +1 @@
+# 应用列表 + Launcher 模式下的左侧导航按钮
\ No newline at end of file
diff --git a/modules/mogo-module-apps/build.gradle b/modules/mogo-module-apps/build.gradle
index e9dc018ba2..fa04f473f9 100644
--- a/modules/mogo-module-apps/build.gradle
+++ b/modules/mogo-module-apps/build.gradle
@@ -45,7 +45,6 @@ dependencies {
implementation rootProject.ext.dependencies.material
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.androidxrecyclerview
- implementation rootProject.ext.dependencies.guideshowprovider
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogomap
diff --git a/modules/mogo-module-apps/consumer-rules.pro b/modules/mogo-module-apps/consumer-rules.pro
index e69de29bb2..aad1b810ba 100644
--- a/modules/mogo-module-apps/consumer-rules.pro
+++ b/modules/mogo-module-apps/consumer-rules.pro
@@ -0,0 +1,4 @@
+#-----AppModule-----
+-keep class com.mogo.module.apps.model.AppEnum
+-keep class com.mogo.module.apps.view.**{*;}
+-keep class com.mogo.module.apps.AppFilter
\ No newline at end of file
diff --git a/modules/mogo-module-apps/proguard-rules.pro b/modules/mogo-module-apps/proguard-rules.pro
index 8100159367..66c1a6013a 100644
--- a/modules/mogo-module-apps/proguard-rules.pro
+++ b/modules/mogo-module-apps/proguard-rules.pro
@@ -19,3 +19,8 @@
# If you keep the line number information, uncomment this to
# hide the original source file mName.
#-renamesourcefileattribute SourceFile
+
+#-----AppModule-----
+-keep class com.mogo.module.apps.model.AppEnum
+-keep class com.mogo.module.apps.view.** {*;}
+-keep class com.mogo.module.apps.AppFilter
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppServiceHandler.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppServiceHandler.java
index 9bf52fd3b0..043d2cd2bf 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppServiceHandler.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppServiceHandler.java
@@ -4,22 +4,10 @@ import android.content.Context;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.AbsMogoApplication;
-import com.mogo.map.location.IMogoLocationClient;
-import com.mogo.map.marker.IMogoMarkerManager;
-import com.mogo.map.navi.IMogoNavi;
-import com.mogo.map.uicontroller.IMogoMapUIController;
-import com.mogo.module.common.entity.MarkerResponse;
-import com.mogo.module.common.entity.MarkerShowEntity;
-import com.mogo.module.guideshow.provider.GuideShowProviderConstant;
-import com.mogo.module.guideshow.provider.IGuideShowProvider;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.cardmanager.IMogoCardManager;
-import com.mogo.service.connection.IMogoSocketManager;
-import com.mogo.service.imageloader.IMogoImageloader;
-import com.mogo.service.map.IMogoMapService;
-import com.mogo.service.statusmanager.IMogoStatusManager;
/**
* author : zyz
@@ -35,13 +23,11 @@ public class AppServiceHandler {
private static IMogoServiceApis mApis;
private static IMogoCardManager mMogoCardManager;
private static IMogoAnalytics mMogoAnalytics;
- private static IGuideShowProvider mMogoGuideShow;
public static void init( final Context context ) {
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( context );
mMogoCardManager = mApis.getCardManagerApi();
mMogoAnalytics = mApis.getAnalyticsApi();
- mMogoGuideShow = ( IGuideShowProvider ) ARouter.getInstance().build( GuideShowProviderConstant.GUIDE_SHOW_PROVIDER ).navigation( context );
}
@@ -53,10 +39,6 @@ public class AppServiceHandler {
return mMogoAnalytics;
}
- public static IGuideShowProvider getMogoGuideShow() {
- return mMogoGuideShow;
- }
-
public static IMogoServiceApis getApis() {
if ( mApis == null ) {
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( AbsMogoApplication.getApp() );
diff --git a/modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_guide_show.png b/modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_guide_show.png
deleted file mode 100644
index a919bbfb36..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_guide_show.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_guide_show.png b/modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_guide_show.png
deleted file mode 100644
index a919bbfb36..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_guide_show.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist.png
deleted file mode 100755
index 45e7c7fc5e..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist.webp
new file mode 100644
index 0000000000..32392f303e
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_aux.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_aux.png
deleted file mode 100755
index 662299b4f9..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_aux.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_aux.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_aux.webp
new file mode 100644
index 0000000000..80c50e4172
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_aux.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt.png
deleted file mode 100755
index 253cd8d7c5..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt.webp
new file mode 100644
index 0000000000..7007b6b849
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_music.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_music.png
deleted file mode 100644
index 2c73d6b637..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_music.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_music.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_music.webp
new file mode 100644
index 0000000000..6778d03293
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_music.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_phone.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_phone.png
deleted file mode 100644
index a40e2586d7..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_phone.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_phone.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_phone.webp
new file mode 100644
index 0000000000..210f7ab524
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_bt_phone.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_canbus.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_canbus.png
deleted file mode 100644
index 38adc0866e..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_canbus.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_canbus.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_canbus.webp
new file mode 100644
index 0000000000..f7ffe16471
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_canbus.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.png
deleted file mode 100644
index 58aba30002..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.webp
new file mode 100644
index 0000000000..104dda808f
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_settings.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_settings.png
deleted file mode 100644
index bb7ed874fb..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_settings.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_settings.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_settings.webp
new file mode 100644
index 0000000000..64ac80ec89
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_settings.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_carcorder.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_carcorder.png
deleted file mode 100755
index c949e8c480..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_carcorder.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_carcorder.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_carcorder.webp
new file mode 100644
index 0000000000..cb9baebbac
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_carcorder.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat.png
deleted file mode 100755
index bff714a2cd..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat.webp
new file mode 100644
index 0000000000..6217103ade
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_clean_master.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_clean_master.png
deleted file mode 100755
index 359595a620..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_clean_master.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_clean_master.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_clean_master.webp
new file mode 100644
index 0000000000..ede7031fbd
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_clean_master.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fleet.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fleet.png
deleted file mode 100755
index 81a6911102..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fleet.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fleet.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fleet.webp
new file mode 100644
index 0000000000..e55dceca76
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fleet.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fresh_things.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fresh_things.png
deleted file mode 100755
index 3cbdfd1de4..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fresh_things.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fresh_things.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fresh_things.webp
new file mode 100644
index 0000000000..b9b058a124
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fresh_things.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_guide_show.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_guide_show.png
deleted file mode 100644
index c216b6ef9f..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_guide_show.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_im.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_im.png
deleted file mode 100755
index cb9eb9753d..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_im.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_im.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_im.webp
new file mode 100644
index 0000000000..5a7081f4e7
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_im.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_personal_center.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_personal_center.png
deleted file mode 100644
index cf052258e8..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_personal_center.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_personal_center.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_personal_center.webp
new file mode 100644
index 0000000000..af0a6f12ec
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_personal_center.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_road_condition.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_road_condition.png
deleted file mode 100755
index cc9c20ad21..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_road_condition.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_road_condition.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_road_condition.webp
new file mode 100644
index 0000000000..3ee10f5b5d
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_road_condition.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_weather.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_weather.png
deleted file mode 100644
index 3f610a671d..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_weather.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_weather.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_weather.webp
new file mode 100644
index 0000000000..5d534a5198
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_weather.webp differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_wechat.png b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_wechat.png
deleted file mode 100755
index 413fdd812d..0000000000
Binary files a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_wechat.png and /dev/null differ
diff --git a/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_wechat.webp b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_wechat.webp
new file mode 100644
index 0000000000..97af1fc366
Binary files /dev/null and b/modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_wechat.webp differ
diff --git a/modules/mogo-module-authorize/build.gradle b/modules/mogo-module-authorize/build.gradle
index f1cf437d8a..8f19f33858 100644
--- a/modules/mogo-module-authorize/build.gradle
+++ b/modules/mogo-module-authorize/build.gradle
@@ -1,9 +1,8 @@
apply plugin: 'com.android.library'
-apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
apply plugin: 'com.alibaba.arouter'
-apply plugin: 'android-aspectjx'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -51,7 +50,6 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
- implementation rootProject.ext.dependencies.aspectj
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
diff --git a/modules/mogo-module-authorize/consumer-rules.pro b/modules/mogo-module-authorize/consumer-rules.pro
index e69de29bb2..5668c1b3ca 100644
--- a/modules/mogo-module-authorize/consumer-rules.pro
+++ b/modules/mogo-module-authorize/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----AuthorizeModule-----
+-keep class com.mogo.module.authorize.module.bean.**{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/proguard-rules.pro b/modules/mogo-module-authorize/proguard-rules.pro
index f1b424510d..ff909a2e24 100644
--- a/modules/mogo-module-authorize/proguard-rules.pro
+++ b/modules/mogo-module-authorize/proguard-rules.pro
@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----AuthorizeModule-----
+-keep class com.mogo.module.authorize.module.bean.**{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/aspectj/VoiceForbiddenWhenAuthorize.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/aspectj/VoiceForbiddenWhenAuthorize.kt
deleted file mode 100644
index c64cf27a3d..0000000000
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/aspectj/VoiceForbiddenWhenAuthorize.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.mogo.module.authorize.aspectj
-
-import org.aspectj.lang.annotation.Aspect
-import org.aspectj.lang.annotation.Pointcut
-
-@Aspect
-class VoiceForbiddenWhenAuthorize {
-
- companion object{
- const val TAG = "VoiceForbiddenWhenAuthorize"
- }
-
- @Pointcut()
- fun authorizeTrackPoint(){
-
- }
-}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt
index 055f1ee6ed..5e2ad53c7d 100644
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt
@@ -131,6 +131,7 @@ open class IMogoAuthorizeController {
}
}
onError {
+ //todo
Logger.d(TAG, it.message ?: "checkIfNeedAuthorize onError, message is null")
setAuthorizeStatus(agreementType, true)
}
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt
index a5e97c2cda..6c91ab12fc 100644
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt
@@ -6,8 +6,6 @@ import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListen
import com.mogo.module.authorize.model.proxy.AuthorizeProxy
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.needAuthorization
-import com.mogo.module.authorize.util.SharedPreferenceUtil.setAuthorizeStatus
-import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.utils.logger.Logger
open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
@@ -19,13 +17,9 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() }
override fun needAuthorize(tag: String): Boolean {
- return if (isDeviceOfD()) {
- Logger.d(TAG, "===== needAuthorize update agreement in background")
- baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
- needAuthorization(tag.toAuthorizeType())
- } else {
- false
- }
+ Logger.d(TAG, "===== needAuthorize update agreement in background")
+ baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
+ return needAuthorization(tag.toAuthorizeType())
}
override fun updateAuthorizeStatus(tag: String) {
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt
index f234fad44f..beac0c0246 100644
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt
@@ -9,24 +9,23 @@ import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.location.IMogoLocationListener
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.navi.IMogoNaviListener
-import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_FRAGMENT
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
-import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
-import com.mogo.module.authorize.util.isDeviceOfD
+import com.mogo.service.MogoServicePaths
+import com.mogo.service.auth.IMogoAuthManager
import com.mogo.service.module.IMogoModuleLifecycle
-import com.mogo.service.module.IMogoModuleProvider
-import com.mogo.service.module.ModuleType
import com.mogo.utils.logger.Logger
-@Route(path = PATH_AGREEMENT_FRAGMENT)
-class MogoAuthorizeProvider : IMogoModuleProvider {
+@Route(path = MogoServicePaths.PATH_AGREEMENT)
+class MogoAuthorizeProvider : IMogoAuthManager {
companion object {
const val TAG = "MogoAuthorizeProvider"
}
+ private var mContext:Context? = null
+
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
return null
}
@@ -48,7 +47,7 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
override fun getType(): Int {
- return ModuleType.TYPE_SERVICE
+ return 0
}
override fun getNaviListener(): IMogoNaviListener? {
@@ -63,11 +62,10 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
return null
}
- override fun init(context: Context) {
- //todo 引导判断暂时去掉 后续引导流程更改完再放开
-// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
- if (isDeviceOfD() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
- mogoAuthShow.invokeAuthorizeForShow(context)
+ override fun showAuth(context: Context?) {
+ mContext = context
+ if (mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
+ mogoAuthShow.invokeAuthorizeForShow(mContext!!)
} else {
//首次进入Launcher同步一下授权状态,防止由于用户清除数据造成首次加载还会出现授权状态不同步问题
mogoAuthShow.updateAuthorizeStatus(AUTHORIZE_TYPE_LAUNCHER_MAIN)
@@ -75,6 +73,16 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
}
+ override fun dismiss() {
+ mogoAuthShow.hideAuthorizeView()
+ }
+
+ override fun init(context: Context) {
+ //todo 引导判断暂时去掉 后续引导流程更改完再放开
+// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
+ // todo F系列暂时没有授权功能 1.1需求中添加 全量上
+ }
+
override fun getAppPackage(): String? {
return null
}
@@ -82,4 +90,5 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
override fun getAppName(): String? {
return null
}
+
}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt
index d41c4df56e..3da6930843 100644
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt
@@ -6,11 +6,6 @@ class AuthorizeConstant {
const val PROVIDER_MODULE = "/authorize/biz"
const val PROVIDER_LAUNCHER = "/authorize/showbiz"
- /**
- * 展示用户协议模块地址
- */
- const val PATH_AGREEMENT_FRAGMENT = "/agreement/showFragment"
-
/**
* provider模块实例名称(暂时仅有卡片用到)
*/
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt
index 933e83abcf..964594e655 100644
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt
@@ -2,15 +2,12 @@ package com.mogo.module.authorize.authprovider.launcher
import android.content.Context
import android.os.Looper
-import com.mogo.commons.AbsMogoApplication
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
-import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
-import com.mogo.module.authorize.layout.AuthorizeLayout
+import com.mogo.module.authorize.layout.AuthorizeDialog
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth
-import com.mogo.module.common.wm.WindowManagerView
import com.mogo.utils.logger.Logger
class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeMainProvider {
@@ -24,7 +21,9 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
}
}
- private var windowManagerView: WindowManagerView? = null
+ private var mContext: Context? = null
+
+ private var authorizeDialog: AuthorizeDialog? = null
override fun hasRegister(tag: String): Boolean {
if (tag.isNullOrBlank()) return false
@@ -41,7 +40,8 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
}
fun invokeAuthorizeForShow(context: Context) {
- pushLayoutToMainWindow(context, AUTHORIZE_TYPE_LAUNCHER_MAIN)
+ mContext = context
+ pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
}
fun showAuthorizeView(tag: String, forbiddenVoice: (() -> Unit), onError: ((String) -> Unit)) {
@@ -64,25 +64,28 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
Logger.d(TAG, "ready to forbidden voice")
forbiddenVoice.invoke()
Logger.d(TAG, "ready to push fragment")
- pushLayoutToMainWindow(AbsMogoApplication.getApp().applicationContext,tag)
+ pushLayoutToMainWindow(tag)
}
fun hideAuthorizeView() {
- windowManagerView?.dismiss()
+ if (authorizeDialog != null && authorizeDialog!!.isShowing) {
+ authorizeDialog?.dismiss()
+ }
}
- private fun pushLayoutToMainWindow(context: Context,tag: String) {
- if (windowManagerView == null) {
- val authorizeLayout = AuthorizeLayout(tag)
- val view = authorizeLayout.getLayoutView()
- windowManagerView = WindowManagerView.Builder(context).contentView(view).build()
+ private fun pushLayoutToMainWindow(tag: String) {
+ if (authorizeDialog == null) {
+ authorizeDialog = AuthorizeDialog(tag, mContext!!)
+ authorizeDialog!!.setOnDismissListener {
+ authorizeDialog = null
+ }
}
- if (windowManagerView!!.isShowing) {
+ if (authorizeDialog!!.isShowing) {
Logger.d(TAG, "User is operation authorization, do not repeat invoke")
return
} else {
Logger.d(TAG, "pushLayoutToMainWindow")
- windowManagerView!!.show()
+ authorizeDialog!!.show()
}
}
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeDialog.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeDialog.kt
new file mode 100644
index 0000000000..5d74894005
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeDialog.kt
@@ -0,0 +1,203 @@
+package com.mogo.module.authorize.layout
+
+import android.content.Context
+import android.text.Html
+import android.view.View
+import android.widget.Button
+import android.widget.TextView
+import androidx.constraintlayout.widget.ConstraintLayout
+import com.mogo.commons.AbsMogoApplication
+import com.mogo.commons.debug.DebugConfig
+import com.mogo.module.authorize.R
+import com.mogo.module.authorize.util.AnalyticsUtil
+import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener
+import com.mogo.module.authorize.voice.IVoiceCommandListener
+import com.mogo.module.authorize.voice.VoiceUtil
+import com.mogo.module.common.dialog.BaseFloatDialog
+import com.mogo.utils.TipToast
+import com.mogo.utils.logger.Logger
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.async
+import kotlinx.coroutines.withContext
+
+class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandListener, IVoiceAuthorizeIntentListener {
+
+ companion object {
+ const val TAG = "AuthorizeDialog"
+ }
+
+ private var mContext: Context? = null
+ private var invokeTag: String? = null
+
+ private var agreementId: Long = 0L
+
+ private var clTopParent: ConstraintLayout? = null
+ private var clErrorContainer: ConstraintLayout? = null
+ private var clLoadAuthorizeContainer: ConstraintLayout? = null
+ private var clContainer: ConstraintLayout? = null
+ private var clAuthorizeLoading: ConstraintLayout? = null
+ private var btnAgree: Button? = null
+ private var btnDisAgree: Button? = null
+ private var btnLoadingError: Button? = null
+ private var tvTitle: TextView? = null
+ private var tvContent: TextView? = null
+ private var tvButtonContent: TextView? = null
+ private var tvLastContent: TextView? = null
+
+ private var authorizeController: AuthorizeController? = null
+
+ constructor(invokeTag: String, context: Context) : super(context) {
+ mContext = context
+ this.invokeTag = invokeTag
+ initView()
+ }
+
+ private fun initView() {
+ setContentView(R.layout.module_authorize_fragment)
+ setWrapContent()
+ initViews()
+ }
+
+ private fun setWrapContent() {
+ val mWindow = window
+ if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
+ if (mWindow != null) {
+ val lp = mWindow.attributes
+ lp.width = 1024
+ lp.height = 600
+ mWindow.attributes = lp
+ }
+ }else{
+ if (mWindow != null) {
+ val lp = mWindow.attributes
+ lp.width = 1920
+ lp.height = 1000
+ mWindow.attributes = lp
+ }
+ }
+ }
+
+ fun initViews() {
+ Logger.d(TAG, "initView ")
+ AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW)
+ init()
+ Logger.d(TAG, "invokeTag :$invokeTag")
+ authorizeController = AuthorizeController(invokeTag!!)
+ invokeAuthorizationContent()
+ VoiceUtil.registerAll(this, this)
+ }
+
+ private fun init() {
+ clTopParent = findViewById(R.id.clAuthorizeTopParent)
+ clErrorContainer = findViewById(R.id.clLoadingErrorContainer)
+ clLoadAuthorizeContainer = findViewById(R.id.clLoadingAuthorizeContainer)
+ clContainer = findViewById(R.id.clAuthorizeContainer)
+ clAuthorizeLoading = findViewById(R.id.clAuthorizeLoading)
+ btnAgree = findViewById(R.id.btnAuthorizeAgree)
+ btnDisAgree = findViewById(R.id.btnAuthorizeDisAgree)
+ btnLoadingError = findViewById(R.id.btnAuthorizeLoadingError)
+ tvTitle = findViewById(R.id.tvAuthorizeTitle)
+ tvContent = findViewById(R.id.tvAuthorizeContent)
+ tvButtonContent = findViewById(R.id.tvAuthorizeButtonContent)
+ tvLastContent = findViewById(R.id.tvAuthorizeLastContent)
+ btnAgree?.setOnClickListener(this)
+ btnDisAgree?.setOnClickListener(this)
+ btnLoadingError?.setOnClickListener(this)
+ clTopParent?.setOnClickListener(this)
+ clContainer?.setOnClickListener(this)
+ clErrorContainer?.setOnClickListener(this)
+ clLoadAuthorizeContainer?.setOnClickListener(this)
+ clAuthorizeLoading?.setOnClickListener(this)
+ }
+
+ private fun readyToAuthorize() {
+ clErrorContainer?.visibility = View.GONE
+ clLoadAuthorizeContainer?.visibility = View.VISIBLE
+ }
+
+ private fun showAuthorizationAgreementContent(
+ agreementId: Long,
+ agreementContent: String,
+ agreementTitle: String,
+ agreementBottom: String,
+ agreementLast: String) {
+ VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.resources.getString(R.string.module_authorize_agreement_tip), AbsMogoApplication.getApp().applicationContext, this)
+ this.agreementId = agreementId
+ clLoadAuthorizeContainer?.visibility = View.GONE
+ clContainer?.visibility = View.VISIBLE
+ tvTitle?.text = Html.fromHtml(agreementTitle)
+ GlobalScope.async(Dispatchers.IO) {
+ val spannable = Html.fromHtml(agreementContent)
+ withContext(Dispatchers.Main) {
+ tvContent?.text = spannable
+ }
+ }
+ tvButtonContent?.text = Html.fromHtml(agreementBottom)
+ tvLastContent?.text = Html.fromHtml(agreementLast)
+ }
+
+ private fun showAuthorizationError() {
+ clLoadAuthorizeContainer?.visibility = View.GONE
+ clErrorContainer?.visibility = View.VISIBLE
+ }
+
+ private fun voiceAuthorizeError() {
+ TipToast.shortTip("授权失败,请稍后重试")
+ VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.getString(R.string.module_authorize_failed), AbsMogoApplication.getApp().applicationContext, this)
+ Logger.d(TAG, "onDestroy")
+ VoiceUtil.unregisterAll(AbsMogoApplication.getApp().applicationContext, this)
+ }
+
+ override fun onClick(v: View) {
+ when (v.id) {
+ R.id.btnAuthorizeAgree -> {
+ AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 1))
+ agreeAuthorize()
+ }
+ R.id.btnAuthorizeDisAgree -> {
+ AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 2))
+ disAgreeAuthorize()
+ }
+ R.id.clLoadingErrorContainer, R.id.btnAuthorizeLoadingError -> {
+ invokeAuthorizationContent()
+ }
+ R.id.clAuthorizeTopParent -> {
+ Logger.i(TAG, "dismiss authorizeView")
+ authorizeController?.onDestroy()
+ }
+ }
+ }
+
+ override fun onVoiceCmdAgree() {
+ AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 1))
+ agreeAuthorize()
+ }
+
+ override fun onVoiceCmdDisAgree() {
+ AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 2))
+ disAgreeAuthorize()
+ }
+
+ private fun agreeAuthorize() {
+ authorizeController?.agreeAuthorize(invokeTag!!, agreementId) {
+ voiceAuthorizeError()
+ }
+ }
+
+ private fun disAgreeAuthorize() {
+ authorizeController?.disAgreeAuthorize(invokeTag!!, agreementId) {
+ voiceAuthorizeError()
+ }
+ }
+
+ private fun invokeAuthorizationContent() {
+ authorizeController?.invokeAuthorizationContent(invokeTag!!, {
+ readyToAuthorize()
+ }, { id: Long, content: String, title: String, bottomContent: String, lastContent: String ->
+ showAuthorizationAgreementContent(id, content, title, bottomContent, lastContent)
+ }, {
+ showAuthorizationError()
+ })
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeLayout.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeLayout.kt
index 37248c1cb1..adc6968eb1 100644
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeLayout.kt
+++ b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeLayout.kt
@@ -50,11 +50,11 @@ class AuthorizeLayout(private val invokeTag: String) : View.OnClickListener, IVo
return layoutInflater
}
- private fun getLayoutId(): Int {
+ fun getLayoutId(): Int {
return R.layout.module_authorize_fragment
}
- private fun initViews(mRootView: View) {
+ fun initViews(mRootView: View) {
Logger.d(TAG, "initView ")
AnalyticsUtil.track(INVOKE_TRACK_AUTHORIZE_SHOW)
init(mRootView)
diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/DeviceUtil.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/DeviceUtil.kt
deleted file mode 100644
index 8884512894..0000000000
--- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/DeviceUtil.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.mogo.module.authorize.util
-
-import com.mogo.module.common.utils.CarSeries.*
-
-fun isDeviceOfD(): Boolean {
- return when (getSeries()) {
- CAR_SERIES_D80X, CAR_SERIES_D81X, CAR_SERIES_D82X, CAR_SERIES_D84X -> true
- else -> false
- }
-}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_corner.xml
new file mode 100644
index 0000000000..c2d1fec152
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_corner.xml
@@ -0,0 +1,15 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_left_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_left_corner.xml
new file mode 100644
index 0000000000..8c950afee3
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_left_corner.xml
@@ -0,0 +1,15 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_corner.xml
new file mode 100644
index 0000000000..86e673bca6
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_corner.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_right_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_right_corner.xml
new file mode 100644
index 0000000000..086f0e93fa
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_right_corner.xml
@@ -0,0 +1,15 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_shape_drak_top_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_shape_drak_top_corner.xml
new file mode 100644
index 0000000000..38ff34eb71
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_shape_drak_top_corner.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml b/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml
new file mode 100644
index 0000000000..f3d940ee26
--- /dev/null
+++ b/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/main/res/mipmap-xhdpi-1920x1000/module_authorize_loading_error.png b/modules/mogo-module-authorize/src/main/res/mipmap-xhdpi-1920x1000/module_authorize_loading_error.png
new file mode 100644
index 0000000000..5c8567ebcb
Binary files /dev/null and b/modules/mogo-module-authorize/src/main/res/mipmap-xhdpi-1920x1000/module_authorize_loading_error.png differ
diff --git a/modules/mogo-module-back/README.md b/modules/mogo-module-back/README.md
new file mode 100644
index 0000000000..fd719f465c
--- /dev/null
+++ b/modules/mogo-module-back/README.md
@@ -0,0 +1 @@
+# Launcher 模式下分体机F系列的返回桌面悬浮按钮 和 "返回桌面"语音指令
\ No newline at end of file
diff --git a/modules/mogo-module-back/build.gradle b/modules/mogo-module-back/build.gradle
index 189b1d9f44..0828b599aa 100644
--- a/modules/mogo-module-back/build.gradle
+++ b/modules/mogo-module-back/build.gradle
@@ -1,6 +1,6 @@
apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.alibaba.arouter'
android {
diff --git a/modules/mogo-module-back/consumer-rules.pro b/modules/mogo-module-back/consumer-rules.pro
index e69de29bb2..6c2f414424 100644
--- a/modules/mogo-module-back/consumer-rules.pro
+++ b/modules/mogo-module-back/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----ModuleBack-----
+-keep class com.mogo.module.back.BackToLauncherConst.*{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-back/proguard-rules.pro b/modules/mogo-module-back/proguard-rules.pro
index f1b424510d..af838595ca 100644
--- a/modules/mogo-module-back/proguard-rules.pro
+++ b/modules/mogo-module-back/proguard-rules.pro
@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----ModuleBack-----
+-keep class com.mogo.module.back.BackToLauncherConst.*{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-common/README.md b/modules/mogo-module-common/README.md
new file mode 100644
index 0000000000..1552f28128
--- /dev/null
+++ b/modules/mogo-module-common/README.md
@@ -0,0 +1,11 @@
+# 基础框架
+
+## 基于 WindowManger.addView 方式实现的弹窗
+
+## 大而全数据定义
+
+## 地图中心点控制策略
+
+## 自研车机类型判断
+
+## 模块加载类
\ No newline at end of file
diff --git a/modules/mogo-module-common/consumer-rules.pro b/modules/mogo-module-common/consumer-rules.pro
index e69de29bb2..9bcd20fb1c 100644
--- a/modules/mogo-module-common/consumer-rules.pro
+++ b/modules/mogo-module-common/consumer-rules.pro
@@ -0,0 +1,8 @@
+#-----CommonModule-----
+-keep class com.mogo.module.common.entity.** {*;}
+-keep class com.mogo.module.common.map.Interrupter
+-keep class com.mogo.module.common.map.Scene
+-keep class com.mogo.module.common.wm.** {*;}
+-keep class com.mogo.module.common.ModuleNames
+-keep class com.mogo.module.common.ModuleType
+-keep class com.mogo.module.common.MogoModulePaths
\ No newline at end of file
diff --git a/modules/mogo-module-common/proguard-rules.pro b/modules/mogo-module-common/proguard-rules.pro
index f1b424510d..cd20bd521c 100644
--- a/modules/mogo-module-common/proguard-rules.pro
+++ b/modules/mogo-module-common/proguard-rules.pro
@@ -19,3 +19,10 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----CommonModule-----
+-keep class com.mogo.module.common.entity.** {*;}
+-keep class com.mogo.module.common.map.Interrupter
+-keep class com.mogo.module.common.map.Scene
+-keep class com.mogo.module.common.wm.** {*;}
+-keep class com.mogo.module.common.MogoModulePaths
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java
index 3a66bd5939..58eb4cab55 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java
@@ -6,6 +6,7 @@ import android.view.WindowManager;
import androidx.annotation.NonNull;
+import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.R;
/**
@@ -20,7 +21,9 @@ public class BaseFloatDialog extends Dialog {
public BaseFloatDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
- addFlag();
+ if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD) {
+ addFlag();
+ }
}
private void addFlag() {
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java
new file mode 100644
index 0000000000..a099e4db17
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java
@@ -0,0 +1,88 @@
+package com.mogo.module.common.entity;
+
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:25 PM
+ * desc : V2X事件列表展示
+ * version: 1.0
+ */
+public class V2XEventShowEntity implements Serializable {
+
+ // 0---默认展示详情,1--直播,4--道路事件详情
+ private int viewType;
+
+ // 道路事件详情
+ private V2XRoadEventEntity v2XRoadEventEntity;
+ // 直播车机 @see viewType = 1
+ private V2XLiveCarInfoEntity v2XLiveCarInfoRes;
+ // 直播车机列表
+ private List v2XLiveCarList;
+
+ public int getViewType() {
+ return viewType;
+ }
+
+ public void setViewType(int viewType) {
+ this.viewType = viewType;
+ }
+
+ public V2XRoadEventEntity getV2XRoadEventEntity() {
+ return v2XRoadEventEntity;
+ }
+
+ public void setV2XRoadEventEntity(V2XRoadEventEntity v2XRoadEventEntity) {
+ this.v2XRoadEventEntity = v2XRoadEventEntity;
+ }
+
+ public V2XLiveCarInfoEntity getV2XLiveCarInfoRes() {
+ return v2XLiveCarInfoRes;
+ }
+
+ public void setV2XLiveCarInfoRes(V2XLiveCarInfoEntity v2XLiveCarInfoRes) {
+ this.v2XLiveCarInfoRes = v2XLiveCarInfoRes;
+ }
+
+ public List getV2XLiveCarList() {
+ return v2XLiveCarList;
+ }
+
+ public void setV2XLiveCarList(List v2XLiveCarList) {
+ this.v2XLiveCarList = v2XLiveCarList;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ V2XEventShowEntity that = (V2XEventShowEntity) o;
+ return viewType == that.viewType &&
+ Objects.equals(v2XRoadEventEntity, that.v2XRoadEventEntity) &&
+ Objects.equals(v2XLiveCarInfoRes, that.v2XLiveCarInfoRes) &&
+ Objects.equals(v2XLiveCarList, that.v2XLiveCarList);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(viewType, v2XRoadEventEntity, v2XLiveCarInfoRes, v2XLiveCarList);
+ }
+
+ @Override
+ public String toString() {
+ return "V2XEventShowEntity{" +
+ "viewType=" + viewType +
+ ", v2XRoadEventEntity=" + v2XRoadEventEntity +
+ ", v2XLiveCarInfoRes=" + v2XLiveCarInfoRes +
+ ", v2XLiveCarList=" + v2XLiveCarList +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java
new file mode 100644
index 0000000000..94af904dc0
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java
@@ -0,0 +1,66 @@
+package com.mogo.module.common.entity;
+
+import java.util.Objects;
+
+/**
+ * 可直播车机基本信息,再通过 appDataService/integratedServices/app/push/no/livePush/v1
+ * 获取直播信息
+ * @author donghongyu
+ */
+public class V2XLiveCarInfoEntity {
+ private String sn;
+ private double lon;
+ private double lat;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ 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;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ V2XLiveCarInfoEntity that = (V2XLiveCarInfoEntity) o;
+ return Double.compare(that.lon, lon) == 0 &&
+ Double.compare(that.lat, lat) == 0 &&
+ Objects.equals(sn, that.sn);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sn, lon, lat);
+ }
+
+ @Override
+ public String toString() {
+ return "V2XLiveCarEntity{" +
+ "sn='" + sn + '\'' +
+ ", lon=" + lon +
+ ", lat=" + lat +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java
new file mode 100644
index 0000000000..3e52d000f7
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java
@@ -0,0 +1,125 @@
+package com.mogo.module.common.entity;
+
+import androidx.annotation.IntDef;
+
+import java.io.Serializable;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Objects;
+
+/**
+ * e-mail : 1358506549@qq.com
+ * date : 2020/5/15 4:35 PM
+ * desc : V2X 场景消息聚合
+ * version: 1.0
+ *
+ * @author donghongyu
+ */
+public class V2XMessageEntity implements Serializable {
+
+ /**
+ * 场景类型
+ *
+ * @see V2XTypeEnum
+ */
+ @MessageType
+ int type;
+
+ /**
+ * 是否展示对话框
+ * true-展示,false-不展示
+ */
+ boolean showState;
+
+ /**
+ * 场景具体的数据内容
+ */
+ T content;
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(@MessageType int type) {
+ this.type = type;
+ }
+
+ public boolean isShowState() {
+ return showState;
+ }
+
+ public void setShowState(boolean showState) {
+ this.showState = showState;
+ }
+
+ public T getContent() {
+ return content;
+ }
+
+ public void setContent(T content) {
+ this.content = content;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ V2XMessageEntity> that = (V2XMessageEntity>) o;
+ return type == that.type &&
+ content.equals(that.content);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, content);
+ }
+
+ /**
+ * V2X 场景类型
+ */
+ public interface V2XTypeEnum {
+ // 道路事件预警
+ int ALERT_ROAD_WARNING = 1_000;
+ // 他车求助预警
+ int ALERT_SEEK_WARNING = 1_001;
+ // 疲劳驾驶预警
+ int ALERT_FATIGUE_DRIVING = 1_002;
+ // 后台推送展示 Window
+ int ALERT_PUSH_WINDOW_WARNING = 1_003;
+ // 后台推送展示 Toast
+ int ALERT_PUSH_TOAST_WARNING = 1_004;
+ // 后台推送展示 展示的直播
+ int ALERT_PUSH_LIVE_CAR_WARNING = 1_005;
+ // V2X场景动画展示
+ int ALERT_ANIMATION_WARNING = 1_006;
+ // 道路事件直播预警
+ int ALERT_ROAD_LIVE_CAR_WARNING = 1_007;
+ // 道路事件违章停车
+ int ALERT_ILLEGAL_PARK_WARNING = 1_008;
+ // 自车求助
+ int ALERT_CAR_FOR_HELP = 8_000;
+ }
+
+ @IntDef(value = {
+ V2XTypeEnum.ALERT_ROAD_WARNING,
+ V2XTypeEnum.ALERT_SEEK_WARNING,
+ V2XTypeEnum.ALERT_FATIGUE_DRIVING,
+ V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING,
+ V2XTypeEnum.ALERT_PUSH_TOAST_WARNING,
+ V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING,
+ V2XTypeEnum.ALERT_ANIMATION_WARNING,
+ V2XTypeEnum.ALERT_ROAD_LIVE_CAR_WARNING,
+ V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING,
+ V2XTypeEnum.ALERT_CAR_FOR_HELP,
+ })
+ @Target({
+ ElementType.PARAMETER,
+ ElementType.FIELD,
+ ElementType.METHOD,
+ }) //表示注解作用范围,参数注解,成员注解,方法注解
+ @Retention(RetentionPolicy.SOURCE) //表示注解所存活的时间,在运行时,而不会存在 .class 文件中
+ public @interface MessageType { //接口,定义新的注解类型
+ }
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java
new file mode 100644
index 0000000000..6624758b81
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java
@@ -0,0 +1,31 @@
+package com.mogo.module.common.entity;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/31 4:53 PM
+ * desc : V2X 道路事件类型
+ * version: 1.0
+ */
+public interface V2XPoiTypeEnum extends MarkerPoiTypeEnum {
+ // 前方静止or慢速车辆报警
+ String ALERT_FRONT_CAR = "99999";
+ // 限行管理
+ String ALERT_TRAFFIC_CONTROL = "99998";
+ // 红绿灯事件、是建议以多少速度驶过
+ String ALERT_TRAFFIC_LIGHT_SUGGEST = "99997";
+ // 红绿灯事件、一种是绿灯不足3秒
+ String ALERT_TRAFFIC_LIGHT_WARNING = "99996";
+ // 故障车辆
+ int ALERT_CAR_TROUBLE_WARNING = 20007;
+
+ // TODO 这里目前是演示DEMO会用到,想着是打算商用,先这么处理的
+ // 取快递
+ String ALERT_TRAFFIC_EXPRESS = "99995";
+ // 顺风车
+ String ALERT_TRAFFIC_TAXI = "99994";
+ // 疲劳驾驶
+ String ALERT_FATIGUE_DRIVING = "99993";
+ // 违章停车
+ String ALERT_ILLEGAL_PARK = "99992";
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java
new file mode 100644
index 0000000000..4c4d1af587
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java
@@ -0,0 +1,264 @@
+package com.mogo.module.common.entity;
+
+import android.text.TextUtils;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-02-0315:49
+ * desc : V2X警报数据
+ * version: 1.0
+ */
+public class V2XPushMessageEntity implements Serializable {
+ // 0---默认展示详情,1--直播,2--停车场,3--加油站,4--道路事件详情
+ private int viewType;
+ private String sceneId;
+ private String sceneName;
+ private short sceneCategory;
+ private short sceneLevel;
+ private String sceneDescription;
+ private boolean zoom;
+ private int zoomScale;
+ private String alarmContent;
+ private String tts;
+ private String videoUrl;
+ private String videoSn;
+ private String videoChannel;
+ private int expireTime;
+ private double lat;
+ private double lon;
+ private String sn;
+ private String headImgUrl;
+ private String msgImgUrl;
+ private String address;
+ private double distance;
+ private boolean isShowWindow;
+
+ public int getViewType() {
+ return viewType;
+ }
+
+ public void setViewType(int viewType) {
+ this.viewType = viewType;
+ }
+
+ public String getSceneId() {
+ return sceneId;
+ }
+
+ public void setSceneId(String sceneId) {
+ this.sceneId = sceneId;
+ }
+
+ public String getSceneName() {
+ return sceneName;
+ }
+
+ public void setSceneName(String sceneName) {
+ this.sceneName = sceneName;
+ }
+
+ public short getSceneCategory() {
+ return sceneCategory;
+ }
+
+ public void setSceneCategory(short sceneCategory) {
+ this.sceneCategory = sceneCategory;
+ }
+
+ public short getSceneLevel() {
+ return sceneLevel;
+ }
+
+ public void setSceneLevel(short sceneLevel) {
+ this.sceneLevel = sceneLevel;
+ }
+
+ public String getSceneDescription() {
+ return sceneDescription;
+ }
+
+ public void setSceneDescription(String sceneDescription) {
+ this.sceneDescription = sceneDescription;
+ }
+
+ public boolean isZoom() {
+ return zoom;
+ }
+
+ public void setZoom(boolean zoom) {
+ this.zoom = zoom;
+ }
+
+ public String getAlarmContent() {
+ if (TextUtils.isEmpty(alarmContent)) {
+ return "";
+ }
+ return alarmContent;
+ }
+
+ public void setAlarmContent(String alarmContent) {
+ this.alarmContent = alarmContent;
+ }
+
+ public String getTts() {
+ if (TextUtils.isEmpty(tts)) {
+ return "";
+ }
+ return tts;
+ }
+
+ public void setTts(String tts) {
+ this.tts = tts;
+ }
+
+ public String getVideoUrl() {
+ return videoUrl;
+ }
+
+ public void setVideoUrl(String videoUrl) {
+ this.videoUrl = videoUrl;
+ }
+
+ public String getVideoSn() {
+ return videoSn;
+ }
+
+ public void setVideoSn(String videoSn) {
+ this.videoSn = videoSn;
+ }
+
+ public String getVideoChannel() {
+ return videoChannel;
+ }
+
+ public void setVideoChannel(String videoChannel) {
+ this.videoChannel = videoChannel;
+ }
+
+ public int getExpireTime() {
+ return expireTime;
+ }
+
+ public void setExpireTime(int expireTime) {
+ this.expireTime = expireTime;
+ }
+
+ public int getZoomScale() {
+ return zoomScale;
+ }
+
+ public void setZoomScale(int zoomScale) {
+ this.zoomScale = zoomScale;
+ }
+
+
+ public double getLat() {
+ return lat;
+ }
+
+ public void setLat(double lat) {
+ this.lat = lat;
+ }
+
+ public double getLon() {
+ return lon;
+ }
+
+ public void setLon(double lon) {
+ this.lon = lon;
+ }
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public String getHeadImgUrl() {
+ return headImgUrl;
+ }
+
+ public void setHeadImgUrl(String headImgUrl) {
+ this.headImgUrl = headImgUrl;
+ }
+
+ public String getMsgImgUrl() {
+ return msgImgUrl;
+ }
+
+ public void setMsgImgUrl(String msgImgUrl) {
+ this.msgImgUrl = msgImgUrl;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public double getDistance() {
+ return distance;
+ }
+
+ public void setDistance(double distance) {
+ this.distance = distance;
+ }
+
+ public boolean isShowWindow() {
+ return isShowWindow;
+ }
+
+ public void setShowWindow(boolean showWindow) {
+ isShowWindow = showWindow;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ V2XPushMessageEntity that = (V2XPushMessageEntity) o;
+ return Objects.equals(sceneId, that.sceneId) &&
+ Objects.equals(tts, that.tts);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sceneId, tts);
+ }
+
+ @Override
+ public String toString() {
+ return "V2XPushMessageEntity{" +
+ "viewType=" + viewType +
+ ", sceneId='" + sceneId + '\'' +
+ ", sceneName='" + sceneName + '\'' +
+ ", sceneCategory=" + sceneCategory +
+ ", sceneLevel=" + sceneLevel +
+ ", sceneDescription='" + sceneDescription + '\'' +
+ ", zoom=" + zoom +
+ ", zoomScale=" + zoomScale +
+ ", alarmContent='" + alarmContent + '\'' +
+ ", tts='" + tts + '\'' +
+ ", videoUrl='" + videoUrl + '\'' +
+ ", videoSn='" + videoSn + '\'' +
+ ", videoChannel='" + videoChannel + '\'' +
+ ", expireTime=" + expireTime +
+ ", lat=" + lat +
+ ", lon=" + lon +
+ ", sn='" + sn + '\'' +
+ ", headImgUrl='" + headImgUrl + '\'' +
+ ", msgImgUrl='" + msgImgUrl + '\'' +
+ ", address='" + address + '\'' +
+ ", distance=" + distance +
+ ", isShowWindow=" + isShowWindow +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java
new file mode 100644
index 0000000000..2546f5bebf
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java
@@ -0,0 +1,298 @@
+package com.mogo.module.common.entity;
+
+import android.text.TextUtils;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/13 11:17 AM
+ * desc : 道路事件的聚合,位置、详情,用于V2X情况下展示
+ * version: 1.0
+ */
+public class V2XRoadEventEntity implements Serializable {
+ /**
+ * @see MarkerPoiTypeEnum
+ */
+ // 事件类型
+ private String poiType;
+ // 事件位置
+ private MarkerLocation location;
+ // 具体的信息
+ private MarkerExploreWay noveltyInfo;
+ // tts 提示
+ private String tts;
+ // ADAS 展示文案
+ private String alarmContent;
+ // 距离当前车辆的距离
+ private double distance;
+ // 默认展示时间
+ private int expireTime;
+ // 展示Button
+ private boolean isShowEventButton;
+ // 绑定 MarkerView 的数据, 业务需要啥数据就传入啥数据
+ private Object bindObj;
+
+ public MarkerLocation getLocation() {
+ return location;
+ }
+
+ public void setLocation(MarkerLocation location) {
+ this.location = location;
+ }
+
+ public String getPoiType() {
+ if (TextUtils.isEmpty(poiType)) {
+ return "";
+ }
+ return poiType;
+ }
+
+ public void setPoiType(String poiType) {
+ this.poiType = poiType;
+ }
+
+ public String getTts(boolean haveLiveCar) {
+ tts = "前方#" + (int) getDistance() + "米#";
+ switch (getPoiType()) {
+ // 停车场
+ case V2XPoiTypeEnum.FOURS_PARKING:
+ tts += "停车场";
+ break;
+ // 加油站
+ case V2XPoiTypeEnum.GAS_STATION:
+ tts += "加油站";
+ break;
+ // 交通检查
+ case V2XPoiTypeEnum.TRAFFIC_CHECK:
+ tts += "交通检查";
+ break;
+ // 封路
+ case V2XPoiTypeEnum.ROAD_CLOSED:
+ tts += "道路封路";
+ break;
+ // 施工
+ case V2XPoiTypeEnum.FOURS_ROAD_WORK:
+ tts += "道路施工";
+ break;
+ // 拥堵
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ tts += "道路拥堵";
+ break;
+ // 积水
+ case V2XPoiTypeEnum.FOURS_PONDING:
+ tts += "道路积水";
+ break;
+ // 浓雾
+ case V2XPoiTypeEnum.FOURS_FOG:
+ tts += "出现浓雾";
+ break;
+ // 结冰
+ case V2XPoiTypeEnum.FOURS_ICE:
+ tts += "路面结冰";
+ break;
+ // 事故
+ case V2XPoiTypeEnum.FOURS_ACCIDENT:
+ tts += "交通事故";
+ break;
+ default:
+ tts += "道路事件";
+ break;
+ }
+ if (haveLiveCar) {
+ tts += ",查看实况请说确定。";
+ setShowEventButton(true);
+ } else {
+ tts += ",请注意躲避。";
+ setShowEventButton(false);
+ }
+ return tts;
+ }
+
+ /**
+ * 检测到附近#道路施工#,确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。
+ */
+ public String getTtsWithFeedback() {
+ tts = "检测到附近";
+ switch (getPoiType()) {
+ // 停车场
+ case V2XPoiTypeEnum.FOURS_PARKING:
+ tts += "有停车场";
+ break;
+ // 加油站
+ case V2XPoiTypeEnum.GAS_STATION:
+ tts += "有加油站";
+ break;
+ // 交通检查
+ case V2XPoiTypeEnum.TRAFFIC_CHECK:
+ tts += "交通检查";
+ break;
+ // 封路
+ case V2XPoiTypeEnum.ROAD_CLOSED:
+ tts += "封路";
+ break;
+ // 施工
+ case V2XPoiTypeEnum.FOURS_ROAD_WORK:
+ tts += "施工";
+ break;
+ // 拥堵
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ tts += "道路拥堵";
+ break;
+ // 积水
+ case V2XPoiTypeEnum.FOURS_PONDING:
+ tts += "道路积水";
+ break;
+ // 浓雾
+ case V2XPoiTypeEnum.FOURS_FOG:
+ tts += "出现浓雾";
+ break;
+ // 结冰
+ case V2XPoiTypeEnum.FOURS_ICE:
+ tts += "路面结冰";
+ break;
+ // 事故
+ case V2XPoiTypeEnum.FOURS_ACCIDENT:
+ tts += "交通事故";
+ break;
+ default:
+ tts += "道路事件";
+ break;
+ }
+ tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。";
+ return tts;
+ }
+
+ public String getTts() {
+ return tts;
+ }
+
+ public void setTts(String tts) {
+ this.tts = tts;
+ }
+
+ public boolean isShowEventButton() {
+ return isShowEventButton;
+ }
+
+ public void setShowEventButton(boolean showEventButton) {
+ isShowEventButton = showEventButton;
+ }
+
+ public String getAlarmContent() {
+ switch (getPoiType()) {
+ // 停车场
+ case V2XPoiTypeEnum.FOURS_PARKING:
+ alarmContent = "停车场附近";
+ break;
+ // 加油站
+ case V2XPoiTypeEnum.GAS_STATION:
+ alarmContent = "加油站附近";
+ break;
+ // 交通检查
+ case V2XPoiTypeEnum.TRAFFIC_CHECK:
+ alarmContent = "前方交通检查";
+ break;
+ // 封路
+ case V2XPoiTypeEnum.ROAD_CLOSED:
+ alarmContent = "前方封路";
+ break;
+ // 施工
+ case V2XPoiTypeEnum.FOURS_ROAD_WORK:
+ alarmContent = "前方施工";
+ break;
+ // 拥堵
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ alarmContent = "前方道路拥堵";
+ break;
+ // 积水
+ case V2XPoiTypeEnum.FOURS_PONDING:
+ alarmContent = "前方道路积水";
+ break;
+ // 浓雾
+ case V2XPoiTypeEnum.FOURS_FOG:
+ alarmContent = "前方出现浓雾";
+ break;
+ // 结冰
+ case V2XPoiTypeEnum.FOURS_ICE:
+ alarmContent = "前方路面结冰";
+ break;
+ // 事故
+ case V2XPoiTypeEnum.FOURS_ACCIDENT:
+ alarmContent = "前方交通事故";
+ break;
+ default:
+ tts += "道路事件";
+ break;
+ }
+ return alarmContent;
+ }
+
+ public void setAlarmContent(String alarmContent) {
+ this.alarmContent = alarmContent;
+ }
+
+ public double getDistance() {
+ return distance;
+ }
+
+ public void setDistance(double distance) {
+ this.distance = distance;
+ }
+
+ public int getExpireTime() {
+ return expireTime;
+ }
+
+ public void setExpireTime(int expireTime) {
+ this.expireTime = expireTime;
+ }
+
+ public MarkerExploreWay getNoveltyInfo() {
+ return noveltyInfo;
+ }
+
+ public void setNoveltyInfo(MarkerExploreWay noveltyInfo) {
+ this.noveltyInfo = noveltyInfo;
+ }
+
+ public Object getBindObj() {
+ return bindObj;
+ }
+
+ public void setBindObj(Object bindObj) {
+ this.bindObj = bindObj;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ V2XRoadEventEntity that = (V2XRoadEventEntity) o;
+ return Objects.equals(noveltyInfo.getInfoId(), that.noveltyInfo.getInfoId()) &&
+ Objects.equals(poiType, that.poiType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(poiType, noveltyInfo.getInfoId());
+ }
+
+ @Override
+ public String toString() {
+ return "V2XRoadEventEntity{" +
+ "poiType='" + poiType + '\'' +
+ ", location=" + location +
+ ", noveltyInfo=" + noveltyInfo +
+ ", tts='" + tts + '\'' +
+ ", alarmContent='" + alarmContent + '\'' +
+ ", distance=" + distance +
+ ", expireTime=" + expireTime +
+ ", isShowEventButton=" + isShowEventButton +
+ ", bindObj=" + bindObj +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java
new file mode 100644
index 0000000000..f8ed519770
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java
@@ -0,0 +1,27 @@
+package com.mogo.module.common.entity;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/31 4:53 PM
+ * desc : V2X 道路提醒类型
+ * version: 1.0
+ */
+public interface V2XWindowTypeEnum {
+ // 默认展示详情
+ int DEFAULT_WINDOW = 0;
+ // 直播
+ int LIVE_CAR_WINDOW = 1;
+ // 道路事件详情
+ int ROAD_EVENT_WINDOW = 2;
+ // 推送事件详情
+ int PUSH_EVENT_WINDOW = 3;
+ // 演示动画场景
+ int ANIMATION_WINDOW = 4;
+ // 疲劳驾驶
+ int FATIGUE_DRIVING_WINDOW = 5;
+ // 他人故障求助
+ int SEEK_HELP_WINDOW = 6;
+ // 违章停车
+ int ILLEGAL_PARK_WINDOW = 7;
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/DialogImpl.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/DialogImpl.java
new file mode 100644
index 0000000000..72c5960fd4
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/DialogImpl.java
@@ -0,0 +1,47 @@
+package com.mogo.module.common.wm;
+
+
+import android.app.Dialog;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.mogo.module.common.dialog.BaseFloatDialog;
+import com.mogo.utils.logger.Logger;
+
+/**
+ * 采用Dialog实现接口
+ */
+class DialogImpl implements IWindowManagerView {
+ private Dialog dialog;
+ private View contentView;
+
+ @Override
+ public void init(WindowManagerView.WMViewParams params) {
+ Logger.d("DialogImpl", "init====");
+ dialog = new BaseFloatDialog(params.mContext);
+ contentView = params.mContentView;
+ Logger.d("DialogImpl", "params view : " + contentView);
+ dialog.setContentView(contentView);
+ }
+
+ @Override
+ public boolean isShowing() {
+ return dialog.isShowing();
+ }
+
+ @Override
+ public void show() {
+ dialog.show();
+ }
+
+ @Override
+ public void hide() {
+ /*
+ * 取得view的父组件,然后移除view
+ */
+ if (contentView != null) {
+ ((ViewGroup) contentView.getParent()).removeView(contentView);
+ }
+ dialog.dismiss();
+ }
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/IWindowManagerView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/IWindowManagerView.java
new file mode 100644
index 0000000000..d610cea67a
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/IWindowManagerView.java
@@ -0,0 +1,25 @@
+package com.mogo.module.common.wm;
+
+interface IWindowManagerView {
+ /**
+ * 初始化
+ * @param params contentView包装类
+ */
+ void init(WindowManagerView.WMViewParams params);
+
+ /**
+ * 是否显示
+ * @return true - 显示中
+ */
+ boolean isShowing();
+
+ /**
+ * 显示
+ */
+ void show();
+
+ /**
+ * 隐藏
+ */
+ void hide();
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
new file mode 100644
index 0000000000..4821f6b0a2
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
@@ -0,0 +1,67 @@
+package com.mogo.module.common.wm;
+
+import android.content.Context;
+import android.graphics.PixelFormat;
+import android.os.Build;
+import android.view.Gravity;
+import android.view.WindowManager;
+
+import com.mogo.module.common.utils.CarSeries;
+import com.mogo.utils.WindowUtils;
+
+/**
+ * 采用windowManager实现接口
+ */
+class WindowManagerImpl implements IWindowManagerView {
+ private WindowManager mWindowManager;
+ private WindowManager.LayoutParams mLayoutParams;
+ private WindowManagerView.WMViewParams mParams;
+ private boolean isShowing;
+ @Override
+ public void init(WindowManagerView.WMViewParams params) {
+ mParams = params;
+ mWindowManager = (WindowManager) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
+ mLayoutParams = new WindowManager.LayoutParams();
+ if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
+ mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
+ } else {
+ mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
+ }
+ mLayoutParams.format = PixelFormat.TRANSLUCENT;
+ mLayoutParams.gravity = Gravity.CENTER;
+ mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
+
+ if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
+ mLayoutParams.width = 1920;
+ mLayoutParams.height = 1080;
+ } else {
+ mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
+ mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
+ }
+ mLayoutParams.dimAmount = 0.5f;
+ mLayoutParams.x = 0;
+ mLayoutParams.y = 0;
+ }
+
+ @Override
+ public boolean isShowing() {
+ return isShowing;
+ }
+
+ @Override
+ public void show() {
+ if(!isShowing){
+ isShowing = true;
+ mWindowManager.addView(mParams.mContentView,mLayoutParams);
+ }
+ }
+
+ @Override
+ public void hide() {
+ if (isShowing && mParams != null) {
+ mWindowManager.removeView(mParams.mContentView);
+ isShowing = false;
+ }
+
+ }
+}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
index 4c60022b5d..d3c054a2ca 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
@@ -11,6 +11,7 @@ import android.view.WindowManager;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
+import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.utils.WindowUtils;
@@ -23,89 +24,57 @@ import com.mogo.utils.WindowUtils;
public class WindowManagerView {
private WMViewParams mParams;
- private boolean mIsShowing;
- private WindowManager mWindowManager;
- private WindowManager.LayoutParams mLayoutParams;
- private WindowManagerView( WMViewParams params ) {
+ private IWindowManagerView managerView;
+
+ private WindowManagerView(WMViewParams params) {
this.mParams = params;
- init();
- }
-
- private void init() {
- mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
- mLayoutParams = new WindowManager.LayoutParams();
- if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
- mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
- } else {
- mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
- }
- mLayoutParams.format = PixelFormat.TRANSLUCENT;
- mLayoutParams.gravity = Gravity.CENTER;
- mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
-
- if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
- mLayoutParams.width = 1920;
- mLayoutParams.height = 1080;
- } else {
- mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
- mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
- }
- mLayoutParams.dimAmount = 0.5f;
- mLayoutParams.x = 0;
- mLayoutParams.y = 0;
+ managerView = new DialogImpl();
+ managerView.init(params);
+// init();
}
public boolean isShowing() {
- return mIsShowing;
+ return managerView.isShowing();
}
- public < T extends View > T findViewById( @IdRes int id ) {
- return mParams.mContentView.findViewById( id );
+ public T findViewById(@IdRes int id) {
+ return mParams.mContentView.findViewById(id);
}
public void show() {
- if ( mIsShowing ) {
- return;
- }
- mIsShowing = true;
- mWindowManager.addView( mParams.mContentView, mLayoutParams );
+ managerView.show();
}
public void dismiss() {
- if ( !mIsShowing ) {
- return;
- }
- if ( mParams != null ) {
- mWindowManager.removeViewImmediate( mParams.mContentView );
- }
- mIsShowing = false;
+ managerView.hide();
}
public static class Builder {
private WMViewParams mParams = null;
- public Builder( Context context ) {
+ public Builder(Context context) {
mParams = new WMViewParams();
mParams.mContext = context;
}
- public Builder contentView( View contentView ) {
+ public Builder contentView(View contentView) {
mParams.mContentView = contentView;
return this;
}
- public Builder contentView( @LayoutRes int contentViewId ) {
- mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
+ public Builder contentView(@LayoutRes int contentViewId) {
+ mParams.mContentView = LayoutInflater.from(mParams.mContext).inflate(contentViewId,
+ null);
return this;
}
public WindowManagerView build() {
- if ( mParams.mContentView == null ) {
- throw new NullPointerException( "WMViewParams#mContentView must not be null." );
+ if (mParams.mContentView == null) {
+ throw new NullPointerException("WMViewParams#mContentView must not be null.");
}
- return new WindowManagerView( mParams );
+ return new WindowManagerView(mParams);
}
}
diff --git a/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml
index d56caf71d6..17412b24d7 100644
--- a/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml
+++ b/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml
@@ -1016,7 +1016,9 @@
997px
998px
999px
+ 1000px
1300px
+ 1920px
diff --git a/modules/mogo-module-event-panel-noop/.gitignore b/modules/mogo-module-event-panel-noop/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel-noop/build.gradle b/modules/mogo-module-event-panel-noop/build.gradle
new file mode 100644
index 0000000000..2bd80f619d
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/build.gradle
@@ -0,0 +1,55 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'com.alibaba.arouter'
+
+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.androidxccorektx
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.arouter
+ kapt rootProject.ext.dependencies.aroutercompiler
+
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-event-panel-noop/consumer-rules.pro b/modules/mogo-module-event-panel-noop/consumer-rules.pro
new file mode 100644
index 0000000000..da191c00b8
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/consumer-rules.pro
@@ -0,0 +1 @@
+-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel-noop/gradle.properties b/modules/mogo-module-event-panel-noop/gradle.properties
new file mode 100644
index 0000000000..df90d55670
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-event-panel-noop
+VERSION_CODE=1
diff --git a/modules/mogo-module-event-panel-noop/proguard-rules.pro b/modules/mogo-module-event-panel-noop/proguard-rules.pro
new file mode 100644
index 0000000000..58b6896c9d
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/proguard-rules.pro
@@ -0,0 +1,23 @@
+# 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
+
+-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel-noop/src/main/AndroidManifest.xml b/modules/mogo-module-event-panel-noop/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..c865fb2efe
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel-noop/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelConstants.kt b/modules/mogo-module-event-panel-noop/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelConstants.kt
new file mode 100644
index 0000000000..dc22fdbc7a
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelConstants.kt
@@ -0,0 +1,11 @@
+package com.zhidao.mogo.module.event.panel
+
+/**
+ * 事件面板相关常量
+ *
+ * @author tongchenfei
+ */
+object EventPanelConstants {
+ const val MODULE_NAME = "MODULE_EVENT_PANEL"
+ const val PATH_NAME = "/event/panel"
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel-noop/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelModuleProvider.kt b/modules/mogo-module-event-panel-noop/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelModuleProvider.kt
new file mode 100644
index 0000000000..a5c31d2f2a
--- /dev/null
+++ b/modules/mogo-module-event-panel-noop/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelModuleProvider.kt
@@ -0,0 +1,94 @@
+package com.zhidao.mogo.module.event.panel
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.MogoServicePaths
+import com.mogo.service.eventpanel.IEventPanelProvider
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
+
+/**
+ * 事件面板provider的空方法实现
+ *
+ * @author tongchenfei
+ */
+
+
+const val TAG = "EventPanelNoopModule"
+
+@Route(path = MogoServicePaths.PATH_EVENT_PANEL)
+class EventPanelModuleProvider : IEventPanelProvider {
+ override fun init(context: Context) {
+ Logger.d(TAG, "模块初始化====")
+ }
+
+ override fun createFragment(context: Context, data: Bundle?): Fragment? {
+ return null
+ }
+
+ /**
+ * 显示面板
+ */
+ override fun showPanel() {
+ }
+
+
+ /**
+ * 隐藏面板
+ */
+ override fun hidePanel() {
+ }
+
+ override fun createView(context: Context): View? {
+ return null
+ }
+
+ override fun getModuleName(): String {
+ return MODULE_NAME
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String? {
+ return null
+ }
+
+ override fun getAppName(): String? {
+ return null
+ }
+
+ override fun isPanelShow(): Boolean {
+ return false
+ }
+
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/.gitignore b/modules/mogo-module-event-panel/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-event-panel/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/build.gradle b/modules/mogo-module-event-panel/build.gradle
new file mode 100644
index 0000000000..4fdf60062d
--- /dev/null
+++ b/modules/mogo-module-event-panel/build.gradle
@@ -0,0 +1,63 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'com.alibaba.arouter'
+
+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.androidxccorektx
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.androidxconstraintlayout
+ implementation rootProject.ext.dependencies.arouter
+ kapt rootProject.ext.dependencies.aroutercompiler
+ implementation rootProject.ext.dependencies.rxjava
+ implementation rootProject.ext.dependencies.rxandroid
+ implementation rootProject.ext.dependencies.androidxviewpager2
+ implementation rootProject.ext.dependencies.androidxrecyclerview
+ implementation rootProject.ext.dependencies.room
+ kapt rootProject.ext.dependencies.roomAnnotationProcessor
+ implementation rootProject.ext.dependencies.roomRxjava
+
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-event-panel/consumer-rules.pro b/modules/mogo-module-event-panel/consumer-rules.pro
new file mode 100644
index 0000000000..6cd2a10967
--- /dev/null
+++ b/modules/mogo-module-event-panel/consumer-rules.pro
@@ -0,0 +1,5 @@
+#-----EventPanel------
+-keep class com.zhidao.mogo.module.event.panel.bean.** {*;}
+-keep class com.zhidao.mogo.module.event.panel.dao.** {*;}
+-keep class com.zhidao.mogo.module.event.panel.listener.** {*;}
+-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/gradle.properties b/modules/mogo-module-event-panel/gradle.properties
new file mode 100644
index 0000000000..6bd32ac3d6
--- /dev/null
+++ b/modules/mogo-module-event-panel/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-event-panel
+VERSION_CODE=1
diff --git a/modules/mogo-module-event-panel/proguard-rules.pro b/modules/mogo-module-event-panel/proguard-rules.pro
new file mode 100644
index 0000000000..e778de0a5a
--- /dev/null
+++ b/modules/mogo-module-event-panel/proguard-rules.pro
@@ -0,0 +1,27 @@
+# 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
+
+#-----EventPanel------
+-keep class com.zhidao.mogo.module.event.panel.bean.** {*;}
+-keep class com.zhidao.mogo.module.event.panel.dao.** {*;}
+-keep class com.zhidao.mogo.module.event.panel.listener.** {*;}
+-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/AndroidManifest.xml b/modules/mogo-module-event-panel/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..c865fb2efe
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelConstants.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelConstants.kt
new file mode 100644
index 0000000000..31e0c28a34
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelConstants.kt
@@ -0,0 +1,15 @@
+package com.zhidao.mogo.module.event.panel
+
+/**
+ * 事件面板相关常量
+ *
+ * @author tongchenfei
+ */
+object EventPanelConstants {
+ const val MODULE_NAME = "MODULE_EVENT_PANEL"
+ const val PATH_NAME = "/event/panel"
+
+ const val ROAD_EVENT_USEFUL = "2"
+ const val ROAD_EVENT_UNUSEFUL = "1"
+ const val ROAD_EVENT_USEFUL_STATUS_UNSET = "0"
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelModuleProvider.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelModuleProvider.kt
new file mode 100644
index 0000000000..461581fc28
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/EventPanelModuleProvider.kt
@@ -0,0 +1,103 @@
+package com.zhidao.mogo.module.event.panel
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.eventpanel.IEventPanelProvider
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.service.module.IMogoModuleProvider
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.PATH_NAME
+import com.zhidao.mogo.module.event.panel.fragment.EventPanelFragment
+import com.zhidao.mogo.module.event.panel.util.MogoApiManager
+import com.zhidao.mogo.module.event.panel.util.TripRecordDataManager
+
+/**
+ * 事件面板provider
+ *
+ * @author tongchenfei
+ */
+@Route(path = PATH_NAME)
+class EventPanelModuleProvider : IEventPanelProvider {
+ /**
+ * Do your init work in this method, it well be call when processor has been load.
+ *
+ * @param context ctx
+ */
+ override fun init(context: Context) {
+ Logger.d(MODULE_NAME, "模块初始化====")
+ MogoApiManager.init(context)
+ TripRecordDataManager.init(context)
+ }
+
+ override fun createFragment(context: Context, data: Bundle?): Fragment? {
+ return EventPanelFragment.getInstance()
+ }
+
+ /**
+ * 显示面板
+ */
+ override fun showPanel() {
+ EventPanelFragment.getInstance().showPanel()
+ }
+
+ override fun isPanelShow(): Boolean {
+ return EventPanelFragment.getInstance().isPanelShow()
+ }
+
+
+ /**
+ * 隐藏面板
+ */
+ override fun hidePanel() {
+ EventPanelFragment.getInstance().hidePanel()
+ }
+
+ override fun createView(context: Context): View? {
+ return null
+ }
+
+ override fun getModuleName(): String {
+ return MODULE_NAME
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String? {
+ return null
+ }
+
+ override fun getAppName(): String? {
+ return null
+ }
+
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/adapter/EventPagerAdapter.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/adapter/EventPagerAdapter.kt
new file mode 100644
index 0000000000..97d9514975
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/adapter/EventPagerAdapter.kt
@@ -0,0 +1,23 @@
+package com.zhidao.mogo.module.event.panel.adapter
+
+import androidx.fragment.app.Fragment
+import androidx.viewpager2.adapter.FragmentStateAdapter
+import com.zhidao.mogo.module.event.panel.fragment.MyShareFragment
+import com.zhidao.mogo.module.event.panel.fragment.SurroundingEventFragment
+import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
+
+/**
+ * 事件面板viewpager2的adapter
+ *
+ * @author tongchenfei
+ */
+class EventPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
+ private val fragments:Array = arrayOf(TripRecordFragment(), SurroundingEventFragment(), MyShareFragment())
+
+ /**
+ * 目前一共就三个fragment
+ */
+ override fun getItemCount(): Int = fragments.size
+
+ override fun createFragment(position: Int): Fragment = fragments[position]
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/bean/TripRecord.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/bean/TripRecord.kt
new file mode 100644
index 0000000000..d2738b3b4c
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/bean/TripRecord.kt
@@ -0,0 +1,25 @@
+package com.zhidao.mogo.module.event.panel.bean
+
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.ROAD_EVENT_USEFUL_STATUS_UNSET
+
+/**
+ * 出行记录本地存储封装类,此类标识了数据库表名以及字段名
+ *
+ * @author tongchenfei
+ */
+@Entity
+data class TripRecord(@PrimaryKey(autoGenerate = false)
+ var id: Int,
+ var eventId: String = "",
+ var eventType: Int,
+ /**
+ * 是否有用
+ * 1 - 没用
+ * 2 - 有用
+ * 0 - 未设置
+ */
+ var usefulStatus: String = ROAD_EVENT_USEFUL_STATUS_UNSET,
+ var entity: String = "",
+ var recordTime: Long = System.currentTimeMillis())
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/dao/TripRecordDao.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/dao/TripRecordDao.kt
new file mode 100644
index 0000000000..23860e8534
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/dao/TripRecordDao.kt
@@ -0,0 +1,48 @@
+package com.zhidao.mogo.module.event.panel.dao
+
+import androidx.room.*
+import com.zhidao.mogo.module.event.panel.bean.TripRecord
+
+/**
+ * 出行动态dao,全部使用同步方法,在线程中执行
+ *
+ * @author tongchenfei
+ */
+@Dao
+interface TripRecordDao {
+ /**
+ * 查询当日数据
+ * @param limitTime 当日0点的时间戳
+ */
+ @Query(value = "SELECT * FROM TripRecord WHERE recordTime > :limitTime ORDER BY recordTime DESC")
+ fun queryAllTripRecord(limitTime: Long): List
+
+ /**
+ * 根据事件id获取出行动态
+ *
+ * @param eventId 事件id [com.mogo.module.common.entity.V2XRoadEventEntity.noveltyInfo.infoId]
+ */
+ @Query(value = "SELECT * FROM TripRecord WHERE eventId = :eventId")
+ fun queryTripRecordByEventId(eventId: String): TripRecord?
+
+ @Query(value = "SELECT * FROM TripRecord WHERE id = :id")
+ fun queryTripRecordById(id: Int): TripRecord?
+
+ @Insert(onConflict = OnConflictStrategy.REPLACE)
+ fun insert(vararg tripRecord: TripRecord)
+
+ @Update
+ fun update(vararg tripRecord: TripRecord)
+
+ @Delete
+ fun delete(vararg tripRecord: TripRecord)
+
+ /**
+ * 删除超时的数据,即当天0时以前的数据
+ * 虽然注解是Query,但是目的是执行后面的sql语句,所以就不要在意这些细节了
+ *
+ * @param limitTime 当日0点的时间戳
+ */
+ @Query(value = "DELETE FROM TripRecord WHERE recordTime < :limitTime")
+ fun deleteOvertimeTripRecord(limitTime: Long)
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/dao/TripRecordDatabase.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/dao/TripRecordDatabase.kt
new file mode 100644
index 0000000000..92dafed8a4
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/dao/TripRecordDatabase.kt
@@ -0,0 +1,25 @@
+package com.zhidao.mogo.module.event.panel.dao
+
+import android.content.Context
+import androidx.room.Database
+import androidx.room.Room
+import androidx.room.RoomDatabase
+import com.zhidao.mogo.module.event.panel.bean.TripRecord
+
+@Database(entities = [TripRecord::class], version = 1, exportSchema = false)
+abstract class TripRecordDatabase : RoomDatabase() {
+ companion object{
+ private var instance:TripRecordDatabase? = null
+ fun getInstance(context: Context):TripRecordDatabase{
+ if (instance == null) {
+ synchronized(TripRecordDatabase::class.java) {
+ if (instance == null) {
+ instance = Room.databaseBuilder(context, TripRecordDatabase::class.java, "TripRecordDatabase.db").build()
+ }
+ }
+ }
+ return instance!!
+ }
+ }
+ abstract fun getTripRecordDao():TripRecordDao
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/EventPanelFragment.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/EventPanelFragment.kt
new file mode 100644
index 0000000000..6f5a5f8912
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/EventPanelFragment.kt
@@ -0,0 +1,61 @@
+package com.zhidao.mogo.module.event.panel.fragment
+
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.mogo.commons.mvp.MvpFragment
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
+import com.zhidao.mogo.module.event.panel.R
+import com.zhidao.mogo.module.event.panel.adapter.EventPagerAdapter
+import com.zhidao.mogo.module.event.panel.presenter.EventPanelPresenter
+import kotlinx.android.synthetic.main.module_event_panel_fragment_event_panel.*
+
+/**
+ * 事件面板主fragment
+ *
+ * @author tongchenfei
+ */
+class EventPanelFragment : MvpFragment() {
+
+ companion object{
+ private val fragment = EventPanelFragment()
+ fun getInstance():EventPanelFragment{
+ return fragment
+ }
+ }
+
+ override fun getLayoutId(): Int {
+ return R.layout.module_event_panel_fragment_event_panel
+ }
+
+ override fun initViews() {
+ Logger.d(MODULE_NAME, "EventPanelFragment init view===")
+ vpEventPanel.adapter = EventPagerAdapter(this)
+ btnShowOrHidePanels.setOnClickListener {
+ if (vpEventPanel.visibility == View.GONE) {
+ showPanel()
+ }else{
+ hidePanel()
+ }
+ }
+ }
+ override fun createPresenter(): EventPanelPresenter {
+ return EventPanelPresenter(this)
+ }
+
+ fun showPanel(){
+ Logger.d(MODULE_NAME,"in fragment show panel")
+ vpEventPanel.visibility = View.VISIBLE
+ btnShowOrHidePanels.text = "隐藏面板"
+ }
+
+ fun hidePanel(){
+ Logger.d(MODULE_NAME,"in fragment hide panel")
+ vpEventPanel.visibility = View.GONE
+ btnShowOrHidePanels.text = "显示面板"
+ }
+
+ fun isPanelShow():Boolean{
+ return vpEventPanel.visibility == View.VISIBLE
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/MyShareFragment.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/MyShareFragment.kt
new file mode 100644
index 0000000000..2d759ded94
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/MyShareFragment.kt
@@ -0,0 +1,28 @@
+package com.zhidao.mogo.module.event.panel.fragment
+
+import com.mogo.commons.mvp.MvpFragment
+import com.zhidao.mogo.module.event.panel.R
+import com.zhidao.mogo.module.event.panel.presenter.MySharePresenter
+
+class MyShareFragment : MvpFragment() {
+ /**
+ * 布局资源
+ *
+ * @return
+ */
+ override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_my_share
+
+ /**
+ * 初始化控件,必须在初始化完成之后才可以实例化presenter,避免
+ * presenter 生命周期错乱
+ */
+ override fun initViews() {
+ }
+
+ /**
+ * 创建 presenter 实例
+ *
+ * @return
+ */
+ override fun createPresenter(): MySharePresenter = MySharePresenter(this)
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/SurroundingEventFragment.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/SurroundingEventFragment.kt
new file mode 100644
index 0000000000..b9ffbd4e46
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/SurroundingEventFragment.kt
@@ -0,0 +1,32 @@
+package com.zhidao.mogo.module.event.panel.fragment
+
+import com.mogo.commons.mvp.MvpFragment
+import com.zhidao.mogo.module.event.panel.R
+import com.zhidao.mogo.module.event.panel.presenter.SurroundingEventPresenter
+import kotlinx.android.synthetic.main.module_event_panel_fragment_surrounding_event.*
+
+class SurroundingEventFragment:MvpFragment(){
+ /**
+ * 布局资源
+ *
+ * @return
+ */
+ override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_surrounding_event
+
+ /**
+ * 初始化控件,必须在初始化完成之后才可以实例化presenter,避免
+ * presenter 生命周期错乱
+ */
+ override fun initViews() {
+ tvTitle.setOnClickListener {
+ EventPanelFragment.getInstance().hidePanel()
+ }
+ }
+
+ /**
+ * 创建 presenter 实例
+ *
+ * @return
+ */
+ override fun createPresenter(): SurroundingEventPresenter = SurroundingEventPresenter(this)
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/TripRecordFragment.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/TripRecordFragment.kt
new file mode 100644
index 0000000000..09854c3542
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/fragment/TripRecordFragment.kt
@@ -0,0 +1,49 @@
+package com.zhidao.mogo.module.event.panel.fragment
+
+import android.util.Log
+import com.mogo.commons.mvp.MvpFragment
+import com.mogo.module.common.entity.V2XMessageEntity
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
+import com.zhidao.mogo.module.event.panel.R
+import com.zhidao.mogo.module.event.panel.bean.TripRecord
+import com.zhidao.mogo.module.event.panel.presenter.TripRecordPresenter
+import com.zhidao.mogo.module.event.panel.util.TripRecordDataManager
+import kotlinx.android.synthetic.main.module_event_panel_fragment_trip_record.*
+import kotlin.random.Random
+
+/**
+ * 出行动态fragment
+ */
+class TripRecordFragment : MvpFragment() {
+ private val tripRecordList = ArrayList()
+ override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_trip_record
+
+ override fun initViews() {
+ btnInsert.setOnClickListener {
+ TripRecordDataManager.insertTripRecord(TripRecord(id = 456, eventType = 456,eventId = "456"))
+ }
+ btnUpdate.setOnClickListener {
+ TripRecordDataManager.syncRoadEventModifyState(eventId = "456", modifyType = "2")
+ }
+ btnQuery.setOnClickListener {
+ Log.d(MODULE_NAME, "local list: $tripRecordList")
+ mPresenter.queryAllTripRecord()
+ }
+ }
+
+ override fun createPresenter(): TripRecordPresenter = TripRecordPresenter(this)
+
+ fun refreshTripRecordList(tripRecords: List) {
+ Logger.d(MODULE_NAME, "刷新出行动态列表:$tripRecords")
+ tripRecordList.clear()
+ tripRecordList.addAll(tripRecords)
+ }
+
+ /**
+ * 刷新单个出行动态,如果无此动态,新增动态
+ */
+ fun refreshTripRecord(tripRecord: TripRecord) {
+ Logger.d(MODULE_NAME, "刷新单个出行动态: $tripRecord")
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/listener/ITripRecordCallback.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/listener/ITripRecordCallback.kt
new file mode 100644
index 0000000000..6bf2e6208e
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/listener/ITripRecordCallback.kt
@@ -0,0 +1,18 @@
+package com.zhidao.mogo.module.event.panel.listener
+
+import com.zhidao.mogo.module.event.panel.bean.TripRecord
+
+/**
+ * 数据库异步操作数据回调
+ */
+interface ITripRecordCallback {
+ /**
+ * 查询全部出行动态成功
+ */
+ fun queryTripRecordListSuccess(tripRecordList:List)
+
+ /**
+ * 有出行动态新增或更新后,回调此接口
+ */
+ fun insertOrUpdateTripRecordSuccess(tripRecord:TripRecord)
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/EventPanelPresenter.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/EventPanelPresenter.kt
new file mode 100644
index 0000000000..2aa237ed72
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/EventPanelPresenter.kt
@@ -0,0 +1,11 @@
+package com.zhidao.mogo.module.event.panel.presenter
+
+import com.mogo.commons.mvp.Presenter
+import com.zhidao.mogo.module.event.panel.fragment.EventPanelFragment
+
+/**
+ * 事件面板presenter
+ *
+ * @author tongchenfei
+ */
+class EventPanelPresenter(view: EventPanelFragment) : Presenter(view)
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/MySharePresenter.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/MySharePresenter.kt
new file mode 100644
index 0000000000..ab49fba81a
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/MySharePresenter.kt
@@ -0,0 +1,7 @@
+package com.zhidao.mogo.module.event.panel.presenter
+
+import com.mogo.commons.mvp.Presenter
+import com.zhidao.mogo.module.event.panel.fragment.MyShareFragment
+
+class MySharePresenter(view: MyShareFragment) : Presenter(view) {
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/SurroundingEventPresenter.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/SurroundingEventPresenter.kt
new file mode 100644
index 0000000000..871272bb5b
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/SurroundingEventPresenter.kt
@@ -0,0 +1,7 @@
+package com.zhidao.mogo.module.event.panel.presenter
+
+import com.mogo.commons.mvp.Presenter
+import com.zhidao.mogo.module.event.panel.fragment.SurroundingEventFragment
+
+class SurroundingEventPresenter(view: SurroundingEventFragment) : Presenter(view) {
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/TripRecordPresenter.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/TripRecordPresenter.kt
new file mode 100644
index 0000000000..e1dd809210
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/presenter/TripRecordPresenter.kt
@@ -0,0 +1,33 @@
+package com.zhidao.mogo.module.event.panel.presenter
+
+import androidx.lifecycle.LifecycleOwner
+import com.mogo.commons.mvp.Presenter
+import com.zhidao.mogo.module.event.panel.bean.TripRecord
+import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
+import com.zhidao.mogo.module.event.panel.listener.ITripRecordCallback
+import com.zhidao.mogo.module.event.panel.util.TripRecordDataManager
+
+class TripRecordPresenter(view: TripRecordFragment) : Presenter(view),ITripRecordCallback {
+
+ init {
+ TripRecordDataManager.addTripRecordCallback(this)
+ }
+
+ override fun onDestroy(owner: LifecycleOwner) {
+ super.onDestroy(owner)
+ TripRecordDataManager.removeTripRecordCallback(this)
+ }
+
+ fun queryAllTripRecord(){
+ TripRecordDataManager.queryAllTripRecord()
+ }
+
+ override fun queryTripRecordListSuccess(tripRecordList: List) {
+ mView.refreshTripRecordList(tripRecordList)
+ }
+
+ override fun insertOrUpdateTripRecordSuccess(tripRecord: TripRecord) {
+ mView.refreshTripRecord(tripRecord)
+ }
+
+}
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/util/MogoApiManager.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/util/MogoApiManager.kt
new file mode 100644
index 0000000000..d4d52b3c2d
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/util/MogoApiManager.kt
@@ -0,0 +1,14 @@
+package com.zhidao.mogo.module.event.panel.util
+
+import android.content.Context
+import com.alibaba.android.arouter.launcher.ARouter
+import com.mogo.service.IMogoServiceApis
+import com.mogo.service.MogoServicePaths
+
+object MogoApiManager {
+ lateinit var serviceApis:IMogoServiceApis
+
+ fun init(context: Context) {
+ serviceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context) as IMogoServiceApis
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/util/TripRecordDataManager.kt b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/util/TripRecordDataManager.kt
new file mode 100644
index 0000000000..7a373ed714
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/java/com/zhidao/mogo/module/event/panel/util/TripRecordDataManager.kt
@@ -0,0 +1,171 @@
+package com.zhidao.mogo.module.event.panel.util
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.os.Handler
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.mogo.module.common.entity.V2XMessageEntity
+import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.*
+import com.mogo.module.common.entity.V2XRoadEventEntity
+import com.mogo.utils.ThreadPoolService
+import com.mogo.utils.logger.Logger
+import com.mogo.utils.network.utils.GsonUtil
+import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
+import com.zhidao.mogo.module.event.panel.bean.TripRecord
+import com.zhidao.mogo.module.event.panel.dao.TripRecordDao
+import com.zhidao.mogo.module.event.panel.dao.TripRecordDatabase
+import com.zhidao.mogo.module.event.panel.listener.ITripRecordCallback
+import java.util.*
+import kotlin.collections.ArrayList
+
+
+private const val BROADCAST_SCENE_EVENT_ACTION = "com.v2x.scene_local_broadcast"
+private const val BROADCAST_SCENE_MODIFY_ACTION = "com.zhidao.tanlu.dataerror"
+
+private const val BROADCAST_SCENE_EXTRA_KEY = "V2XMessageEntity"
+private const val BORADCAST_SCENE_MODIFY_EVENT_ID_KEY = "id"
+private const val BROADCAST_SCENE_MODIFY_EVENT_UPDATE_TYPE_KEY = "updateType"
+
+/**
+ * 出行动态的数据管理类,由于TripRecordFragment初始化时机较晚,所以封装一个单例类,提早初始化
+ */
+object TripRecordDataManager {
+ private lateinit var context: Context
+ private val sceneEventReceiver = SceneEventReceiver()
+ private lateinit var tripRecordDao: TripRecordDao
+
+ private val tripRecordCallbackList = ArrayList()
+
+ fun init(context: Context) {
+ this.context = context
+ LocalBroadcastManager.getInstance(context).registerReceiver(sceneEventReceiver, IntentFilter(BROADCAST_SCENE_EVENT_ACTION))
+ context.registerReceiver(sceneEventReceiver, IntentFilter(BROADCAST_SCENE_MODIFY_ACTION))
+ tripRecordDao = TripRecordDatabase.getInstance(TripRecordDataManager.context).getTripRecordDao()
+ }
+
+ fun addTripRecordCallback(callback: ITripRecordCallback) {
+ tripRecordCallbackList.add(callback)
+ }
+
+ fun removeTripRecordCallback(callback: ITripRecordCallback) {
+ tripRecordCallbackList.remove(callback)
+ }
+
+ private val handler = Handler()
+ fun queryAllTripRecord() {
+ ThreadPoolService.singleExecute {
+ val limitTime = countLimitTime()
+ // 查询所有的出行动态
+ val tripRecordList = tripRecordDao.queryAllTripRecord(limitTime)
+ Logger.d(MODULE_NAME, "查询所有出行动态,limitTime: $limitTime, list: $tripRecordList")
+ // 删除超时的出行动态
+ tripRecordDao.deleteOvertimeTripRecord(limitTime)
+ // 切换线程回调
+ handler.post {
+ tripRecordCallbackList.forEach { callback ->
+ callback.queryTripRecordListSuccess(tripRecordList)
+ }
+ }
+ }
+ }
+
+ fun insertTripRecord(record: TripRecord) {
+ ThreadPoolService.singleExecute {
+ // 先查一下此数据是否存在
+ Logger.d(MODULE_NAME, "出行动态入库===$record")
+
+ var check = tripRecordDao.queryTripRecordById(record.id)
+
+ if (check == null) {
+ Logger.d(MODULE_NAME, "数据库中不存在此数据,直接插入")
+ check = record
+ tripRecordDao.insert(record)
+ } else {
+ Logger.d(MODULE_NAME, "数据库中存在此数据,更新recordTime即可,其他参数不变")
+ check.recordTime = System.currentTimeMillis()
+ tripRecordDao.update(check)
+ }
+ // 为了防止只进不出,所以在插入新数据时,进行过期数据删除操作
+ tripRecordDao.deleteOvertimeTripRecord(countLimitTime())
+ // 切换线程回调
+ handler.post {
+ tripRecordCallbackList.forEach { callback ->
+ callback.insertOrUpdateTripRecordSuccess(check)
+ }
+ }
+ }
+ }
+
+ /**
+ * 计算约束时间,即当日0时
+ */
+ private fun countLimitTime(): Long {
+ val calendar = Calendar.getInstance()
+ calendar.time = Date()
+ calendar.set(Calendar.HOUR_OF_DAY, 0)
+ calendar.set(Calendar.MINUTE, 0)
+ calendar.set(Calendar.SECOND, 0)
+ return calendar.timeInMillis
+ }
+
+ /**
+ * 处理道路事件推送,保存到本地数据库
+ * 目前只处理道路事件,违章提醒,他车求助,其他事件暂不处理
+ */
+ private fun dealSceneMessage(type: Int, content: Any) {
+ if (type in arrayOf(ALERT_ROAD_WARNING, ALERT_ILLEGAL_PARK_WARNING, ALERT_SEEK_WARNING)) {
+ val eventId = if (type == ALERT_ROAD_WARNING) {
+ val event = content as V2XRoadEventEntity
+ event.noveltyInfo.infoId
+ } else {
+ ""
+ }
+ Logger.d(MODULE_NAME, "处理场景事件,准备插入数据库===eventId: $eventId")
+ insertTripRecord(TripRecord(id = content.hashCode(), eventId = eventId, eventType = type, entity = GsonUtil.jsonFromObject(content)))
+ }
+ }
+
+ /**
+ * 本地数据库同步v2x传过来的纠错信息
+ */
+ fun syncRoadEventModifyState(eventId: String, modifyType: String) {
+ Logger.d(MODULE_NAME, "准备同步纠错信息: $eventId, $modifyType")
+ ThreadPoolService.singleExecute {
+ // 找出需要纠错的数据
+ val willModify = tripRecordDao.queryTripRecordByEventId(eventId)
+ if (willModify != null) {
+ // 查到数据进行修改,如果查不到数据,就不做操作了
+ Logger.d(MODULE_NAME, "准备修改纠错状态:$willModify")
+ willModify.usefulStatus = modifyType
+ tripRecordDao.update(willModify)
+ // 切线程回调
+ handler.post {
+ tripRecordCallbackList.forEach { callback ->
+ callback.insertOrUpdateTripRecordSuccess(willModify)
+ }
+ }
+ }
+ }
+ }
+
+ class SceneEventReceiver : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ Logger.d(MODULE_NAME, "收到V2X事件推送===")
+ when (intent.action) {
+ BROADCAST_SCENE_EVENT_ACTION -> {
+ // 道路事件推送
+ val message = intent.getSerializableExtra(BROADCAST_SCENE_EXTRA_KEY) as V2XMessageEntity<*>
+ Logger.d(MODULE_NAME, "道路事件推送 type: ${message.type}, content: ${message.content}")
+ dealSceneMessage(message.type, message.content)
+ }
+ BROADCAST_SCENE_MODIFY_ACTION -> {
+ // 纠错推送
+ syncRoadEventModifyState(intent.getStringExtra(BORADCAST_SCENE_MODIFY_EVENT_ID_KEY), intent.getStringExtra(BROADCAST_SCENE_MODIFY_EVENT_UPDATE_TYPE_KEY))
+ }
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_event_panel.xml b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_event_panel.xml
new file mode 100644
index 0000000000..3536c79096
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_event_panel.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_my_share.xml b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_my_share.xml
new file mode 100644
index 0000000000..3a5d7413a6
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_my_share.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_surrounding_event.xml b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_surrounding_event.xml
new file mode 100644
index 0000000000..58d69b494e
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_surrounding_event.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_trip_record.xml b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_trip_record.xml
new file mode 100644
index 0000000000..734133c3be
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/res/layout/module_event_panel_fragment_trip_record.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-event-panel/src/main/res/values-xhdpi/dimens.xml
new file mode 100644
index 0000000000..a6b3daec93
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/res/values-xhdpi/dimens.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-event-panel/src/main/res/values/dimens.xml b/modules/mogo-module-event-panel/src/main/res/values/dimens.xml
new file mode 100644
index 0000000000..a6b3daec93
--- /dev/null
+++ b/modules/mogo-module-event-panel/src/main/res/values/dimens.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/README.md b/modules/mogo-module-extensions/README.md
index d056ef61b8..0c9544301a 100644
--- a/modules/mogo-module-extensions/README.md
+++ b/modules/mogo-module-extensions/README.md
@@ -1,9 +1,9 @@
# launcher头部模块
-## 小智语音
-
## 通知
## 天气
-## 时间
\ No newline at end of file
+## 时间
+
+## 入口按钮,高德SDK导航控制
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/build.gradle b/modules/mogo-module-extensions/build.gradle
index ae9b257292..e9737fc1a3 100644
--- a/modules/mogo-module-extensions/build.gradle
+++ b/modules/mogo-module-extensions/build.gradle
@@ -43,7 +43,6 @@ dependencies {
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.rxjava
implementation rootProject.ext.dependencies.rxandroid
- implementation rootProject.ext.dependencies.tanluupload
if (Boolean.valueOf(RELEASE)) {
api rootProject.ext.dependencies.mogomap
@@ -53,6 +52,7 @@ dependencies {
api rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.moduleshare
+// implementation rootProject.ext.dependencies.moduleventpanel
// implementation rootProject.ext.dependencies.mogomoduleauth
} else {
api project(":libraries:mogo-map")
@@ -62,6 +62,7 @@ dependencies {
api project(':services:mogo-service-api')
implementation project(':modules:mogo-module-common')
implementation project(':modules:mogo-module-share')
+// implementation project(':modules:mogo-module-event-panel')
// implementation project(':modules:mogo-module-authorize')
}
}
diff --git a/modules/mogo-module-extensions/consumer-rules.pro b/modules/mogo-module-extensions/consumer-rules.pro
index e69de29bb2..1c0a524d78 100644
--- a/modules/mogo-module-extensions/consumer-rules.pro
+++ b/modules/mogo-module-extensions/consumer-rules.pro
@@ -0,0 +1,8 @@
+#-----ExtensionModule-----
+-keep class com.mogo.module.extensions.userinfo.**{*;}
+-keep class com.mogo.module.extensions.weather.Phenomena
+-keep class com.mogo.module.extensions.weather.WeatherCallback
+-keep interface com.mogo.module.extensions.net.UserInfoNetApiServices
+-keep class com.mogo.module.extensions.utils.TopViewAnimHelper
+-keep class com.mogo.module.extensions.ExtensionsView
+-keep class com.mogo.module.extensions.ExtensionsModuleConst
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/proguard-rules.pro b/modules/mogo-module-extensions/proguard-rules.pro
index f1b424510d..83112829d5 100644
--- a/modules/mogo-module-extensions/proguard-rules.pro
+++ b/modules/mogo-module-extensions/proguard-rules.pro
@@ -19,3 +19,12 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----ExtensionModule-----
+-keep class com.mogo.module.extensions.userinfo.**{*;}
+-keep class com.mogo.module.extensions.weather.Phenomena
+-keep class com.mogo.module.extensions.weather.WeatherCallback
+-keep interface com.mogo.module.extensions.net.UserInfoNetApiServices
+-keep class com.mogo.module.extensions.utils.TopViewAnimHelper
+-keep class com.mogo.module.extensions.ExtensionsView
+-keep class com.mogo.module.extensions.ExtensionsModuleConst
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/ExtensionsPresenter.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/ExtensionsPresenter.java
index cef726c5b2..11aa6dee90 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/ExtensionsPresenter.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/ExtensionsPresenter.java
@@ -7,6 +7,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.Presenter;
+import com.mogo.commons.network.Utils;
import com.mogo.module.extensions.net.UserInfoNetApiServices;
import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.module.extensions.userinfo.UserInfoConstant;
@@ -23,7 +24,6 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
import com.mogo.utils.digest.DigestUtils;
import com.mogo.utils.logger.Logger;
-import com.zhidao.auto.platform.util.DeviceUtil;
import java.util.Map;
@@ -113,7 +113,7 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
private UserInfo userInfo;
public void requestUserInfo() {
Map params = new ArrayMap<>();
- params.put("sn", DeviceUtil.getSn());
+ params.put("sn", Utils.getSn());
params.put("source", "2");
String sign = createSign(params, "JGqZw9");
params.put("sig", sign);
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
index 4dcdc4feb7..d177f3106a 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
@@ -3,10 +3,7 @@ package com.mogo.module.extensions.entrance;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.util.Log;
+import android.text.TextUtils;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
@@ -14,12 +11,12 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
-import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.map.listener.IMogoMapListener;
@@ -40,7 +37,9 @@ import com.mogo.module.common.map.Scene;
import com.mogo.module.extensions.ExtensionsModuleConst;
import com.mogo.module.extensions.R;
import com.mogo.module.extensions.navi.NaviInfoView;
+import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.module.extensions.utils.TopViewAnimHelper;
+import com.mogo.module.share.manager.ServiceApisManager;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
@@ -56,12 +55,10 @@ import com.mogo.service.windowview.IMogoTopViewStatusListener;
import com.mogo.utils.LaunchUtils;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.UiThreadHandler;
+import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
-import com.zhidao.roadcondition.service.DelayService;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.Random;
@@ -72,7 +69,7 @@ import java.util.Random;
*
* 描述
*/
-public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresenter >
+public class EntranceFragment extends MvpFragment
implements EntranceView,
IMogoNaviListener,
IMogoMapListener,
@@ -105,10 +102,19 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
private IMogoRegisterCenter mMogoRegisterCenter;
private IMogoAnalytics mAnalytics;
- private IMogoStatusManager mMogoStatusManager;
private EntrancePresenter mEntrancePresenter;
private IMogoStatusManager mStatusManager;
+ public static final int MAX_DISPLAY_MSG_AMOUNT = 99;
+
+ private View mWeatherContainer;
+ private ImageView mWeatherIcon;
+ private TextView mWeatherTemp;
+
+ private View mMsgContainer;
+ private TextView mMsgCounter;
+
+ private ImageView mUserHeadImg;
/**
* 搜索莫模块
@@ -118,56 +124,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
public static boolean isClickShare;
- @DrawableRes
- private int[] mUploadingFrameRes = {
- R.drawable.module_ext_ic_uploading_00000,
- R.drawable.module_ext_ic_uploading_00001,
- R.drawable.module_ext_ic_uploading_00002,
- R.drawable.module_ext_ic_uploading_00003,
- R.drawable.module_ext_ic_uploading_00004,
- R.drawable.module_ext_ic_uploading_00005,
- R.drawable.module_ext_ic_uploading_00006,
- R.drawable.module_ext_ic_uploading_00007,
- R.drawable.module_ext_ic_uploading_00008,
- R.drawable.module_ext_ic_uploading_00009,
- R.drawable.module_ext_ic_uploading_00010,
- R.drawable.module_ext_ic_uploading_00011,
- R.drawable.module_ext_ic_uploading_00012,
- R.drawable.module_ext_ic_uploading_00013,
- R.drawable.module_ext_ic_uploading_00014,
- R.drawable.module_ext_ic_uploading_00015,
- R.drawable.module_ext_ic_uploading_00016,
- R.drawable.module_ext_ic_uploading_00017,
- R.drawable.module_ext_ic_uploading_00018,
- R.drawable.module_ext_ic_uploading_00019,
- R.drawable.module_ext_ic_uploading_00020,
- R.drawable.module_ext_ic_uploading_00021,
- R.drawable.module_ext_ic_uploading_00022,
- R.drawable.module_ext_ic_uploading_00023,
- R.drawable.module_ext_ic_uploading_00024,
- R.drawable.module_ext_ic_uploading_00025,
- R.drawable.module_ext_ic_uploading_00026,
- R.drawable.module_ext_ic_uploading_00027,
- R.drawable.module_ext_ic_uploading_00028,
- R.drawable.module_ext_ic_uploading_00029,
- R.drawable.module_ext_ic_uploading_00030,
- R.drawable.module_ext_ic_uploading_00031,
- R.drawable.module_ext_ic_uploading_00032,
- R.drawable.module_ext_ic_uploading_00033,
- R.drawable.module_ext_ic_uploading_00034,
- R.drawable.module_ext_ic_uploading_00035,
- R.drawable.module_ext_ic_uploading_00036,
- R.drawable.module_ext_ic_uploading_00037,
- R.drawable.module_ext_ic_uploading_00038,
- R.drawable.module_ext_ic_uploading_00039,
- R.drawable.module_ext_ic_uploading_00040
- };
- private int mCurrentUploadFrame = 0;
- private Handler mUploadFrameAnimHandler;
- public static final int MSG_FRAME_ANIM = 307;
- public static final int MSG_STOP_ANIM = 308;
- public static final long TIME_FRAME_INTERVAL_TIME = 80;
-
private Rect mDisplayOverviewBounds;
private boolean toggle = false;
@@ -175,235 +131,206 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
private Runnable mLockCarRunnable = new Runnable() {
@Override
public void run() {
- if ( !mStatusManager.isDisplayOverview() ) {
+ if (!mStatusManager.isDisplayOverview()) {
return;
}
- mStatusManager.setDisplayOverview( TAG, false );
+ mStatusManager.setDisplayOverview(TAG, false);
mMApUIController.recoverLockMode();
}
};
+ private UploadButtonAnimatorController mUploadButtonAnimatorController;
+
@Override
protected int getLayoutId() {
return R.layout.module_ext_layout_entrance;
}
- private List< View > demoCache = new ArrayList<>();
-
- private int[] heights = new int[]{100,200,300};
- private int currentHeight;
-
@Override
protected void initViews() {
- mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
+ mApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(getContext());
- mEntrancePresenter = new EntrancePresenter( getContext(), this );
+ mEntrancePresenter = new EntrancePresenter(getContext(), this);
mMogoFragmentManager = mApis.getFragmentManagerApi();
mStatusManager = mApis.getStatusManagerApi();
- mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
- mUpload = findViewById( R.id.module_entrance_id_upload );
- mUploading = findViewById( R.id.module_entrance_id_uploading );
- mUploadRoadCondition.setOnClickListener( view -> {
-// // todo 测试动画
-// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
-// TextView tv = v.findViewById(R.id.tvIndex);
-// Random random = new Random();
-// currentHeight = heights[random.nextInt(3)];
-// tv.setText(demoCache.size()+" height: "+currentHeight + ": " + v);
-// demoCache.add(v);
-// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, currentHeight);
-// mApis.getTopViewManager().addView(v, params,new IMogoTopViewStatusListener() {
-// @Override
-// public void onViewAdded(View view) {
-// Logger.d(TAG, "onViewAdded: " + view);
-// }
-//
-// @Override
-// public void onViewRemoved(View view) {
-// Logger.d(TAG, "onViewRemoved: " + view);
-// }
-//
-// @Override
-// public void beforeViewAddAnim(View view) {
-// Logger.d(TAG, "beforeViewAddAnim: " + view);
-// }
-//
-// @Override
-// public void beforeViewRemoveAnim(View view) {
-// Logger.d(TAG, "beforeViewRemoveAnim: " + view);
-// }
-// });
- // 原始逻辑
+ mUploadRoadCondition = findViewById(R.id.module_entrance_id_upload_road_condition);
+ mUpload = findViewById(R.id.module_entrance_id_upload);
+ mUploading = findViewById(R.id.module_entrance_id_uploading);
+ mUploadRoadCondition.setOnClickListener(view -> {
showShareDialog();
- } );
+ });
- mDisplayOverview = findViewById( R.id.module_ext_id_display_overview );
- mDisplayOverviewText = findViewById( R.id.module_ext_id_display_overview_text );
- mDisplayOverviewIcon = findViewById( R.id.module_ext_id_display_overview_icon );
- mDisplayOverview.setOnClickListener( view -> {
- if ( !mStatusManager.isDisplayOverview() ) {
- mMApUIController.displayOverview( mDisplayOverviewBounds );
- UiThreadHandler.removeCallbacks( mLockCarRunnable );
- UiThreadHandler.postDelayed( mLockCarRunnable, 20_000 );
- } else {
- mMApUIController.recoverLockMode();
- UiThreadHandler.removeCallbacks( mLockCarRunnable );
+ mDisplayOverview = findViewById(R.id.module_ext_id_display_overview);
+ mDisplayOverviewText = findViewById(R.id.module_ext_id_display_overview_text);
+ mDisplayOverviewIcon = findViewById(R.id.module_ext_id_display_overview_icon);
+ mDisplayOverview.setOnClickListener(view -> {
+ if (getContext() != null) {
+ // 加此判断是解决下面setDisplayOverview后,本Fragment回调中出现not attached to a context问题
+ if (!mStatusManager.isDisplayOverview()) {
+ mMApUIController.displayOverview(mDisplayOverviewBounds);
+ UiThreadHandler.removeCallbacks(mLockCarRunnable);
+ UiThreadHandler.postDelayed(mLockCarRunnable, 20_000);
+ } else {
+ mMApUIController.recoverLockMode();
+ UiThreadHandler.removeCallbacks(mLockCarRunnable);
+ }
+ mStatusManager.setDisplayOverview(TAG, !mStatusManager.isDisplayOverview());
}
- mStatusManager.setDisplayOverview( TAG, !mStatusManager.isDisplayOverview() );
- } );
+ });
- mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
- mMove2CurrentLocation.setOnClickListener( view -> {
-// // todo 测试动画
-// if(!toggle) {
-// TopViewAnimHelper.getInstance().showNaviView();
-// }else{
-// TopViewAnimHelper.getInstance().hideNaviView();
-// }
-// toggle = !toggle;
-// if(demoCache.size()>0) {
-// View v = demoCache.remove(demoCache.size() - 1);
-// boolean isViewAdded = mApis.getTopViewManager().isViewAdded(v);
-// Logger.d(TAG, "isViewAdded===" + isViewAdded);
-// mApis.getTopViewManager().removeView(v);
-// }
-// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
-// TextView tv = v.findViewById(R.id.tvIndex);
-// tv.setText("sub view "+demoCache.size()+" height: "+currentHeight + ": " + v);
-// demoCache.add(v);
-// mApis.getTopViewManager().addSubView(v,new IMogoTopViewStatusListener() {
-// @Override
-// public void onViewAdded(View view) {
-// Logger.d(TAG, "onSubViewAdded: " + view);
-// }
-//
-// @Override
-// public void onViewRemoved(View view) {
-// Logger.d(TAG, "onSubViewRemoved: " + view);
-// }
-//
-// @Override
-// public void beforeViewAddAnim(View view) {
-// Logger.d(TAG, "beforeSubViewAddAnim: " + view);
-// }
-//
-// @Override
-// public void beforeViewRemoveAnim(View view) {
-// Logger.d(TAG, "beforeSubViewRemoveAnim: " + view);
-// }
-// });
- // 原始逻辑
+ mMove2CurrentLocation = findViewById(R.id.module_entrance_id_move2_current_location);
+ mMove2CurrentLocation.setOnClickListener(view -> {
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
- if ( location != null ) {
- if ( !mMogoStatusManager.isV2XShow() ) {
- mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
- mMApUIController.setLockZoom( 16 );
- mMApUIController.changeZoom( 16.0f );
+ if (location != null) {
+ if (!mStatusManager.isV2XShow()) {
+ mStatusManager.setUserInteractionStatus(TAG, true, false);
+ mMApUIController.setLockZoom(16);
+ mMApUIController.changeZoom(16.0f);
}
- if ( mStatusManager.isDisplayOverview() ) {
- mMogoStatusManager.setDisplayOverview( TAG, false );
- UiThreadHandler.removeCallbacks( mLockCarRunnable );
+ if (mStatusManager.isDisplayOverview()) {
+ mStatusManager.setDisplayOverview(TAG, false);
+ UiThreadHandler.removeCallbacks(mLockCarRunnable);
}
- mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
+ mStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.recoverLockMode();
}
- } );
+ });
- if ( DebugConfig.isDebug() ) {
- mMove2CurrentLocation.setOnLongClickListener( view -> {
+ if (DebugConfig.isDebug()) {
+ mMove2CurrentLocation.setOnLongClickListener(view -> {
mApis.getSearchManagerApi().goSettings();
return true;
- } );
+ });
}
-// mNaviInfo = findViewById( R.id.module_entrance_id_navi_info_panel );
- ConstraintLayout rootView = findViewById( R.id.module_entrance_id_top_motion_layout );
- if ( rootView != null ) {
- TopViewAnimHelper.getInstance().init( rootView );
+ ConstraintLayout rootView = findViewById(R.id.module_entrance_id_top_motion_layout);
+ if (rootView != null) {
+ TopViewAnimHelper.getInstance().init(rootView);
}
- mExitNavi = findViewById( R.id.module_entrance_id_exit_navi );
- mExitNavi.setOnClickListener( view -> {
- if ( mMogoNavi != null ) {
- if ( mIsLock ) {
- new WMDialog.Builder( getContext() )
- .setOkButton( R.string.module_commons_button_ok, ( dlg, which ) -> {
+ mExitNavi = findViewById(R.id.module_entrance_id_exit_navi);
+ mExitNavi.setOnClickListener(view -> {
+ if (mMogoNavi != null) {
+ if (mIsLock) {
+ new WMDialog.Builder(getContext())
+ .setOkButton(R.string.module_commons_button_ok, (dlg, which) -> {
dlg.dismiss();
mMogoNavi.stopNavi();
- } )
- .setCancelButton( R.string.module_commons_button_cancel,
- ( dlg, which ) -> {
+ })
+ .setCancelButton(R.string.module_commons_button_cancel,
+ (dlg, which) -> {
dlg.dismiss();
- } )
- .setContent( R.string.module_commons_exit_navi_content )
+ })
+ .setContent(R.string.module_commons_exit_navi_content)
.build()
.show();
} else {
- MapCenterPointStrategy.setMapCenterPointByScene( mMApUIController, Scene.NAVI );
+ MapCenterPointStrategy.setMapCenterPointByScene(mMApUIController, Scene.NAVI);
mMApUIController.recoverLockMode();
}
}
- } );
+ });
- mCameraMode = findViewById( R.id.module_ext_id_north );
- mCameraMode.setOnClickListener( view -> {
- if ( mCameraMode.isSelected() ) {
- mMApUIController.changeMapMode( EnumMapUI.CarUp_2D );
+ mCameraMode = findViewById(R.id.module_ext_id_north);
+ mCameraMode.setOnClickListener(view -> {
+ if (mCameraMode.isSelected()) {
+ mMApUIController.changeMapMode(EnumMapUI.CarUp_2D);
} else {
- mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
+ mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
}
- mCameraMode.setSelected( !mCameraMode.isSelected() );
- mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
- } );
+// mCameraMode.setSelected(!mCameraMode.isSelected());
+// mCameraMode.setText(getString(mCameraMode.isSelected() ? R.string.mode_car_up :
+// R.string.mode_north_up));
+ });
- mApis.getIntentManagerApi().registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, (( intentStr, intent ) -> {
- int key_type = intent.getIntExtra( "KEY_TYPE", 0 );
- int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
- int opera_type = intent.getIntExtra( "EXTRA_OPERA", -1 );
- if ( key_type == 10027 ) {
- if ( opera_type == 0 ) {
- mCameraMode.setSelected( false );
- } else if ( opera_type == 1 ) {
- mCameraMode.setSelected( true );
- }
- mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
- } else if( key_type == 10021 ){
- onStopNavi();
- }
- }) );
- MogoEntranceButtons.save( ButtonIndex.BUTTON1, findViewById( R.id.module_entrance_id_button1 ) );
- MogoEntranceButtons.save( ButtonIndex.BUTTON2, findViewById( R.id.module_entrance_id_button2 ) );
+ mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV,
+ new IMogoIntentListener() {
+ @Override
+ public void onIntentReceived(String intentStr, Intent intent) {
+ int key_type = intent.getIntExtra("KEY_TYPE", 0);
+ int type = intent.getIntExtra("EXTRA_TYPE", -1);
+ int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
+ if (key_type == 10027) {
+ if (opera_type == 0) {
+ mCameraMode.setSelected(false);
+ } else if (opera_type == 1) {
+ mCameraMode.setSelected(true);
+ }
+ mCameraMode.setText(getString(mCameraMode.isSelected() ?
+ R.string.mode_car_up : R.string.mode_north_up));
+ }
+ }
+ });
+ MogoEntranceButtons.save(ButtonIndex.BUTTON1,
+ findViewById(R.id.module_entrance_id_button1));
+ MogoEntranceButtons.save(ButtonIndex.BUTTON2,
+ findViewById(R.id.module_entrance_id_button2));
mDisplayOverviewBounds = new Rect(
- ResourcesHelper.getDimensionPixelSize( getContext(),
- R.dimen.module_map_display_overview_left_margin ),
- ResourcesHelper.getDimensionPixelSize( getContext(),
- R.dimen.module_map_display_overview_top_margin ),
- ResourcesHelper.getDimensionPixelSize( getContext(),
- R.dimen.module_map_display_overview_right_margin ),
- ResourcesHelper.getDimensionPixelSize( getContext(),
- R.dimen.module_map_display_overview_bottom_margin )
+ ResourcesHelper.getDimensionPixelSize(getContext(),
+ R.dimen.module_map_display_overview_left_margin),
+ ResourcesHelper.getDimensionPixelSize(getContext(),
+ R.dimen.module_map_display_overview_top_margin),
+ ResourcesHelper.getDimensionPixelSize(getContext(),
+ R.dimen.module_map_display_overview_right_margin),
+ ResourcesHelper.getDimensionPixelSize(getContext(),
+ R.dimen.module_map_display_overview_bottom_margin)
);
mNaviInfo = new NaviInfoView();
- mNaviInfo.inflate( rootView );
+ mNaviInfo.inflate(rootView);
- findViewById( R.id.module_map_id_navi_bg ).setOnClickListener( view -> {
+ findViewById(R.id.module_map_id_navi_bg).setOnClickListener(view -> {
try {
- LaunchUtils.launchByPkg( getContext(), "com.autonavi.amapauto" );
- } catch ( Exception e ) {
+ LaunchUtils.launchByPkg(getContext(), "com.autonavi.amapauto");
+ } catch (Exception e) {
e.printStackTrace();
}
- } );
+ });
+
+ mWeatherContainer = findViewById(R.id.module_ext_id_weather_container);
+ mWeatherIcon = findViewById(R.id.module_ext_id_weather_icon);
+ mWeatherTemp = findViewById(R.id.module_ext_id_weather_temp);
+
+ mUserHeadImg = findViewById(R.id.ivUserHeadImg);
+
+ mMsgContainer = findViewById(R.id.module_ext_id_msg);
+
+ mMsgContainer.setOnClickListener(view -> {
+ ARouter.getInstance().build("/push/ui/message").navigation(getContext());
+ });
+ mMsgCounter = findViewById(R.id.module_ext_id_msg_counter);
+ mUserHeadImg.setOnClickListener(view -> {
+ // todo 测试代码
+// mApis.getEventPanelManager().showPanel();
+ // 原始逻辑
+ try {
+ LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal");
+ // 埋点
+ final Map properties = new HashMap<>();
+ properties.put("type", 3);
+ ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon",
+ properties);
+ } catch (Exception e) {
+ Logger.e(TAG, e, "打开个人中心Exception");
+ }
+ });
+
+ mUserHeadImg.setVisibility(DebugConfig.isLauncher() ? View.VISIBLE : View.GONE);
+
+ mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
+ mStatusManager);
+
+ debugTopView();
}
public void showShareDialog() {
isClickShare = true;
mApis.getShareManager().showShareDialog();
- traceData( "1" );
+ traceData("1");
}
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
@@ -416,27 +343,25 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
}
@Override
- public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
- super.onActivityCreated( savedInstanceState );
+ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
mService = mApis.getMapServiceApi();
mMogoRegisterCenter = mApis.getRegisterCenterApi();
mMApUIController = mService.getMapUIController();
- mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
- mMogoNavi = mService.getNavi( getContext() );
+ mMogoLocationClient = mService.getSingletonLocationClient(getContext());
+ mMogoNavi = mService.getNavi(getContext());
mAnalytics = mApis.getAnalyticsApi();
- mMogoStatusManager = mApis.getStatusManagerApi();
- mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
- mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
- mMogoRegisterCenter.registerMogoAimlessModeListener( TAG, this );
+ mMogoRegisterCenter.registerMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
+ mMogoRegisterCenter.registerMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
+ mMogoRegisterCenter.registerMogoAimlessModeListener(TAG, this);
- mMogoMarkerManager = mService.getMarkerManager( getContext() );
+ mMogoMarkerManager = mService.getMarkerManager(getContext());
- mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.UPLOADING, this );
- mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.DISPLAY_OVERVIEW,
- this );
+ mStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.UPLOADING, this);
+ mStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW, this);
- TopViewAnimHelper.getInstance().setIMogoMapUIController( mMApUIController );
+ TopViewAnimHelper.getInstance().setIMogoMapUIController(mMApUIController);
}
@Override
@@ -447,162 +372,224 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
}
@Override
- public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
- if ( naviinfo == null ) {
+ public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
+ if (naviinfo == null) {
return;
}
- if ( mNaviInfo != null ) {
- if ( !mNaviInfo.isVisible() ) {
+ if (mNaviInfo != null) {
+ if (!mNaviInfo.isVisible()) {
// 避免导航先开启,再开启app的情况
onStartNavi();
}
- mNaviInfo.notifyChanged( naviinfo );
+ mNaviInfo.notifyChanged(naviinfo);
}
}
@Override
public void onStartNavi() {
TopViewAnimHelper.getInstance().showNaviView();
- mMApUIController.changeMapMode( mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D :
- EnumMapUI.CarUp_2D );
- MapCenterPointStrategy.setMapCenterPointBySceneAndDelay( mMApUIController, Scene.NAVI, 500
+ mMApUIController.changeMapMode(mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D :
+ EnumMapUI.CarUp_2D);
+ MapCenterPointStrategy.setMapCenterPointBySceneAndDelay(mMApUIController, Scene.NAVI, 500
, () -> {
return !mMogoNavi.isNaviing();
- } );
- if ( CustomNaviInterrupter.getInstance().interrupt() ) {
- mDisplayOverview.setVisibility( View.GONE );
- mCameraMode.setVisibility( View.GONE );
- mExitNavi.setVisibility( View.GONE );
+ });
+ if (CustomNaviInterrupter.getInstance().interrupt()) {
+ mDisplayOverview.setVisibility(View.GONE);
+ mCameraMode.setVisibility(View.GONE);
+ mExitNavi.setVisibility(View.GONE);
} else {
- mExitNavi.setVisibility( View.VISIBLE );
- mDisplayOverview.setVisibility( View.VISIBLE );
- mCameraMode.setVisibility( View.VISIBLE );
+ mExitNavi.setVisibility(View.VISIBLE);
+ mDisplayOverview.setVisibility(View.VISIBLE);
+ mCameraMode.setVisibility(View.VISIBLE);
}
- mApis.getAnalyticsApi().track( "Navigation_begin", new HashMap<>() );
+ mApis.getAnalyticsApi().track("Navigation_begin", new HashMap<>());
}
@Override
public void onStopNavi() {
TopViewAnimHelper.getInstance().hideNaviView();
- mExitNavi.setVisibility( View.GONE );
- mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
- mDisplayOverview.setVisibility( View.GONE );
- mCameraMode.setVisibility( View.GONE );
- MapCenterPointStrategy.setMapCenterPointByScene( mMApUIController, Scene.AIMLESS );
+ mExitNavi.setVisibility(View.GONE);
+ mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
+ mDisplayOverview.setVisibility(View.GONE);
+ mCameraMode.setVisibility(View.GONE);
+ MapCenterPointStrategy.setMapCenterPointByScene(mMApUIController, Scene.AIMLESS);
}
@Override
- public void onUpdateTraffic2( MogoTraffic traffic ) {
- if ( traffic == null ) {
+ public void onUpdateTraffic2(MogoTraffic traffic) {
+ if (traffic == null) {
return;
}
}
@Override
- public void onLockMap( boolean isLock ) {
+ public void onLockMap(boolean isLock) {
mIsLock = isLock;
- if ( isLock ) {
- mExitNavi.setText( R.string.module_ext_str_exit_navi );
- if ( mMogoStatusManager.isDisplayOverview() ) {
- mMogoStatusManager.setDisplayOverview( TAG, false );
+ if (isLock) {
+ mExitNavi.setText(R.string.module_ext_str_exit_navi);
+ if (mStatusManager.isDisplayOverview()) {
+ mStatusManager.setDisplayOverview(TAG, false);
}
} else {
- mExitNavi.setText( R.string.module_ext_str_continue_navi );
+ mExitNavi.setText(R.string.module_ext_str_continue_navi);
}
}
- private void traceData( String from ) {
- Map< String, Object > properties = new HashMap<>();
- properties.put( "from", from );
- mAnalytics.track( "v2x_share_click", properties );
+ private void traceData(String from) {
+ Map properties = new HashMap<>();
+ properties.put("from", from);
+ mAnalytics.track("v2x_share_click", properties);
}
@Override
- public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
- if ( mUploadRoadCondition == null ) {
+ public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
+ if (mUploadRoadCondition == null) {
return;
}
- if ( descriptor == StatusDescriptor.UPLOADING ) {
- if ( isTrue ) {
- mUploading.setVisibility( View.VISIBLE );
- mUpload.setVisibility( View.GONE );
- if ( mUploadFrameAnimHandler != null ) {
- mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
- mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
- }
- doFrameAnimOnUploadButton();
+ if (descriptor == StatusDescriptor.UPLOADING) {
+ if (isTrue) {
+ mUploading.setVisibility(View.VISIBLE);
+ mUpload.setVisibility(View.GONE);
+ mUploadButtonAnimatorController.doFrameAnimOnUploadButton();
} else {
- mCurrentUploadFrame = 0;
- if ( mUploadFrameAnimHandler != null ) {
- mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
- }
- mUploading.setVisibility( View.GONE );
- mUpload.setVisibility( View.VISIBLE );
+ mUploadButtonAnimatorController.stopAnimation();
+ mUploading.setVisibility(View.GONE);
+ mUpload.setVisibility(View.VISIBLE);
}
- } else if ( descriptor == StatusDescriptor.DISPLAY_OVERVIEW ) {
- if ( !mMogoNavi.isNaviing() ) {
+ } else if (descriptor == StatusDescriptor.DISPLAY_OVERVIEW) {
+ if (!mMogoNavi.isNaviing()) {
return;
}
- if ( isTrue ) {
- mDisplayOverviewText.setText( "退出全览" );
- mDisplayOverviewText.setTextSize( TypedValue.COMPLEX_UNIT_PX,
- getResources().getDimensionPixelSize( R.dimen.module_ext_display_overview_textSize ) );
- mCameraMode.setVisibility( View.GONE );
+ if (isTrue) {
+ mDisplayOverviewText.setText("退出全览");
+ mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ AbsMogoApplication.getApp().getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize));
+ mCameraMode.setVisibility(View.GONE);
} else {
- mDisplayOverviewText.setText( "全览" );
- mDisplayOverviewText.setTextSize( TypedValue.COMPLEX_UNIT_PX,
- getResources().getDimensionPixelSize( R.dimen.module_ext_display_overview_textSize_large ) );
- if ( CustomNaviInterrupter.getInstance().interrupt() ) {
- mCameraMode.setVisibility( View.GONE );
+ mDisplayOverviewText.setText("全览");
+ mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ AbsMogoApplication.getApp().getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize_large));
+ if (CustomNaviInterrupter.getInstance().interrupt()) {
+ mCameraMode.setVisibility(View.GONE);
} else {
- mCameraMode.setVisibility( View.VISIBLE );
+ mCameraMode.setVisibility(View.VISIBLE);
}
}
- } else if (descriptor == StatusDescriptor.ACC_STATUS) {
- Log.d(TAG, " onStatusChanged isTrue = " + isTrue);
- if ( isTrue ) {
- DelayService.Companion.launchService(getContext());
- }
}
}
- private void doFrameAnimOnUploadButton() {
- if ( mUploadFrameAnimHandler == null ) {
- mUploadFrameAnimHandler = new Handler( Looper.getMainLooper() ) {
- @Override
- public void handleMessage( Message msg ) {
- super.handleMessage( msg );
- if ( msg.what == MSG_FRAME_ANIM ) {
- if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
- if ( mUploading != null ) {
- mUploading.setVisibility( View.GONE );
- }
- if ( mUpload != null ) {
- mUpload.setVisibility( View.VISIBLE );
- }
- return;
- }
- if ( !mMogoStatusManager.isUploading() ) {
- mCurrentUploadFrame = 0;
- return;
- }
- if ( mUploading != null ) {
- if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
- mCurrentUploadFrame = 12;
- }
- mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
- }
- mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM,
- TIME_FRAME_INTERVAL_TIME );
- } else if ( msg.what == MSG_STOP_ANIM ) {
- mStatusManager.setUploadingStatus( TAG, false );
- }
- }
- };
+
+ @Override
+ public void renderWeatherInfo(String temp, String desc, int iconId) {
+ boolean hidden = false;
+ if (iconId != 0) {
+ mWeatherIcon.setImageResource(iconId);
+ mWeatherIcon.setVisibility(View.VISIBLE);
+ } else {
+ mWeatherIcon.setVisibility(View.GONE);
+ hidden |= true;
}
- mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
- // 30s 后无论成功与否,停止动画
- mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
+ hidden |= TextUtils.isEmpty(temp);
+ hidden |= TextUtils.isEmpty(desc);
+ mWeatherTemp.setText(temp);
+ mWeatherContainer.setVisibility(hidden ? View.INVISIBLE : View.VISIBLE);
+ }
+
+ @Override
+ public void renderMsgInfo(boolean hasMsg, int amount) {
+ mMsgContainer.setVisibility(hasMsg ? View.VISIBLE : View.GONE);
+ mMsgCounter.setText(amount > MAX_DISPLAY_MSG_AMOUNT ?
+ getString(R.string.module_ext_str_dots) : String.valueOf(amount));
+ }
+
+ @Override
+ public void renderUserInfo(UserInfo userInfo) {
+ if (userInfo != null) {
+ Logger.d(TAG, "renderUserInfo: " + userInfo);
+ GlideApp.with(getContext()).load(userInfo.getHeadImgurl()).placeholder(R.drawable.model_ext_default_user_head).circleCrop().into(mUserHeadImg);
+ }
+ }
+
+ private int[] heights = new int[]{100, 200, 300};
+ private int currentHeight;
+
+ private void debugTopView() {
+ findViewById(R.id.btnDebugCtrlNaviView).setOnClickListener(view -> {
+ if (!toggle) {
+ TopViewAnimHelper.getInstance().showNaviView();
+ } else {
+ TopViewAnimHelper.getInstance().hideNaviView();
+ }
+ toggle = !toggle;
+ });
+
+ findViewById(R.id.btnDebugCtrlSubView).setOnClickListener(view -> {
+ View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
+ TextView tv = v.findViewById(R.id.tvIndex);
+ tv.setText("sub view height: " + currentHeight + ": " + v);
+ mApis.getTopViewManager().addSubView(v, new IMogoTopViewStatusListener() {
+ @Override
+ public void onViewAdded(View view) {
+ Logger.d(TAG, "onSubViewAdded: " + view);
+ }
+
+ @Override
+ public void onViewRemoved(View view) {
+ Logger.d(TAG, "onSubViewRemoved: " + view);
+ }
+
+ @Override
+ public void beforeViewAddAnim(View view) {
+ Logger.d(TAG, "beforeSubViewAddAnim: " + view);
+ }
+
+ @Override
+ public void beforeViewRemoveAnim(View view) {
+ Logger.d(TAG, "beforeSubViewRemoveAnim: " + view);
+ }
+ });
+ });
+
+ findViewById(R.id.btnDebugCtrlTopView).setOnClickListener(view -> {
+ View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
+ TextView tv = v.findViewById(R.id.tvIndex);
+ Random random = new Random();
+ currentHeight = heights[random.nextInt(3)];
+ tv.setText(" height: " + currentHeight + ": " + v);
+ ViewGroup.LayoutParams params =
+ new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, currentHeight);
+ mApis.getTopViewManager().addView(v, params, new IMogoTopViewStatusListener() {
+ @Override
+ public void onViewAdded(View view) {
+ Logger.d(TAG, "onViewAdded: " + view);
+ }
+
+ @Override
+ public void onViewRemoved(View view) {
+ Logger.d(TAG, "onViewRemoved: " + view);
+ }
+
+ @Override
+ public void beforeViewAddAnim(View view) {
+ Logger.d(TAG, "beforeViewAddAnim: " + view);
+ }
+
+ @Override
+ public void beforeViewRemoveAnim(View view) {
+ Logger.d(TAG, "beforeViewRemoveAnim: " + view);
+ }
+ });
+ });
+ }
+
+ @Override
+ public void onMapModeChanged( EnumMapUI ui ) {
+ if ( mCameraMode == null ) {
+ return;
+ }
+ mCameraMode.setSelected(ui == EnumMapUI.NorthUP_2D);
+ mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up : R.string.mode_north_up));
}
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java
index e93ab8a7b9..c4ca90cd05 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java
@@ -1,11 +1,38 @@
package com.mogo.module.extensions.entrance;
import android.content.Context;
+import android.util.ArrayMap;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
+import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.Presenter;
+import com.mogo.commons.network.Utils;
+import com.mogo.module.extensions.R;
+import com.mogo.module.extensions.net.UserInfoNetApiServices;
+import com.mogo.module.extensions.userinfo.UserInfo;
+import com.mogo.module.extensions.userinfo.UserInfoConstant;
+import com.mogo.module.extensions.userinfo.UserInfoResponse;
+import com.mogo.module.extensions.utils.ExtensionsConfig;
+import com.mogo.module.extensions.weather.Phenomena;
+import com.mogo.module.extensions.weather.WeatherCallback;
+import com.mogo.module.extensions.weather.WeatherInfo;
+import com.mogo.module.extensions.weather.WeatherModel;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.service.network.IMogoNetwork;
+import com.mogo.service.statusmanager.IMogoMsgCenter;
+import com.mogo.service.statusmanager.IMogoMsgCenterListener;
+import com.mogo.utils.digest.DigestUtils;
+import com.mogo.utils.logger.Logger;
+
+import java.util.Map;
+
+import io.reactivex.SingleObserver;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
/**
* @author congtaowang
@@ -13,23 +40,123 @@ import com.mogo.commons.mvp.Presenter;
*
* 描述
*/
-public class EntrancePresenter extends Presenter {
+public class EntrancePresenter extends Presenter implements WeatherCallback,
+ IMogoMsgCenterListener {
+ private static final String TAG = "EntrancePresenter";
+
+ private WeatherModel mWeatherModel;
+
+ private IMogoMsgCenter mMsgCenter;
+
+ private IMogoNetwork mNetWork;
public EntrancePresenter(Context context, EntranceView view) {
super(view);
+ mWeatherModel = new WeatherModel( getContext() );
+ mNetWork =
+ ((IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(view.getContext())).getNetworkApi();
}
-
- @Override
- public void onResume(@NonNull LifecycleOwner owner) {
- super.onResume(owner);
- }
-
-
@Override
public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner);
+ mWeatherModel.init( this );
+ mWeatherModel.queryWeatherInformation();
+ mMsgCenter = ( IMogoMsgCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_MSG_CENTER ).navigation();
+ mMsgCenter.registerMsgCenterListener( this );
}
+ @Override
+ public void onWeatherLoaded( WeatherInfo weatherInfo ) {
+ if ( weatherInfo == null ) {
+ return;
+ }
+ String temp = getContext().getResources().getString( R.string.module_ext_str_weather_temp_format, weatherInfo.getTemperature() );
+ Phenomena phenomena = Phenomena.getById( weatherInfo.getPhenomena() );
+ String desc = phenomena == null ? "" : phenomena.nameCn;
+ int resId = phenomena.resId;
+ mView.renderWeatherInfo( temp, desc, resId );
+ }
+
+ @Override
+ public void onMsgChanged( boolean hasMsg, int amount ) {
+ if ( mView != null ) {
+ mView.renderMsgInfo( hasMsg, amount );
+ }
+ }
+
+ @Override
+ public void onResume( @NonNull LifecycleOwner owner ) {
+ super.onResume( owner );
+ if(ExtensionsConfig.needRequestUserInfo()){
+ // 相当于每次onResume都会请求一下个人信息,目的是能够相对及时的同步手机端的个人信息修改
+ requestUserInfo();
+ }
+ }
+
+ @Override
+ public void onPause( @NonNull LifecycleOwner owner ) {
+ super.onPause( owner );
+ }
+
+ @Override
+ public void onDestroy( @NonNull LifecycleOwner owner ) {
+ super.onDestroy( owner );
+ if ( mWeatherModel != null ) {
+ mWeatherModel.destroy();
+ }
+ if ( mMsgCenter != null ) {
+ mMsgCenter.unregisterMsgCenterListener( this );
+ }
+ }
+
+ private UserInfo userInfo;
+ public void requestUserInfo() {
+ Map params = new ArrayMap<>();
+ params.put("sn", Utils.getSn());
+ params.put("source", "2");
+ String sign = createSign(params, "JGqZw9");
+ params.put("sig", sign);
+ mNetWork.create(UserInfoNetApiServices.class, UserInfoConstant.getUserInfoBaseUrl()).requestUserInfo(params).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SingleObserver() {
+ @Override
+ public void onSubscribe(Disposable d) {
+ }
+
+ @Override
+ public void onSuccess(UserInfoResponse userInfoBaseResponse) {
+ userInfo = userInfoBaseResponse.getResult();
+ if(userInfo!=null) {
+ Logger.d(TAG, "获取个人信息成功: " + userInfo);
+ mView.renderUserInfo(userInfo);
+ }else{
+ Logger.e(TAG,"获取个人信息失败");
+ }
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ e.printStackTrace();
+ Logger.e(TAG, e, "获取个人信息失败==");
+ }
+ });
+ }
+
+ private String createSign(Map map, String salt) {
+ try {
+ StringBuilder queryString = new StringBuilder();
+ for (Map.Entry entry : map.entrySet()) {
+ queryString.append(entry.getKey())
+ .append("=")
+ .append(entry.getValue())
+ .append("&");
+ }
+ queryString.append("key=").append(DigestUtils.shaHex(salt));
+ return DigestUtils.shaHex(queryString.toString()).toUpperCase();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Logger.e(TAG, e, "createSign()");
+ return "";
+ }
+ }
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceView.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceView.java
index 5f37f0256d..82abc6df6d 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceView.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceView.java
@@ -1,6 +1,7 @@
package com.mogo.module.extensions.entrance;
import com.mogo.commons.mvp.IView;
+import com.mogo.module.extensions.ExtensionsView;
import com.mogo.module.extensions.userinfo.UserInfo;
/**
@@ -9,5 +10,5 @@ import com.mogo.module.extensions.userinfo.UserInfo;
*
* 描述
*/
-public interface EntranceView extends IView {
+public interface EntranceView extends ExtensionsView {
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/UploadButtonAnimatorController.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/UploadButtonAnimatorController.java
new file mode 100644
index 0000000000..9e2525370c
--- /dev/null
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/UploadButtonAnimatorController.java
@@ -0,0 +1,130 @@
+package com.mogo.module.extensions.entrance;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.DrawableRes;
+
+import com.mogo.module.extensions.R;
+import com.mogo.service.statusmanager.IMogoStatusManager;
+
+public
+/**
+ * @author congtaowang
+ * @since 2020/7/16
+ *
+ * 上传按钮动画
+ */
+class UploadButtonAnimatorController {
+
+ private static final String TAG = "UploadButtonAnimator";
+
+ private ImageView mUploading;
+ private TextView mUpload;
+ private IMogoStatusManager mStatusManager;
+
+ private int mCurrentUploadFrame = 0;
+ public static final int MSG_FRAME_ANIM = 307;
+ public static final int MSG_STOP_ANIM = 308;
+ public static final long TIME_FRAME_INTERVAL_TIME = 80;
+
+ private Handler mUploadFrameAnimHandler = new Handler( Looper.getMainLooper() ) {
+ @Override
+ public void handleMessage( Message msg ) {
+ super.handleMessage( msg );
+ if ( msg.what == MSG_FRAME_ANIM ) {
+ if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
+ if ( mUploading != null ) {
+ mUploading.setVisibility( View.GONE );
+ }
+ if ( mUpload != null ) {
+ mUpload.setVisibility( View.VISIBLE );
+ }
+ return;
+ }
+ if ( !mStatusManager.isUploading() ) {
+ mCurrentUploadFrame = 0;
+ return;
+ }
+ if ( mUploading != null ) {
+ if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
+ mCurrentUploadFrame = 12;
+ }
+ mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
+ }
+ mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM,
+ TIME_FRAME_INTERVAL_TIME );
+ } else if ( msg.what == MSG_STOP_ANIM ) {
+ mStatusManager.setUploadingStatus( TAG, false );
+ }
+ }
+ };
+
+ @DrawableRes
+ private int[] mUploadingFrameRes = {
+ R.drawable.module_ext_ic_uploading_00000,
+ R.drawable.module_ext_ic_uploading_00001,
+ R.drawable.module_ext_ic_uploading_00002,
+ R.drawable.module_ext_ic_uploading_00003,
+ R.drawable.module_ext_ic_uploading_00004,
+ R.drawable.module_ext_ic_uploading_00005,
+ R.drawable.module_ext_ic_uploading_00006,
+ R.drawable.module_ext_ic_uploading_00007,
+ R.drawable.module_ext_ic_uploading_00008,
+ R.drawable.module_ext_ic_uploading_00009,
+ R.drawable.module_ext_ic_uploading_00010,
+ R.drawable.module_ext_ic_uploading_00011,
+ R.drawable.module_ext_ic_uploading_00012,
+ R.drawable.module_ext_ic_uploading_00013,
+ R.drawable.module_ext_ic_uploading_00014,
+ R.drawable.module_ext_ic_uploading_00015,
+ R.drawable.module_ext_ic_uploading_00016,
+ R.drawable.module_ext_ic_uploading_00017,
+ R.drawable.module_ext_ic_uploading_00018,
+ R.drawable.module_ext_ic_uploading_00019,
+ R.drawable.module_ext_ic_uploading_00020,
+ R.drawable.module_ext_ic_uploading_00021,
+ R.drawable.module_ext_ic_uploading_00022,
+ R.drawable.module_ext_ic_uploading_00023,
+ R.drawable.module_ext_ic_uploading_00024,
+ R.drawable.module_ext_ic_uploading_00025,
+ R.drawable.module_ext_ic_uploading_00026,
+ R.drawable.module_ext_ic_uploading_00027,
+ R.drawable.module_ext_ic_uploading_00028,
+ R.drawable.module_ext_ic_uploading_00029,
+ R.drawable.module_ext_ic_uploading_00030,
+ R.drawable.module_ext_ic_uploading_00031,
+ R.drawable.module_ext_ic_uploading_00032,
+ R.drawable.module_ext_ic_uploading_00033,
+ R.drawable.module_ext_ic_uploading_00034,
+ R.drawable.module_ext_ic_uploading_00035,
+ R.drawable.module_ext_ic_uploading_00036,
+ R.drawable.module_ext_ic_uploading_00037,
+ R.drawable.module_ext_ic_uploading_00038,
+ R.drawable.module_ext_ic_uploading_00039,
+ R.drawable.module_ext_ic_uploading_00040
+ };
+
+ public UploadButtonAnimatorController( ImageView mUploading, TextView mUpload, IMogoStatusManager mStatusManager ) {
+ this.mUploading = mUploading;
+ this.mUpload = mUpload;
+ this.mStatusManager = mStatusManager;
+ }
+
+ public void doFrameAnimOnUploadButton() {
+ mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
+ mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
+ mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
+ // 30s 后无论成功与否,停止动画
+ mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
+ }
+
+ public void stopAnimation() {
+ mCurrentUploadFrame = 0;
+ mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
+ }
+}
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 0b6534ba26..9359557453 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
@@ -6,11 +6,10 @@ import android.transition.AutoTransition;
import android.transition.Transition;
import android.transition.TransitionManager;
import android.util.ArrayMap;
+import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
-import android.view.animation.BounceInterpolator;
-import android.view.animation.OvershootInterpolator;
import android.widget.ImageView;
import android.widget.TextView;
@@ -21,7 +20,6 @@ import androidx.constraintlayout.widget.Group;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
-import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.extensions.R;
import com.mogo.module.extensions.navi.TopView;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
@@ -55,6 +53,8 @@ public class TopViewAnimHelper {
private Transition transition = new AutoTransition();
private TextView cameraMode;
+ private float topHeight = 0f;
+
private Handler handler = new Handler();
private TopViewAnimHelper() {
@@ -261,7 +261,7 @@ public class TopViewAnimHelper {
public void startTopInAnim(View view, ViewGroup.LayoutParams params,
IMogoTopViewStatusListener statusListener) {
- if ( topMotionLayout == null ) {
+ if (topMotionLayout == null) {
return;
}
@@ -299,7 +299,7 @@ public class TopViewAnimHelper {
topContainer.removeAllViews();
// 如果高度变化,生硬的变化一下高度
- Logger.d(TAG,"container.height: "+topContainer.getHeight());
+ Logger.d(TAG, "container.height: " + topContainer.getHeight());
if (topContainer.getHeight() != params.height) {
constraintSet.clone(topMotionLayout);
LayoutParams p = topContainer.getLayoutParams();
@@ -309,7 +309,7 @@ public class TopViewAnimHelper {
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
computeNaviMarginTop(params.height));
constraintSet.applyTo(topMotionLayout);
- Logger.d(TAG,"改变container的高度===");
+ Logger.d(TAG, "改变container的高度===");
}
view.setTranslationY(-(params.height));
@@ -379,21 +379,32 @@ public class TopViewAnimHelper {
// 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
// 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
constraintSet.connect(tvNextDistance.getId(), ConstraintSet.BOTTOM,
- ivTurnIcon.getId(), ConstraintSet.BOTTOM);
- constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
- constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BASELINE,
- tvNextDistance.getId(), ConstraintSet.BASELINE);
+ ivTurnIcon.getId(), ConstraintSet.BOTTOM,(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_2));
+// constraintSet.connect(tvNextRoad.getId(), ConstraintSet.TOP,
+// ivTurnIcon.getId(), ConstraintSet.TOP);
+// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
+ constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
+ tvNextDistance.getId(), ConstraintSet.BOTTOM,
+ (int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_6));
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
R.id.module_map_id_navi_next_info_turn_info, ConstraintSet.RIGHT,
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_46));
- constraintSet.clear(ivTurnIcon.getId(),ConstraintSet.TOP);
+ constraintSet.clear(ivTurnIcon.getId(), ConstraintSet.TOP);
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
- naviBg.getId(), ConstraintSet.BOTTOM, (int) getDimen(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
+ naviBg.getId(), ConstraintSet.BOTTOM,
+ (int) getDimen(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
computeNaviMarginTop(params.height));
+
+ // 动态改变相关字体大小
+ tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize_small));
+ tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize_small));
+
}
constraintSet.applyTo(topMotionLayout);
ivTurnIcon.getLayoutParams().height =
@@ -419,122 +430,84 @@ public class TopViewAnimHelper {
* 退出最新的(也就是最上面的)view
*/
private void startLatestTopOutAnim() {
- if(topContainer.getChildCount()>1){
+ if (topContainer.getChildCount() > 1) {
removeSubView(topContainer.getChildAt(topContainer.getChildCount() - 1));
- }else if (topContainer.getChildCount() > 0) {
+ } else if (topContainer.getChildCount() > 0) {
startTopOutAnim(topContainer.getChildAt(topContainer.getChildCount() - 1));
}
}
public void startTopOutAnim(View view) {
- if ( topMotionLayout == null ) {
+ if (topMotionLayout == null) {
return;
}
-
Logger.d("TopViewAnimHelper", "startTopOutAnim=====");
if (!isTopViewOut && viewCaches.contains(view)) {
-// if (topContainer.getChildCount() > 1) {
-// // 顶部view包含多个view,只推出当前view,不进行整体上移
-// Logger.d(TAG,
-// "小view退出: " + view.getTranslationY() + " height: " + view.getHeight());
-// if (statusListenerMap.get(view) != null) {
-// statusListenerMap.get(view).beforeViewRemoveAnim(view);
-// }
-// view.animate().translationY(-(view.getHeight())).setDuration(500).setListener(new Animator.AnimatorListener() {
-// @Override
-// public void onAnimationStart(Animator animation) {
-//
-// }
-//
-// @Override
-// public void onAnimationEnd(Animator animation) {
-// Logger.d(TAG, "onAnimationEnd: " + view);
-// viewCaches.remove(view);
-// topContainer.removeView(view);
-// IMogoTopViewStatusListener listener = statusListenerMap.remove(view);
-// if (listener != null) {
-// listener.onViewRemoved(view);
-// } else {
-// Logger.d(TAG, "listener is null");
-// }
-// }
-//
-// @Override
-// public void onAnimationCancel(Animator animation) {
-// viewCaches.remove(view);
-// topContainer.removeView(view);
-// }
-//
-// @Override
-// public void onAnimationRepeat(Animator animation) {
-//
-// }
-// }).start();
-// } else {
- // 顶部view仅剩一个view,需要整体上移
-// currentAnimatingView = view;
- if (statusListenerMap.get(view) != null) {
- statusListenerMap.get(view).beforeViewRemoveAnim(view);
- }
- isTopViewOut = true;
-// if (naviBg.getVisibility() == View.VISIBLE) {
-// tvNextRoad.setTextSize(getDimen(R.dimen
-// .module_ext_navi_info_panel_next_info_road_textSize));
-// }
- if (naviBg.getVisibility() == View.VISIBLE) {
- remainDistanceGroup.setVisibility(View.VISIBLE);
- remainTimeGroup.setVisibility(View.VISIBLE);
- arriveTimeGroup.setVisibility(View.VISIBLE);
- }
- constraintSet.clone(topMotionLayout);
-
- constraintSet.clear(R.id.module_entrance_id_top_container, ConstraintSet.TOP);
- constraintSet.connect(R.id.module_entrance_id_top_container, ConstraintSet.BOTTOM,
- R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
- TransitionManager.beginDelayedTransition(topMotionLayout, transition);
- checkCameraModePosition(false);
-
- if (naviBg.getVisibility() == View.VISIBLE) {
- // 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
- // 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
- constraintSet.clear(tvNextDistance.getId(), ConstraintSet.BOTTOM);
- constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BASELINE);
- constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
- ivTurnIcon.getId(), ConstraintSet.BOTTOM,
- (int) getDimen(R.dimen.module_map_id_navi_next_info_road_marginBottom));
- constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
- tvNextDistance.getId(), ConstraintSet.LEFT,
- 0);
- constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
- R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP, 0);
- constraintSet.connect(ivTurnIcon.getId(),ConstraintSet.TOP,naviBg.getId(),ConstraintSet.TOP,0);
- constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
- naviBg.getId(), ConstraintSet.BOTTOM, 0);
- }
- constraintSet.applyTo(topMotionLayout);
-
- ivTurnIcon.getLayoutParams().height =
- (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_height);
- ivTurnIcon.getLayoutParams().width =
- (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_width);
- naviBg.getLayoutParams().height =
- (int) topMotionLayout.getContext().getResources().getDimension(R.dimen.module_ext_navi_info_panel_height);
- int scene = 0;
- if (naviBg.getVisibility() == View.VISIBLE) {
- scene = Scene.NAVI;
- } else {
- scene = Scene.AIMLESS;
- }
- Logger.d(TAG, "hide top setMapCenterPointByScene: " + scene);
- MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
+ // 顶部view仅剩一个view,需要整体上移
+ if (statusListenerMap.get(view) != null) {
+ statusListenerMap.get(view).beforeViewRemoveAnim(view);
}
+ isTopViewOut = true;
+ if (naviBg.getVisibility() == View.VISIBLE) {
+ remainDistanceGroup.setVisibility(View.VISIBLE);
+ remainTimeGroup.setVisibility(View.VISIBLE);
+ arriveTimeGroup.setVisibility(View.VISIBLE);
+ tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize));
+ tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize));
+
+ }
+ constraintSet.clone(topMotionLayout);
+
+ constraintSet.clear(R.id.module_entrance_id_top_container, ConstraintSet.TOP);
+ constraintSet.connect(R.id.module_entrance_id_top_container, ConstraintSet.BOTTOM,
+ R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
+ TransitionManager.beginDelayedTransition(topMotionLayout, transition);
+ checkCameraModePosition(false);
+
+ if (naviBg.getVisibility() == View.VISIBLE) {
+ // 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
+ // 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
+ constraintSet.clear(tvNextDistance.getId(), ConstraintSet.BOTTOM);
+// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BASELINE);
+ constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
+ ivTurnIcon.getId(), ConstraintSet.BOTTOM,
+ (int) getDimen(R.dimen.module_map_id_navi_next_info_road_marginBottom));
+ constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
+ tvNextDistance.getId(), ConstraintSet.LEFT,
+ 0);
+ constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
+ R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP, 0);
+ constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
+ ConstraintSet.TOP, 0);
+ constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
+ naviBg.getId(), ConstraintSet.BOTTOM, 0);
+ }
+ constraintSet.applyTo(topMotionLayout);
+
+ ivTurnIcon.getLayoutParams().height =
+ (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_height);
+ ivTurnIcon.getLayoutParams().width =
+ (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_width);
+ naviBg.getLayoutParams().height =
+ (int) topMotionLayout.getContext().getResources().getDimension(R.dimen.module_ext_navi_info_panel_height);
+ int scene = 0;
+ if (naviBg.getVisibility() == View.VISIBLE) {
+ scene = Scene.NAVI;
+ } else {
+ scene = Scene.AIMLESS;
+ }
+ Logger.d(TAG, "hide top setMapCenterPointByScene: " + scene);
+ MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
+ }
// }
}
public void showNaviView() {
- if ( topMotionLayout == null ) {
+ if (topMotionLayout == null) {
return;
}
@@ -545,12 +518,18 @@ public class TopViewAnimHelper {
remainDistanceGroup.setVisibility(View.VISIBLE);
remainTimeGroup.setVisibility(View.VISIBLE);
arriveTimeGroup.setVisibility(View.VISIBLE);
+ tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize));
+ tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize));
+
// 调整约束
constraintSet.clone(topMotionLayout);
constraintSet.clear(tvNextDistance.getId(), ConstraintSet.BOTTOM);
- constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BASELINE);
+// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BASELINE);
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM, ivTurnIcon.getId(),
- ConstraintSet.BOTTOM);
+ ConstraintSet.BOTTOM,
+ (int) getDimen(R.dimen.module_map_id_navi_next_info_road_marginBottom));
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
tvNextDistance.getId(), ConstraintSet.LEFT,
0);
@@ -564,7 +543,8 @@ public class TopViewAnimHelper {
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
0);
- constraintSet.connect(ivTurnIcon.getId(),ConstraintSet.TOP,naviBg.getId(),ConstraintSet.TOP,0);
+ constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
+ ConstraintSet.TOP, 0);
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
naviBg.getId(), ConstraintSet.BOTTOM, 0);
constraintSet.applyTo(topMotionLayout);
@@ -573,29 +553,29 @@ public class TopViewAnimHelper {
remainDistanceGroup.setVisibility(View.GONE);
remainTimeGroup.setVisibility(View.GONE);
arriveTimeGroup.setVisibility(View.GONE);
+ tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize_small));
+ tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize_small));
// 调整约束
constraintSet.clone(topMotionLayout);
constraintSet.connect(tvNextDistance.getId(), ConstraintSet.BOTTOM,
- ivTurnIcon.getId(), ConstraintSet.BOTTOM);
- constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
- constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BASELINE,
- tvNextDistance.getId(), ConstraintSet.BASELINE);
+ ivTurnIcon.getId(), ConstraintSet.BOTTOM,
+ (int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_2));
+// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
+ constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
+ tvNextDistance.getId(), ConstraintSet.BOTTOM,
+ (int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_6));
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
R.id.module_map_id_navi_next_info_turn_info, ConstraintSet.RIGHT,
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_46));
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
computeNaviMarginTop(topContainer.getHeight()));
-// ivTurnIcon.getLayoutParams().height =
-// (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_height);
-// ivTurnIcon.getLayoutParams().width =
-// (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_width);
-// naviBg.getLayoutParams().height =
-// (int) topMotionLayout.getContext().getResources().getDimension(R.dimen
-// .module_ext_navi_info_panel_small_height);
- constraintSet.clear(ivTurnIcon.getId(),ConstraintSet.TOP);
+ constraintSet.clear(ivTurnIcon.getId(), ConstraintSet.TOP);
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
- naviBg.getId(), ConstraintSet.BOTTOM, (int) getDimen(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
+ naviBg.getId(), ConstraintSet.BOTTOM,
+ (int) getDimen(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
constraintSet.applyTo(topMotionLayout);
scene = Scene.NAVI;
}
@@ -606,7 +586,7 @@ public class TopViewAnimHelper {
public void hideNaviView() {
- if ( topMotionLayout == null ) {
+ if (topMotionLayout == null) {
return;
}
@@ -651,11 +631,11 @@ public class TopViewAnimHelper {
}
private float getDimen(int resId) {
- return (int) topMotionLayout.getContext().getResources().getDimension(resId);
+ return (int) topMotionLayout.getContext().getResources().getDimensionPixelSize(resId);
}
private int computeNaviMarginTop(int height) {
- int result = (int) (height - (getDimen(R.dimen.dp_350) - getDimen(R.dimen.dp_316)));
+ int result = (int) (height - (getDimen(R.dimen.module_ext_top_over_navi_height)));
Logger.d(TAG, "computeNaviMarginTop: " + height + " result: " + result);
return result;
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java
index 41198a70d4..c5f4d77e80 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java
@@ -6,8 +6,12 @@ import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import com.alibaba.android.arouter.facade.annotation.Route;
+import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.module.extensions.R;
+import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
+import com.mogo.service.statusmanager.IMogoStatusChangedListener;
+import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
@@ -19,33 +23,32 @@ import com.mogo.service.windowview.IMogoTopViewStatusListener;
@Route(path = MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER)
public class TopViewManager implements IMogoTopViewManager {
-// @Override
-// public void addTopView(View view, ViewGroup.LayoutParams params) {
-// TopViewAnimHelper.getInstance().startTopInAnim(view, params);
-// }
-//
-// @Override
-// public void removeTopView() {
-// TopViewAnimHelper.getInstance().startTopOutAnim();
-// }
-
private Context context;
private LayoutParams parentParams;
+ private IMogoServiceApis serviceApis;
+
@Override
public void init(Context context) {
this.context = context;
+ serviceApis =
+ (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
+ serviceApis.getStatusManagerApi().registerStatusChangedListener(MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER, StatusDescriptor.MAIN_PAGE_RESUME, (descriptor, isTrue) -> {
+ if (!isTrue) {
+ TopViewAnimHelper.getInstance().removeAllView();
+ }
+ });
}
@Override
public void addView(View view) {
addView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- (int) context.getResources().getDimension(R.dimen.dp_350)),null);
+ (int) context.getResources().getDimension(R.dimen.dp_350)), null);
}
@Override
public void addView(View view, IMogoTopViewStatusListener statusListener) {
addView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- (int) context.getResources().getDimension(R.dimen.dp_350)),statusListener);
+ (int) context.getResources().getDimension(R.dimen.dp_350)), statusListener);
}
@Override
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info1.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info1.png
new file mode 100644
index 0000000000..f9cfe3d8ba
Binary files /dev/null and b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info1.png differ
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info2.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info2.png
new file mode 100644
index 0000000000..71cb049800
Binary files /dev/null and b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info2.png differ
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info3.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info3.png
new file mode 100644
index 0000000000..2f3f0e54d9
Binary files /dev/null and b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_ext_ic_navi_info3.png differ
diff --git a/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_common_corner_bkg.xml b/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_common_corner_bkg.xml
index 9c3715fa3a..a5e236e189 100644
--- a/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_common_corner_bkg.xml
+++ b/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_common_corner_bkg.xml
@@ -1,9 +1,15 @@
+ -
+
+
+
+
+
-
-
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_upload_road_condition_bkg.xml b/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_upload_road_condition_bkg.xml
index 16e096724d..5fe60723c9 100644
--- a/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_upload_road_condition_bkg.xml
+++ b/modules/mogo-module-extensions/src/main/res/drawable/module_ext_dw_upload_road_condition_bkg.xml
@@ -1,5 +1,11 @@
+ -
+
+
+
+
+
-
diff --git a/modules/mogo-module-extensions/src/main/res/layout-xhdpi-1920x1000/include_navi_info_panle.xml b/modules/mogo-module-extensions/src/main/res/layout-xhdpi-1920x1000/include_navi_info_panle.xml
new file mode 100644
index 0000000000..a751411906
--- /dev/null
+++ b/modules/mogo-module-extensions/src/main/res/layout-xhdpi-1920x1000/include_navi_info_panle.xml
@@ -0,0 +1,237 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/layout/demo_top.xml b/modules/mogo-module-extensions/src/main/res/layout/demo_top.xml
index 35d63b4697..21851e18a4 100644
--- a/modules/mogo-module-extensions/src/main/res/layout/demo_top.xml
+++ b/modules/mogo-module-extensions/src/main/res/layout/demo_top.xml
@@ -2,7 +2,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml
index 95ceaa4c07..bae7449c91 100644
--- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml
+++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml
@@ -6,226 +6,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
-
-
-
-
-
-
-
+ android:layout_height="wrap_content" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -385,4 +174,36 @@
android:visibility="gone" />
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_extensions.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_extensions.xml
index 827a2becac..fc46b65df5 100644
--- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_extensions.xml
+++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_extensions.xml
@@ -1,21 +1,18 @@
-
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
@@ -71,10 +68,8 @@
android:id="@+id/ivUserHeadImg"
android:layout_width="@dimen/module_ext_height"
android:layout_height="@dimen/module_ext_height"
- android:layout_marginEnd="@dimen/dp_30"
android:src="@drawable/model_ext_default_user_head"
app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-
-
-
\ No newline at end of file
+ app:layout_constraintTop_toTopOf="@+id/module_ext_id_weather_container"
+ app:layout_constraintBottom_toBottomOf="@+id/module_ext_id_weather_container"/>
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml
new file mode 100644
index 0000000000..0e3d697760
--- /dev/null
+++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml
@@ -0,0 +1,145 @@
+
+
+
+ 90px
+ 32px
+ 2px
+ 16px
+ 26px
+ 26px
+ 32px
+
+ 90px
+ 32px
+ 2px
+ 100px
+ 90px
+ 2px
+ 54px
+ 100px
+ 90px
+
+ 180px
+ 180px
+ 2px
+ 60px
+ 60px
+ 28px
+
+ 32px
+ 2px
+
+ 120px
+ 32px
+ 60px
+ 92px
+ 24px
+ 48px
+ 2px
+ 120px
+ 120px
+ 120px
+ 40px
+ 30px
+ 32px
+ 32px
+
+ 120px
+ 120px
+ 32px
+ 60px
+ 32px
+ 60px
+ 32px
+ 20px
+
+
+ 100px
+ 60px
+ 60px
+ 32px
+ 48px
+ 80px
+ 28px
+ 26px
+ 44px
+ 44px
+ 18px
+ 34px
+ 26px
+ 28px
+ 30px
+ 30px
+ 30px
+ 20px
+
+ 103px
+ 103px
+
+
+ 1058px
+ 210px
+ 144px
+ 159px
+ 159px
+ 70px
+ 70px
+ 24px
+ 83px
+ 24px
+ 40px
+ 60px
+ 50px
+ 12px
+ 10px
+ 40px
+ 30px
+ 34px
+ 24px
+ 28px
+ 23px
+ 17px
+ 17px
+ 36px
+ 36px
+ -2px
+
+ 30px
+ 40px
+ 40px
+ 15px
+ 15px
+ 5px
+ 50px
+ 56px
+ 30px
+ 56px
+ 30px
+ 56px
+ 30px
+ 15px
+ 15px
+
+
+ 1000px
+ 390px
+ 200px
+ 200px
+ 240px
+ 30px
+ 120px
+ 120px
+ 30px
+ 22px
+ 28px
+ 28px
+ 30px
+ 90px
+ 90px
+ 6dp
+ 15px
+ 10px
+ 20px
+
+ 40px
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
index 3f7fae420a..b1e5bf7240 100644
--- a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
+++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
@@ -89,9 +89,11 @@
24px
40px
60px
+ 50px
12px
10px
40px
+ 30px
34px
24px
28px
@@ -139,4 +141,5 @@
10px
20px
+ 34px
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/values/dimens.xml b/modules/mogo-module-extensions/src/main/res/values/dimens.xml
index 4d06184316..3b7a570ba8 100644
--- a/modules/mogo-module-extensions/src/main/res/values/dimens.xml
+++ b/modules/mogo-module-extensions/src/main/res/values/dimens.xml
@@ -91,9 +91,11 @@
13px
20px
32px
+ 32px
7px
5px
22px
+ 22px
18px
24px
@@ -142,4 +144,6 @@
10px
6px
10px
+
+ 19px
\ No newline at end of file
diff --git a/modules/mogo-module-gps-simulator-debug/README.md b/modules/mogo-module-gps-simulator-debug/README.md
new file mode 100644
index 0000000000..3266bdbaae
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-debug/README.md
@@ -0,0 +1 @@
+# GPS 轨迹模拟接口 Debug 实现
diff --git a/modules/mogo-module-gps-simulator-debug/consumer-rules.pro b/modules/mogo-module-gps-simulator-debug/consumer-rules.pro
index e69de29bb2..b5cb3815dd 100644
--- a/modules/mogo-module-gps-simulator-debug/consumer-rules.pro
+++ b/modules/mogo-module-gps-simulator-debug/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----GPS-DEBUG-SIMULATOR-----
+-keep class com.mogo.module.gps.simulator.CationVo.*{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-gps-simulator-debug/proguard-rules.pro b/modules/mogo-module-gps-simulator-debug/proguard-rules.pro
index f1b424510d..a49a405e6a 100644
--- a/modules/mogo-module-gps-simulator-debug/proguard-rules.pro
+++ b/modules/mogo-module-gps-simulator-debug/proguard-rules.pro
@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----GPS-DEBUG-SIMULATOR-----
+-keep class com.mogo.module.gps.simulator.CationVo.*{*;}
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
index 4978caa21e..660015b14a 100644
--- 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
@@ -1,5 +1,9 @@
package com.mogo.module.gps.simulator;
+import com.mogo.commons.AbsMogoApplication;
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.utils.storage.SharedPrefsMgr;
+
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -15,6 +19,9 @@ class Utils {
public static final String PROPERTIES = "android.os.SystemProperties";
public static String getSn() {
+ if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
+ return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "allocated_sn" );
+ }
return getSystemProperties( GSM_SERIAL );
}
diff --git a/modules/mogo-module-gps-simulator-noop/README.md b/modules/mogo-module-gps-simulator-noop/README.md
new file mode 100644
index 0000000000..6478f3ac12
--- /dev/null
+++ b/modules/mogo-module-gps-simulator-noop/README.md
@@ -0,0 +1 @@
+# GPS 轨迹模拟接口 Release 实现
diff --git a/modules/mogo-module-gps-simulator/README.md b/modules/mogo-module-gps-simulator/README.md
new file mode 100644
index 0000000000..d396740f2b
--- /dev/null
+++ b/modules/mogo-module-gps-simulator/README.md
@@ -0,0 +1,5 @@
+# GPS 轨迹模拟接口抽象
+
+## 常量定义
+
+## 接口
diff --git a/modules/mogo-module-gps-simulator/consumer-rules.pro b/modules/mogo-module-gps-simulator/consumer-rules.pro
index e69de29bb2..fd85bbf010 100644
--- a/modules/mogo-module-gps-simulator/consumer-rules.pro
+++ b/modules/mogo-module-gps-simulator/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----MogoGSPSimulator-----
+-keep class com.mogo.module.gps.simulator.GpsSimulatorConstants
\ No newline at end of file
diff --git a/modules/mogo-module-gps-simulator/proguard-rules.pro b/modules/mogo-module-gps-simulator/proguard-rules.pro
index f1b424510d..5ee323b27c 100644
--- a/modules/mogo-module-gps-simulator/proguard-rules.pro
+++ b/modules/mogo-module-gps-simulator/proguard-rules.pro
@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----MogoGSPSimulator-----
+-keep class com.mogo.module.gps.simulator.GpsSimulatorConstants
diff --git a/modules/mogo-module-left-panel-noop/.gitignore b/modules/mogo-module-left-panel-noop/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/build.gradle b/modules/mogo-module-left-panel-noop/build.gradle
new file mode 100644
index 0000000000..2bd80f619d
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/build.gradle
@@ -0,0 +1,55 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'com.alibaba.arouter'
+
+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.androidxccorektx
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.arouter
+ kapt rootProject.ext.dependencies.aroutercompiler
+
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-left-panel-noop/consumer-rules.pro b/modules/mogo-module-left-panel-noop/consumer-rules.pro
new file mode 100644
index 0000000000..f18321e8e7
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----ModuleLeftPanel-----
+-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/gradle.properties b/modules/mogo-module-left-panel-noop/gradle.properties
new file mode 100644
index 0000000000..d7f776abc5
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-left-panel-noop
+VERSION_CODE=1
diff --git a/modules/mogo-module-left-panel-noop/proguard-rules.pro b/modules/mogo-module-left-panel-noop/proguard-rules.pro
new file mode 100644
index 0000000000..9e43f5c7e6
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/proguard-rules.pro
@@ -0,0 +1,24 @@
+# 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
+
+#-----ModuleLeftPanel-----
+-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/src/androidTest/java/com/zhidao/mogo/module/left/panel/ExampleInstrumentedTest.kt b/modules/mogo-module-left-panel-noop/src/androidTest/java/com/zhidao/mogo/module/left/panel/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000000..dc1ab9fba3
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/src/androidTest/java/com/zhidao/mogo/module/left/panel/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package com.zhidao.mogo.module.left.panel
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("com.zhidao.mogo.module.left.panel.test", appContext.packageName)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/src/main/AndroidManifest.xml b/modules/mogo-module-left-panel-noop/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..7e3b373193
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelConst.kt b/modules/mogo-module-left-panel-noop/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelConst.kt
new file mode 100644
index 0000000000..fdb5a21ce3
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelConst.kt
@@ -0,0 +1,6 @@
+package com.zhidao.mogo.module.left.panel
+
+object LeftPanelConst {
+ const val MODULE_NAME = "MODULE_LEFT_PANEL"
+ const val PATH_NAME = "/left/panel"
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelProvider.kt b/modules/mogo-module-left-panel-noop/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelProvider.kt
new file mode 100644
index 0000000000..808dda1171
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelProvider.kt
@@ -0,0 +1,73 @@
+package com.zhidao.mogo.module.left.panel
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.service.module.IMogoModuleProvider
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.left.panel.LeftPanelConst.MODULE_NAME
+import com.zhidao.mogo.module.left.panel.LeftPanelConst.PATH_NAME
+
+
+/**
+ * 适配1+16增加的位于左侧的面板页provider的空实现
+ *
+ * @author tongchenfei
+ */
+@Route(path = PATH_NAME)
+class LeftPanelProvider:IMogoModuleProvider {
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun init(context: Context?) {
+ Logger.d(MODULE_NAME, "左侧面板noop模块初始化===")
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String {
+ return ""
+ }
+
+ override fun createView(context: Context?): View? {
+ return null
+ }
+
+ override fun createFragment(context: Context?, data: Bundle?): Fragment? {
+ return null
+ }
+
+ override fun getModuleName(): String {
+ return MODULE_NAME
+ }
+
+ override fun getAppName(): String {
+ return ""
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel-noop/src/test/java/com/zhidao/mogo/module/left/panel/ExampleUnitTest.kt b/modules/mogo-module-left-panel-noop/src/test/java/com/zhidao/mogo/module/left/panel/ExampleUnitTest.kt
new file mode 100644
index 0000000000..fa3e2c384a
--- /dev/null
+++ b/modules/mogo-module-left-panel-noop/src/test/java/com/zhidao/mogo/module/left/panel/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package com.zhidao.mogo.module.left.panel
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/.gitignore b/modules/mogo-module-left-panel/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-left-panel/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/build.gradle b/modules/mogo-module-left-panel/build.gradle
new file mode 100644
index 0000000000..509929f10c
--- /dev/null
+++ b/modules/mogo-module-left-panel/build.gradle
@@ -0,0 +1,58 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'com.alibaba.arouter'
+
+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.androidxccorektx
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.androidxconstraintlayout
+ implementation rootProject.ext.dependencies.arouter
+ kapt rootProject.ext.dependencies.aroutercompiler
+ implementation rootProject.ext.dependencies.rxjava
+ implementation rootProject.ext.dependencies.rxandroid
+
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-left-panel/consumer-rules.pro b/modules/mogo-module-left-panel/consumer-rules.pro
new file mode 100644
index 0000000000..f18321e8e7
--- /dev/null
+++ b/modules/mogo-module-left-panel/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----ModuleLeftPanel-----
+-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/gradle.properties b/modules/mogo-module-left-panel/gradle.properties
new file mode 100644
index 0000000000..b70f64110c
--- /dev/null
+++ b/modules/mogo-module-left-panel/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-left-panel
+VERSION_CODE=1
diff --git a/modules/mogo-module-left-panel/proguard-rules.pro b/modules/mogo-module-left-panel/proguard-rules.pro
new file mode 100644
index 0000000000..9e43f5c7e6
--- /dev/null
+++ b/modules/mogo-module-left-panel/proguard-rules.pro
@@ -0,0 +1,24 @@
+# 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
+
+#-----ModuleLeftPanel-----
+-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/AndroidManifest.xml b/modules/mogo-module-left-panel/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..7e3b373193
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelConst.kt b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelConst.kt
new file mode 100644
index 0000000000..fdb5a21ce3
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelConst.kt
@@ -0,0 +1,6 @@
+package com.zhidao.mogo.module.left.panel
+
+object LeftPanelConst {
+ const val MODULE_NAME = "MODULE_LEFT_PANEL"
+ const val PATH_NAME = "/left/panel"
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelProvider.kt b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelProvider.kt
new file mode 100644
index 0000000000..80a08427d4
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/LeftPanelProvider.kt
@@ -0,0 +1,75 @@
+package com.zhidao.mogo.module.left.panel
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.location.MogoLocation
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.service.module.IMogoModuleProvider
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.left.panel.LeftPanelConst.MODULE_NAME
+import com.zhidao.mogo.module.left.panel.LeftPanelConst.PATH_NAME
+import com.zhidao.mogo.module.left.panel.fragment.SimpleSpeedFragment
+
+
+/**
+ * 适配1+16增加的位于左侧的面板页provider
+ *
+ * @author tongchenfei
+ */
+@Route(path = PATH_NAME)
+class LeftPanelProvider:IMogoModuleProvider {
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun init(context: Context?) {
+ Logger.d(MODULE_NAME, "左侧面板模块初始化===")
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String {
+ return ""
+ }
+
+ override fun createView(context: Context?): View? {
+ return null
+ }
+
+ override fun createFragment(context: Context?, data: Bundle?): Fragment? {
+ return SimpleSpeedFragment()
+ }
+
+ override fun getModuleName(): String {
+ return MODULE_NAME
+ }
+
+ override fun getAppName(): String {
+ return ""
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/fragment/SimpleSpeedFragment.kt b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/fragment/SimpleSpeedFragment.kt
new file mode 100644
index 0000000000..be2d724a0e
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/fragment/SimpleSpeedFragment.kt
@@ -0,0 +1,37 @@
+package com.zhidao.mogo.module.left.panel.fragment
+
+import com.mogo.commons.mvp.MvpFragment
+import com.zhidao.mogo.module.left.panel.R
+import com.zhidao.mogo.module.left.panel.presenter.SimpleSpeedPresenter
+import kotlinx.android.synthetic.main.module_left_panel_simple_speed.*
+
+/**
+ * 临时车速界面的fragment
+ *
+ * @author tongchenfei
+ */
+private const val SPEED_THRESHOLD = 90
+class SimpleSpeedFragment: MvpFragment() {
+ override fun getLayoutId(): Int {
+ return R.layout.module_left_panel_simple_speed
+ }
+
+ override fun initViews() {
+ }
+
+ override fun createPresenter(): SimpleSpeedPresenter {
+ return SimpleSpeedPresenter(this)
+ }
+
+ fun refreshSpeed(speed: Int) {
+ tvModuleLeftPanelSpeed?.let {
+ it.text = speed.toString()
+ if (speed >= SPEED_THRESHOLD) {
+ // 速度超过90,需要改变背景颜色
+ it.setBackgroundResource(R.drawable.module_left_panel_warn_speed_bg)
+ }else{
+ it.setBackgroundResource(R.drawable.module_left_panel_normal_speed_bg)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/presenter/SimpleSpeedPresenter.kt b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/presenter/SimpleSpeedPresenter.kt
new file mode 100644
index 0000000000..3c61bda6bc
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/presenter/SimpleSpeedPresenter.kt
@@ -0,0 +1,41 @@
+package com.zhidao.mogo.module.left.panel.presenter
+
+import android.os.Handler
+import com.alibaba.android.arouter.launcher.ARouter
+import com.mogo.commons.mvp.Presenter
+import com.mogo.service.IMogoServiceApis
+import com.mogo.service.MogoServicePaths
+import com.zhidao.mogo.module.left.panel.LeftPanelConst.MODULE_NAME
+import com.zhidao.mogo.module.left.panel.fragment.SimpleSpeedFragment
+
+/**
+ * 临时左侧车速逻辑的presenter
+ *
+ * @author tongchenfei
+ */
+class SimpleSpeedPresenter(view: SimpleSpeedFragment) : Presenter(view) {
+ private val handler = Handler()
+ private var mogoApis: IMogoServiceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(view.context) as IMogoServiceApis
+ init {
+ // 注册相关回调,监测速度变化
+ mogoApis.registerCenterApi.registerMogoLocationListener(MODULE_NAME) {
+ handler.post {
+ mView.refreshSpeed((it.speed * 3.6).toInt())
+ }
+ }
+
+// mogoApis.registerCenterApi.registerCarLocationChangedListener(MODULE_NAME,object : IMogoCarLocationChangedListener2{
+// override fun onCarLocationChanged2(latLng: Location?) {
+// latLng?.let {
+// handler.post {
+// mView.refreshSpeed(it.speed.toInt())
+// }
+// }
+// }
+//
+// override fun onCarLocationChanged(latLng: MogoLatLng?) {
+// }
+//
+// })
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_normal_speed_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_normal_speed_bg.png
new file mode 100644
index 0000000000..11b66a5431
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_normal_speed_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_speed_container_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_speed_container_bg.png
new file mode 100644
index 0000000000..878ba59b0a
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_speed_container_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_warn_speed_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_warn_speed_bg.png
new file mode 100644
index 0000000000..5bff4390c3
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-ldpi/module_left_panel_warn_speed_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_normal_speed_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_normal_speed_bg.png
new file mode 100644
index 0000000000..11b66a5431
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_normal_speed_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_speed_container_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_speed_container_bg.png
new file mode 100644
index 0000000000..878ba59b0a
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_speed_container_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_warn_speed_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_warn_speed_bg.png
new file mode 100644
index 0000000000..5bff4390c3
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-mdpi/module_left_panel_warn_speed_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_normal_speed_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_normal_speed_bg.png
new file mode 100644
index 0000000000..8fd2088ff7
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_normal_speed_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_speed_container_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_speed_container_bg.png
new file mode 100644
index 0000000000..4e0c972890
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_speed_container_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_warn_speed_bg.png b/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_warn_speed_bg.png
new file mode 100644
index 0000000000..11a4081a26
Binary files /dev/null and b/modules/mogo-module-left-panel/src/main/res/drawable-xhdpi-1920x1000/module_left_panel_warn_speed_bg.png differ
diff --git a/modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml b/modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml
new file mode 100644
index 0000000000..7d8df35030
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-left-panel/src/main/res/values-xhdpi-1920x1000/dimens.xml
new file mode 100644
index 0000000000..91bd49b433
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/res/values-xhdpi-1920x1000/dimens.xml
@@ -0,0 +1,8 @@
+
+
+ 122px
+ 130px
+ 30px
+ 53px
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/main/res/values/dimens.xml b/modules/mogo-module-left-panel/src/main/res/values/dimens.xml
new file mode 100644
index 0000000000..497d822e85
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/res/values/dimens.xml
@@ -0,0 +1,8 @@
+
+
+ 80px
+ 69.6px
+ 20px
+ 28px
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-main/README.md b/modules/mogo-module-main/README.md
new file mode 100644
index 0000000000..e7ab07ca99
--- /dev/null
+++ b/modules/mogo-module-main/README.md
@@ -0,0 +1,18 @@
+# 主模块
+
+## 子模块加载管理
+
+## 加载地图
+
+## 事件分发
+
+## service 后台服务
+
+开启定位、加载基础服务模块:v2x、刷新策略、事件上报模块、初始化 ADAS 服务
+
+## 应用内浮窗管理:车聊聊、音乐等
+
+## 顶部弹窗管理
+
+## scheme 跳转管理
+
diff --git a/modules/mogo-module-main/build.gradle b/modules/mogo-module-main/build.gradle
index e06cc617ba..2f686a9f62 100644
--- a/modules/mogo-module-main/build.gradle
+++ b/modules/mogo-module-main/build.gradle
@@ -50,7 +50,6 @@ dependencies {
api rootProject.ext.dependencies.mogoservice
api rootProject.ext.dependencies.moduleservice
api rootProject.ext.dependencies.moduleapps
- api rootProject.ext.dependencies.mogoconnection
api rootProject.ext.dependencies.moduleextensions
api rootProject.ext.dependencies.mogomoduleback
} else {
@@ -62,7 +61,6 @@ dependencies {
api project(':services:mogo-service-api')
api project(':services:mogo-service')
api project(':modules:mogo-module-apps')
- api project(':foudations:mogo-connection')
api project(':modules:mogo-module-extensions')
api project(':modules:mogo-module-back')
}
diff --git a/modules/mogo-module-main/consumer-rules.pro b/modules/mogo-module-main/consumer-rules.pro
index e69de29bb2..e5fa092e14 100644
--- a/modules/mogo-module-main/consumer-rules.pro
+++ b/modules/mogo-module-main/consumer-rules.pro
@@ -0,0 +1,9 @@
+#-----MainModule-----
+-keep class com.mogo.module.main.cards.CardIntroduceConfig.*{*;}
+-keep class com.mogo.module.main.cards.MogoModulesHandler
+-keep class com.mogo.module.main.cards.HorizentalBaseTransformer
+-keep class com.mogo.module.main.cards.VerticalBaseTransformer
+-keep class com.mogo.module.main.constants.**{*;}
+-keep class com.mogo.module.main.livedata.**{*;}
+-keep class com.mogo.module.main.service.MogoMainService
+-keep class com.mogo.module.main.windowview.IWindowViewHandler
\ No newline at end of file
diff --git a/modules/mogo-module-main/proguard-rules.pro b/modules/mogo-module-main/proguard-rules.pro
index f1b424510d..8cb438dc4b 100644
--- a/modules/mogo-module-main/proguard-rules.pro
+++ b/modules/mogo-module-main/proguard-rules.pro
@@ -19,3 +19,13 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----MainModule-----
+-keep class com.mogo.module.main.cards.CardIntroduceConfig.*{*;}
+-keep class com.mogo.module.main.cards.MogoModulesHandler
+-keep class com.mogo.module.main.cards.HorizentalBaseTransformer
+-keep class com.mogo.module.main.cards.VerticalBaseTransformer
+-keep class com.mogo.module.main.constants.**{*;}
+-keep class com.mogo.module.main.livedata.**{*;}
+-keep class com.mogo.module.main.service.MogoMainService
+-keep class com.mogo.module.main.windowview.IWindowViewHandler
\ No newline at end of file
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java
index f3fec2a330..61c20a0d37 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java
@@ -20,7 +20,11 @@ import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
+import com.mogo.service.obu.IMogoObuDataChangedListener;
import com.mogo.utils.logger.Logger;
+import com.zhidao.smartv2x.model.obu.CarEventInfo;
+import com.zhidao.smartv2x.model.obu.CarLocationInfo;
+import com.zhidao.smartv2x.model.obu.TrafficLightInfo;
import java.util.Iterator;
@@ -37,7 +41,8 @@ public class EventDispatchCenter implements
IMogoCarLocationChangedListener2,
IMogoMapListener,
IMogoNaviListener2,
- IMogoLocationListener {
+ IMogoLocationListener,
+ IMogoObuDataChangedListener {
private static volatile EventDispatchCenter sInstance;
@@ -147,7 +152,7 @@ public class EventDispatchCenter implements
*
* @param callback
*/
- void setMapLoadedCallback( Runnable callback ){
+ void setMapLoadedCallback( Runnable callback ) {
this.mMapLoadedCallback = callback;
}
@@ -157,6 +162,21 @@ public class EventDispatchCenter implements
mMapLoadedCallback.run();
mMapLoadedCallback = null;
}
+
+ Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
+ if ( iterator == null ) {
+ return;
+ }
+ while ( iterator.hasNext() ) {
+ IMogoMapListener listener = iterator.next();
+ if ( listener != null ) {
+ try {
+ listener.onMapLoaded();
+ } catch ( Exception e ) {
+ Logger.e( TAG, e, "error." );
+ }
+ }
+ }
}
@Override
@@ -459,4 +479,48 @@ public class EventDispatchCenter implements
}
}
}
+
+ @Override
+ public void showCarLocationInfo( CarLocationInfo info ) {
+ Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
+ if ( iterator == null ) {
+ return;
+ }
+ while ( iterator.hasNext() ) {
+ iterator.next().showCarLocationInfo( info );
+ }
+ }
+
+ @Override
+ public void showOtherInfo( String info ) {
+ Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
+ if ( iterator == null ) {
+ return;
+ }
+ while ( iterator.hasNext() ) {
+ iterator.next().showOtherInfo( info );
+ }
+ }
+
+ @Override
+ public void showTrafficLightInfo( TrafficLightInfo info ) {
+ Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
+ if ( iterator == null ) {
+ return;
+ }
+ while ( iterator.hasNext() ) {
+ iterator.next().showTrafficLightInfo( info );
+ }
+ }
+
+ @Override
+ public void showCarEventInfo( CarEventInfo info ) {
+ Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
+ if ( iterator == null ) {
+ return;
+ }
+ while ( iterator.hasNext() ) {
+ iterator.next().showCarEventInfo( info );
+ }
+ }
}
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
index e2107ca415..ca02b01d8a 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
@@ -9,28 +9,22 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.viewpager.widget.ViewPager;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.MvpActivity;
import com.mogo.commons.voice.AIAssist;
-import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
-import com.mogo.module.common.MogoModule;
-import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
import com.mogo.module.common.utils.CarSeries;
-import com.mogo.module.main.cards.MogoModulesHandler;
import com.mogo.module.main.cards.MogoModulesManager;
import com.mogo.module.main.service.MogoMainService;
import com.mogo.module.main.windowview.FloatingViewHandler;
-import com.mogo.module.service.ServiceConst;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
@@ -41,8 +35,6 @@ import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
-import org.aspectj.lang.annotation.Around;
-
import java.util.List;
/**
@@ -64,11 +56,12 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected IMogoFragmentManager mMogoFragmentManager;
protected IMogoStatusManager mMogoStatusManager;
- protected View mHeader;
+// protected View mHeader;
protected View mApps;
protected View mEntrance;
protected FrameLayout mFloatingLayout;
protected FrameLayout mCoverUpLayout;
+ protected FrameLayout mLeftPanelLayout;
protected View mLeftShadowFrame;
private boolean mIsHomeKeyDown = false;
@@ -82,12 +75,13 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
getWindow().setBackgroundDrawable( null );
- mHeader = findViewById( R.id.module_main_id_header_fragment_container );
+// mHeader = findViewById( R.id.module_main_id_header_fragment_container );
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
mFloatingLayout = findViewById( R.id.module_main_id_floating_view );
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
+ mLeftPanelLayout = findViewById(R.id.module_main_id_left_panel_fragment_container);
// 避免事件穿透导致地图被滑动
mLeftShadowFrame.setOnClickListener( view -> {
@@ -97,14 +91,14 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// 隐藏布局
protected void hideLayout() {
- mHeader.setVisibility( View.GONE );
+// mHeader.setVisibility( View.GONE );
mEntrance.setVisibility( View.GONE );
mFloatingLayout.setVisibility( View.GONE );
}
// 显示布局
protected void showLayout() {
- mHeader.setVisibility( View.VISIBLE );
+// mHeader.setVisibility( View.VISIBLE );
mEntrance.setVisibility( View.VISIBLE );
mFloatingLayout.setVisibility( View.VISIBLE );
}
@@ -120,6 +114,8 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
if ( mServiceApis == null ) {
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
}
+ mServiceApis.getShareManager().resetContext(this);
+ mServiceApis.getAuthManagerApi().showAuth(this);
mMogoStatusManager = mServiceApis.getStatusManagerApi();
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
AutopilotServiceManage.getInstance().init( getContext() );
@@ -130,6 +126,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
final long start = System.currentTimeMillis();
MogoModulesManager.getInstance().init( this, getApis() );
+ loadSplash();
mMogoMapService = mServiceApis.getMapServiceApi();
if ( mMogoMapService != null ) {
mMogoMapService.getHostListenerRegister().registerHostMapListener( EventDispatchCenter.getInstance() );
@@ -138,6 +135,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mMogoMapService.getHostListenerRegister().registerMarkerClickListener( this );
}
+// IMogoObuManager obuManager = mServiceApis.getObuManager();
+// if(obuManager!=null) {
+// obuManager.registerObuDataChangedListener(EventDispatchCenter.getInstance());
+// }
+
EventDispatchCenter.getInstance().setMapLoadedCallback( () -> {
Logger.d( TAG, "map loaded." + Thread.currentThread().getName() );
@@ -183,8 +185,10 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
}
protected void loadContainerModules() {
- MogoModulesManager.getInstance().loadExtensionsModule( R.id.module_main_id_header_fragment_container );
+// MogoModulesManager.getInstance().loadExtensionsModule( R.id.module_main_id_header_fragment_container );
MogoModulesManager.getInstance().loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
+ MogoModulesManager.getInstance().loadEventPanelModule(R.id.module_main_id_event_panel_fragment_container);
+ MogoModulesManager.getInstance().loadLeftPanelModule(R.id.module_main_id_left_panel_fragment_container);
}
@Override
@@ -203,6 +207,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// mCardsContainer.setAdapter( mCardModulesAdapter );
}
+ @Override
+ public void loadSplash() {
+ MogoModulesManager.getInstance().loadSplashModule(R.id.module_main_id_splash_container);
+ }
+
@NonNull
@Override
protected MainPresenter createPresenter() {
@@ -236,6 +245,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
super.onPause();
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
+ mServiceApis.getAuthManagerApi().dismiss();
if ( shouldCloseADASPanel() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
@@ -301,6 +311,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mMogoMapUIController = null;
mMogoFragmentManager = null;
mServiceApis.getAdasControllerApi().release();
+ mServiceApis.getRefreshStrategyControllerApi().clearAllData();
AIAssist.getInstance( this ).release();
}
}
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainView.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainView.java
index e2b33db244..bdbacc1766 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainView.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainView.java
@@ -32,4 +32,9 @@ public interface MainView extends IView {
* @return
*/
IMogoServiceApis getApis();
+
+ /**
+ * 加载闪屏页
+ */
+ void loadSplash();
}
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java
index b477536dcf..d39eec80db 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java
@@ -18,6 +18,9 @@ import com.mogo.utils.TipToast;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author congtaowang
* @since 2020-04-20
@@ -82,6 +85,9 @@ public class SchemeIntent implements IMogoStatusChangedListener {
break;
case "/main/share":
Logger.d(TAG,"收到打开分享框的scheme,准备打开分享框");
+ Map< String, Object > properties = new HashMap<>();
+ properties.put( "from", "1" );
+ mApis.getAnalyticsApi().track("v2x_share_click", properties);
mApis.getShareManager().showShareDialog();
break;
default:
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java
index 799a0d9377..c07373d5d7 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java
@@ -59,4 +59,22 @@ public interface MogoModulesHandler {
* 2. mogo-module-service
*/
void loadBaseModule();
+
+ /**
+ * 加载事件面板
+ * @param containerId
+ */
+ void loadEventPanelModule(int containerId);
+
+ /**
+ * 加载左侧面板
+ * @param containerId
+ */
+ void loadLeftPanelModule(int containerId);
+
+ /**
+ * 加载比亚迪模块
+ * @param containerId
+ */
+ void loadSplashModule(int containerId);
}
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
index 951a8dea9d..289e76249d 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
@@ -8,9 +8,9 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.extensions.ExtensionsModuleConst;
-import com.mogo.module.main.EventDispatchCenter;
import com.mogo.module.main.MainActivity;
import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.logger.Logger;
@@ -130,6 +130,30 @@ public class MogoModulesManager implements MogoModulesHandler {
addFragment( provider, containerId );
}
+ @Override
+ public void loadEventPanelModule(int containerId) {
+ IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
+ .build(MogoServicePaths.PATH_EVENT_PANEL)
+ .navigation( getContext() );
+ addFragment( provider, containerId );
+ }
+
+ @Override
+ public void loadLeftPanelModule(int containerId) {
+ IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
+ .build(MogoServicePaths.PATH_LEFT_PANEL)
+ .navigation( getContext() );
+ addFragment( provider, containerId );
+ }
+
+ @Override
+ public void loadSplashModule(int containerId) {
+ IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
+ .build(MogoServicePaths.PATH_SPLASH)
+ .navigation( getContext() );
+ addFragment( provider, containerId );
+ }
+
@Override
public void loadBaseModule() {
List< MogoModule > baseModules = MogoModulePaths.getBaseModules();
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenter.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenter.java
index eee8c3ec08..34be3beb93 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenter.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenter.java
@@ -12,9 +12,9 @@ import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoRegisterCenter;
+import com.mogo.service.obu.IMogoObuDataChangedListener;
import java.util.Iterator;
-import java.util.List;
/**
* @author congtaowang
@@ -100,6 +100,16 @@ public class MogoRegisterCenter implements IMogoRegisterCenter {
MogoRegisterCenterHandler.getInstance().unregisterCarLocationChangedListener( tag, listener );
}
+ @Override
+ public void registerObuDataListener(String tag, IMogoObuDataChangedListener listener) {
+ MogoRegisterCenterHandler.getInstance().registerObuDataListener(tag, listener);
+ }
+
+ @Override
+ public void unregisterObuDataListener(String tag) {
+ MogoRegisterCenterHandler.getInstance().unregisterObuDataListener(tag);
+ }
+
@Override
public void init( Context context ) {
}
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenterHandler.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenterHandler.java
index ca0e33a72a..cc9148a3e5 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenterHandler.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/registercenter/MogoRegisterCenterHandler.java
@@ -10,6 +10,7 @@ import com.mogo.map.navi.IMogoCarLocationChangedListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoRegisterCenter;
+import com.mogo.service.obu.IMogoObuDataChangedListener;
import java.util.HashMap;
import java.util.Iterator;
@@ -32,6 +33,7 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
private Map< String, IMogoMarkerClickListener > mMarker = new HashMap<>();
private Map< String, IMogoAimlessModeListener > mAimless = new HashMap<>();
private Map< String, IMogoCarLocationChangedListener > mCarLocations = new HashMap<>();
+ private Map mObus = new HashMap<>();
private MogoRegisterCenterHandler() {
}
@@ -122,6 +124,16 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
mCarLocations.remove( tag );
}
+ @Override
+ public void registerObuDataListener(String tag, IMogoObuDataChangedListener listener) {
+ mObus.put(tag, listener);
+ }
+
+ @Override
+ public void unregisterObuDataListener(String tag) {
+ mObus.remove(tag);
+ }
+
@Override
public void init( Context context ) {
}
@@ -158,6 +170,9 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
return mNavi.values().iterator();
}
+ public Iterator getObuDataChangedListeners(){
+ return mObus.values().iterator();
+ }
@Override
public Iterator< IMogoLocationListener > getLocationListeners() {
return mLocation.values().iterator();
@@ -176,5 +191,4 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
return mCarLocations.values().iterator();
}
-
}
diff --git a/modules/mogo-module-main/src/main/res/drawable-ldpi/module_apps_bg_card.png b/modules/mogo-module-main/src/main/res/drawable-ldpi/module_apps_bg_card.png
deleted file mode 100644
index de1e81e0d9..0000000000
Binary files a/modules/mogo-module-main/src/main/res/drawable-ldpi/module_apps_bg_card.png and /dev/null differ
diff --git a/modules/mogo-module-main/src/main/res/drawable-mdpi/module_apps_bg_card.png b/modules/mogo-module-main/src/main/res/drawable-mdpi/module_apps_bg_card.png
deleted file mode 100644
index de1e81e0d9..0000000000
Binary files a/modules/mogo-module-main/src/main/res/drawable-mdpi/module_apps_bg_card.png and /dev/null differ
diff --git a/modules/mogo-module-main/src/main/res/drawable-xhdpi-1920x1000/module_main_launcher_bg.webp b/modules/mogo-module-main/src/main/res/drawable-xhdpi-1920x1000/module_main_launcher_bg.webp
new file mode 100644
index 0000000000..d39b3abe55
Binary files /dev/null and b/modules/mogo-module-main/src/main/res/drawable-xhdpi-1920x1000/module_main_launcher_bg.webp differ
diff --git a/modules/mogo-module-main/src/main/res/drawable-xhdpi/module_apps_bg_card.png b/modules/mogo-module-main/src/main/res/drawable-xhdpi/module_apps_bg_card.png
deleted file mode 100644
index a82b29541a..0000000000
Binary files a/modules/mogo-module-main/src/main/res/drawable-xhdpi/module_apps_bg_card.png and /dev/null differ
diff --git a/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml b/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml
index 1f9c30d179..bcb2744c24 100644
--- a/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml
+++ b/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml
@@ -9,23 +9,23 @@
+ android:layout_height="match_parent" />
-
-
+
+
+
+
+
+
+
+
+
+
+ android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
+ android:padding="@dimen/module_main_entrance_fragment_container_padding" />
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-main/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-main/src/main/res/values-xhdpi-1920x1000/dimens.xml
new file mode 100644
index 0000000000..abe6f5ac99
--- /dev/null
+++ b/modules/mogo-module-main/src/main/res/values-xhdpi-1920x1000/dimens.xml
@@ -0,0 +1,29 @@
+
+
+
+ 350px
+ 10px
+ 660px
+ 690px
+ 60px
+ 211px
+ 30px
+ 30px
+ 15px
+ 270px
+ 660px
+ 600px
+ 599px
+
+ 200px
+ 30px
+ 30px
+ 830px
+ 590px
+ 30px
+ 70px
+
+ 635px
+ 1263px
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-main/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-main/src/main/res/values-xhdpi/dimens.xml
index 3bf4256b72..9f6dd8ba91 100644
--- a/modules/mogo-module-main/src/main/res/values-xhdpi/dimens.xml
+++ b/modules/mogo-module-main/src/main/res/values-xhdpi/dimens.xml
@@ -21,5 +21,8 @@
830px
800px
30px
+ 30px
+ 340px
+ 1313px
\ No newline at end of file
diff --git a/modules/mogo-module-main/src/main/res/values/dimens.xml b/modules/mogo-module-main/src/main/res/values/dimens.xml
index 3f01bfe959..a1a96a40ba 100644
--- a/modules/mogo-module-main/src/main/res/values/dimens.xml
+++ b/modules/mogo-module-main/src/main/res/values/dimens.xml
@@ -21,6 +21,10 @@
15px
460px
444px
+ 350px
16px
+ 16px
+
+ 658px
\ No newline at end of file
diff --git a/modules/mogo-module-map/README.md b/modules/mogo-module-map/README.md
new file mode 100644
index 0000000000..88a8df2b69
--- /dev/null
+++ b/modules/mogo-module-map/README.md
@@ -0,0 +1,8 @@
+# 地图模块
+
+## 地图 Fragment
+
+## 地图状态和小智交互部分
+
+## 语音控制地图
+
diff --git a/modules/mogo-module-map/consumer-rules.pro b/modules/mogo-module-map/consumer-rules.pro
index e69de29bb2..016baa21f6 100644
--- a/modules/mogo-module-map/consumer-rules.pro
+++ b/modules/mogo-module-map/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----ModuleMap-----
+-keep class com.mogo.module.map.NavConstants
\ No newline at end of file
diff --git a/modules/mogo-module-map/proguard-rules.pro b/modules/mogo-module-map/proguard-rules.pro
index f1b424510d..707fa663b8 100644
--- a/modules/mogo-module-map/proguard-rules.pro
+++ b/modules/mogo-module-map/proguard-rules.pro
@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----ModuleMap-----
+-keep class com.mogo.module.map.NavConstants
diff --git a/modules/mogo-module-media/build.gradle b/modules/mogo-module-media/build.gradle
index d734d287e0..0ddfae0634 100644
--- a/modules/mogo-module-media/build.gradle
+++ b/modules/mogo-module-media/build.gradle
@@ -40,7 +40,6 @@ dependencies {
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.rxandroid
- implementation rootProject.ext.dependencies.guideshowprovider
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
diff --git a/modules/mogo-module-media/consumer-rules.pro b/modules/mogo-module-media/consumer-rules.pro
index e69de29bb2..4e16a57537 100644
--- a/modules/mogo-module-media/consumer-rules.pro
+++ b/modules/mogo-module-media/consumer-rules.pro
@@ -0,0 +1,13 @@
+#-----MediaModule-----
+-dontwarn com.mogo.module.media.**
+-keep class com.mogo.module.media.listener.** { *; }
+-keep class com.mogo.module.media.model.** { *; }
+-keep class com.mogo.module.media.view.** { *; }
+-keep class com.mogo.module.media.widget.** { *; }
+-keep class com.mogo.module.media.api.** { *; }
+-keep class com.mogo.module.media.constants.** { *; }
+-keep class com.mogo.module.media.presenter.** { *; }
+-keep class com.mogo.module.media.receiver.** { *; }
+-keep class com.mogo.module.media.utils.OnBitmapToLocalListener
+-keep class com.mogo.module.media.utils.OnCompressListener
+-keep class com.mogo.module.media.MediaConstants
\ No newline at end of file
diff --git a/modules/mogo-module-media/proguard-rules.pro b/modules/mogo-module-media/proguard-rules.pro
index 82dae0c3b9..0d676ccbbf 100644
--- a/modules/mogo-module-media/proguard-rules.pro
+++ b/modules/mogo-module-media/proguard-rules.pro
@@ -19,6 +19,8 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----MediaModule-----
-dontwarn com.mogo.module.media.**
-keep class com.mogo.module.media.listener.** { *; }
-keep class com.mogo.module.media.model.** { *; }
@@ -27,4 +29,7 @@
-keep class com.mogo.module.media.api.** { *; }
-keep class com.mogo.module.media.constants.** { *; }
-keep class com.mogo.module.media.presenter.** { *; }
--keep class com.mogo.module.media.receiver.** { *; }
\ No newline at end of file
+-keep class com.mogo.module.media.receiver.** { *; }
+-keep class com.mogo.module.media.utils.OnBitmapToLocalListener
+-keep class com.mogo.module.media.utils.OnCompressListener
+-keep class com.mogo.module.media.MediaConstants
\ No newline at end of file
diff --git a/modules/mogo-module-media/src/main/java/com/mogo/module/media/MediaCardViewFragment.java b/modules/mogo-module-media/src/main/java/com/mogo/module/media/MediaCardViewFragment.java
index 7708d29202..52651147a6 100644
--- a/modules/mogo-module-media/src/main/java/com/mogo/module/media/MediaCardViewFragment.java
+++ b/modules/mogo-module-media/src/main/java/com/mogo/module/media/MediaCardViewFragment.java
@@ -16,9 +16,6 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.SimpleTarget;
@@ -74,9 +71,6 @@ import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
-
-import org.jetbrains.annotations.NotNull;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -180,7 +174,7 @@ public class MediaCardViewFragment extends MvpFragment() {
@Override
- public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition super Bitmap> transition) {
+ public void onResourceReady( Bitmap resource, Transition super Bitmap> transition) {
new Thread(new Runnable() {
@Override
@@ -752,12 +746,12 @@ public class MediaCardViewFragment extends MvpFragment
+
+ /
+
\ No newline at end of file
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
new file mode 100644
index 0000000000..92158e2f0f
--- /dev/null
+++ b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/MockUtil.kt
@@ -0,0 +1,56 @@
+package com.zhidao.mogo.module.obu
+
+import com.mogo.service.obu.IMogoObuDataChangedListener
+import com.mogo.utils.logger.Logger
+import com.zhidao.smartv2x.listener.OnMessageReceiveListener
+import com.zhidao.smartv2x.model.obu.CarEventInfo
+import com.zhidao.smartv2x.model.obu.CarLocationInfo
+import com.zhidao.smartv2x.model.obu.TrafficLightInfo
+import io.reactivex.Observable
+import io.reactivex.Scheduler
+import io.reactivex.Single
+import io.reactivex.disposables.Disposable
+import io.reactivex.internal.operators.single.SingleSubscribeOn
+import io.reactivex.schedulers.Schedulers
+import java.util.concurrent.TimeUnit
+
+/**
+ * 模拟相关操作及数据的单例类
+ *
+ * @author tongchenfei
+ */
+object MockUtil {
+ const val TAG = "MockUtil"
+ private lateinit var dataCallback : OnMessageReceiveListener
+
+ private lateinit var intervalObs:Disposable
+
+ fun init(callback: OnMessageReceiveListener){
+ Logger.d(TAG, "使用模拟obu数据===")
+ dataCallback = callback
+ intervalMockData()
+ }
+
+ private fun intervalMockData(){
+ intervalObs = Observable.interval(1000,TimeUnit.MILLISECONDS).map {
+ it.toString()
+ }.subscribe {
+ val carLocationInfo = CarLocationInfo()
+ carLocationInfo.carId = "carLocation$it"
+ dataCallback.showCarLocationInfo(carLocationInfo)
+ val other = "other$it"
+ dataCallback.showOtherInfo(other)
+ val eventInfo = CarEventInfo()
+ eventInfo.describe = "event des $it"
+ eventInfo.type = "event type $it"
+ dataCallback.showCarEventInfo(eventInfo)
+ val traffic = TrafficLightInfo()
+ traffic.id = "traffic $it"
+ dataCallback.showTrafficLightInfo(traffic)
+ }
+ }
+
+ fun destroy(){
+ intervalObs.dispose()
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/ObuConstant.java b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/ObuConstant.java
new file mode 100644
index 0000000000..70c82e564f
--- /dev/null
+++ b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/ObuConstant.java
@@ -0,0 +1,33 @@
+package com.zhidao.mogo.module.obu;
+
+/**
+ * obu涉及的常量汇总
+ *
+ * @author tongchenfei
+ */
+public class ObuConstant {
+ /**
+ * 前碰撞预警,暂时不知道是干啥的
+ */
+ public static final int TYPE_FRONT_COLLISION_WARNING = 101;
+
+ /**
+ * 交叉路口碰撞预警
+ */
+ public static final int TYPE_CROSS_COLLISION_WARNING = 102;
+
+ /**
+ * 紧急制动预警
+ */
+ public static final int TYPE_URGENCY_COLLISION_WARNING = 105;
+
+ /**
+ * 绿波车速引导
+ */
+ public static final int TYPE_OPTIMAL_SPEED_ADVISORY = 109;
+
+ /**
+ * 行人碰撞预警
+ */
+ public static final int TYPE_ROAD_USER_COLLISION_WARNING = 115;
+}
diff --git a/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/ObuManager.kt b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/ObuManager.kt
new file mode 100644
index 0000000000..00b18e6948
--- /dev/null
+++ b/modules/mogo-module-obu/src/main/java/com/zhidao/mogo/module/obu/ObuManager.kt
@@ -0,0 +1,128 @@
+package com.zhidao.mogo.module.obu
+
+import android.content.Context
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.commons.debug.DebugConfig
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.MogoServicePaths
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.service.obu.IMogoObuDataChangedListener
+import com.mogo.service.obu.IMogoObuManager
+import com.mogo.utils.logger.Logger
+import com.zhidao.smartv2x.api.V2xController
+import com.zhidao.smartv2x.model.obu.CarEventInfo
+import com.zhidao.smartv2x.model.obu.CarLocationInfo
+import com.zhidao.smartv2x.model.obu.TrafficLightInfo
+
+/**
+ * obu provider
+ *
+ * @author tongchenfei
+ */
+@Route(path = MogoServicePaths.PATH_OBU)
+class ObuManager: IMogoObuManager {
+ companion object{
+ const val TAG = "ObuManger"
+ }
+ private var dataChangedListener: IMogoObuDataChangedListener? = null
+
+ private var handler = Handler(Looper.getMainLooper())
+
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun init(context: Context) {
+ Logger.d(TAG,"init=======")
+ if (DebugConfig.isUseMockObuData()) {
+ MockUtil.init(this)
+ } else {
+ // 初始化sdk,注册数据回调等信息
+ V2xController.getInstance().setMessageReceiveListener(this@ObuManager)
+ }
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String {
+ return ""
+ }
+
+ override fun createView(context: Context?): View? {
+ return null
+ }
+
+ override fun createFragment(context: Context?, data: Bundle?): Fragment? {
+ return null
+ }
+
+ override fun getModuleName(): String {
+ return "moduleObu"
+ }
+
+ override fun getAppName(): String {
+ return ""
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+
+ override fun registerObuDataChangedListener(listener: IMogoObuDataChangedListener?) {
+ this.dataChangedListener = listener
+ }
+
+ /**
+ * 车辆位置信息回调接口
+ */
+ override fun showCarLocationInfo(info: CarLocationInfo?) {
+ Logger.d(TAG, "thread: ${Thread.currentThread()} showCarLocationInfo: ${info?.carId}")
+ dataChangedListener?.showCarLocationInfo(info)
+ }
+
+ /**
+ * UDP 收发消息回调接口
+ */
+ override fun showOtherInfo(info: String?) {
+ Logger.d(TAG, "thread: ${Thread.currentThread()} showOtherInfo: $info")
+ dataChangedListener?.showOtherInfo(info)
+ }
+
+ /**
+ * 交通信号灯信息回调接口
+ */
+ override fun showTrafficLightInfo(info: TrafficLightInfo?) {
+ Logger.d(TAG, "thread: ${Thread.currentThread()} showTrafficLightInfo: ${info?.id}")
+ dataChangedListener?.showTrafficLightInfo(info)
+ }
+
+ /**
+ * 场景触发事件信息回调接口
+ */
+ override fun showCarEventInfo(info: CarEventInfo?) {
+ Logger.d(TAG, "thread: ${Thread.currentThread()} showCarEventInfo: ${info?.type}")
+ dataChangedListener?.showCarEventInfo(info)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-authorize/src/test/java/com/mogo/module/authorize/ExampleUnitTest.kt b/modules/mogo-module-obu/src/test/java/com/zhidao/mogo/module/obu/ExampleUnitTest.kt
similarity index 89%
rename from modules/mogo-module-authorize/src/test/java/com/mogo/module/authorize/ExampleUnitTest.kt
rename to modules/mogo-module-obu/src/test/java/com/zhidao/mogo/module/obu/ExampleUnitTest.kt
index f2b7332da6..1b5dbe6f16 100644
--- a/modules/mogo-module-authorize/src/test/java/com/mogo/module/authorize/ExampleUnitTest.kt
+++ b/modules/mogo-module-obu/src/test/java/com/zhidao/mogo/module/obu/ExampleUnitTest.kt
@@ -1,4 +1,4 @@
-package com.mogo.module.authorize
+package com.zhidao.mogo.module.obu
import org.junit.Test
@@ -14,4 +14,4 @@ class ExampleUnitTest {
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
-}
+}
\ No newline at end of file
diff --git a/modules/mogo-module-search/README.md b/modules/mogo-module-search/README.md
new file mode 100644
index 0000000000..62b09483b3
--- /dev/null
+++ b/modules/mogo-module-search/README.md
@@ -0,0 +1,16 @@
+# 地图导航搜索模块
+
+## poi 搜索
+
+## 导航设置
+
+## 路径规划
+
+## 家和公司设置
+
+## 地图选点
+
+## 存储家和公司地址
+
+## 分类搜索
+
diff --git a/modules/mogo-module-search/build.gradle b/modules/mogo-module-search/build.gradle
index e2733a4fa9..53027f6e57 100644
--- a/modules/mogo-module-search/build.gradle
+++ b/modules/mogo-module-search/build.gradle
@@ -49,7 +49,6 @@ dependencies {
implementation rootProject.ext.dependencies.androidxcardview
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.rxandroid
- implementation rootProject.ext.dependencies.guideshowprovider
if (Boolean.valueOf(RELEASE)) {
diff --git a/modules/mogo-module-search/consumer-rules.pro b/modules/mogo-module-search/consumer-rules.pro
index e69de29bb2..830135631c 100644
--- a/modules/mogo-module-search/consumer-rules.pro
+++ b/modules/mogo-module-search/consumer-rules.pro
@@ -0,0 +1,8 @@
+#-----SearchModule-----
+-keep class com.mogo.module.navi.bean.**{*;}
+-keep class com.mogo.module.navi.constants.**{*;}
+-keep class com.mogo.module.navi.dao.**{*;}
+-keep class com.mogo.module.navi.database.**{*;}
+-keep class * extends com.mogo.module.navi.cp.PersonalInfoManager{
+ public static final ;
+}
diff --git a/modules/mogo-module-search/proguard-rules.pro b/modules/mogo-module-search/proguard-rules.pro
index f1b424510d..7b0b77e021 100644
--- a/modules/mogo-module-search/proguard-rules.pro
+++ b/modules/mogo-module-search/proguard-rules.pro
@@ -19,3 +19,12 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----SearchModule-----
+-keep class com.mogo.module.navi.bean.**{*;}
+-keep class com.mogo.module.navi.constants.**{*;}
+-keep class com.mogo.module.navi.dao.**{*;}
+-keep class com.mogo.module.navi.database.**{*;}
+-keep class * extends com.mogo.module.navi.cp.PersonalInfoManager{
+ public static final ;
+}
\ No newline at end of file
diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java
index 378ecf5802..1062a25fe7 100644
--- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java
+++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchApisHolder.java
@@ -7,7 +7,6 @@ import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.navi.IMogoNavi;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.gps.simulator.IMogoGpsSimulatorManager;
-import com.mogo.module.guideshow.provider.IGuideShowProvider;
import com.mogo.module.navi.cp.PersonalInfoManagerImpl;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.analytics.IMogoAnalytics;
@@ -31,7 +30,6 @@ public class SearchApisHolder {
private static final String TAG = "SearchApisHolder";
private static IMogoServiceApis sApis;
- private static IGuideShowProvider sGuideShowApis;
private static IMogoGpsSimulatorManager sGpsSimulatorManager;
private static PersonalInfoManagerImpl mPersonalInfoManager;
@@ -40,7 +38,6 @@ public class SearchApisHolder {
Logger.d( TAG, "static block init." );
sApis = ARouter.getInstance().navigation( IMogoServiceApis.class );
sGpsSimulatorManager = ARouter.getInstance().navigation( IMogoGpsSimulatorManager.class );
- sGuideShowApis = ARouter.getInstance().navigation( IGuideShowProvider.class );
}
public static IMogoServiceApis getApis() {
@@ -90,13 +87,6 @@ public class SearchApisHolder {
return getApis().getIntentManagerApi();
}
- public static IGuideShowProvider getGuideShowApis() {
- if ( sGuideShowApis == null ) {
- sGuideShowApis = ARouter.getInstance().navigation( IGuideShowProvider.class );
- }
- return sGuideShowApis;
- }
-
public static IMogoSettingManager getSettingManager() {
return getApis().getSettingManagerApi();
}
diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt
index c3d8767760..2986dbbf45 100644
--- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt
+++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt
@@ -223,9 +223,6 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
SearchApisHolder.getNaviApis().startNavi(!SettingManager.isMonitor())
SearchApisHolder.getUiControllerApis().recoverLockMode()
- if (SearchApisHolder.getGuideShowApis().isPlayingVideo()) {
- SearchApisHolder.getGuideShowApis().closeGuideShowView()
- }
isStartedNavi = true
SearchApisHolder.getFragmentManager().clearAll()
}
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_back.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_back.png
new file mode 100644
index 0000000000..3022cf674d
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_back.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_choose_position2.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_choose_position2.png
new file mode 100644
index 0000000000..75b012a9d8
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_choose_position2.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_company.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_company.png
new file mode 100644
index 0000000000..cfd2ab1ef9
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_company.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_gas.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_gas.png
new file mode 100644
index 0000000000..bc7e2b1feb
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_gas.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_go_company.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_go_company.png
new file mode 100644
index 0000000000..cfd2ab1ef9
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_go_company.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_go_home.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_go_home.png
new file mode 100644
index 0000000000..29cfa1cb6c
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_go_home.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_home.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_home.png
new file mode 100644
index 0000000000..aefaf26017
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_home.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_park.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_park.png
new file mode 100644
index 0000000000..45dfd3469a
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_park.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_position.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_position.png
new file mode 100644
index 0000000000..029ae98fb2
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_position.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_restrant.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_restrant.png
new file mode 100644
index 0000000000..b07f873877
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_restrant.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_setting.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_setting.png
new file mode 100644
index 0000000000..a5b6ea462a
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_setting.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_sound_low.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_sound_low.png
new file mode 100644
index 0000000000..190173c4da
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_sound_low.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_sound_plus.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_sound_plus.png
new file mode 100644
index 0000000000..69058045d4
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_sound_plus.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_tolit.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_tolit.png
new file mode 100644
index 0000000000..2a7886378a
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_tolit.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_wash.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_wash.png
new file mode 100644
index 0000000000..8721291992
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_navi_wash.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_path_fail.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_path_fail.png
new file mode 100644
index 0000000000..60478cfe62
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_path_fail.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_pb_thumb.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_pb_thumb.png
new file mode 100644
index 0000000000..46980ae3cb
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_pb_thumb.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_search_category_checked.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_search_category_checked.png
new file mode 100644
index 0000000000..2a42bb49e5
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_search_category_checked.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_search_category_unchecked.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_search_category_unchecked.png
new file mode 100644
index 0000000000..682c81390f
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_search_category_unchecked.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_sound_high.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_sound_high.png
new file mode 100644
index 0000000000..b777032791
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_sound_high.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_sound_low.png b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_sound_low.png
new file mode 100644
index 0000000000..aed0b10afd
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-ldpi/icon_sound_low.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_back.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_back.png
new file mode 100644
index 0000000000..3022cf674d
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_back.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_choose_position2.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_choose_position2.png
new file mode 100644
index 0000000000..75b012a9d8
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_choose_position2.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_company.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_company.png
new file mode 100644
index 0000000000..cfd2ab1ef9
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_company.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_gas.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_gas.png
new file mode 100644
index 0000000000..bc7e2b1feb
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_gas.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_go_company.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_go_company.png
new file mode 100644
index 0000000000..cfd2ab1ef9
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_go_company.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_go_home.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_go_home.png
new file mode 100644
index 0000000000..29cfa1cb6c
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_go_home.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_home.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_home.png
new file mode 100644
index 0000000000..aefaf26017
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_home.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_park.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_park.png
new file mode 100644
index 0000000000..45dfd3469a
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_park.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_position.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_position.png
new file mode 100644
index 0000000000..029ae98fb2
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_position.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_restrant.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_restrant.png
new file mode 100644
index 0000000000..b07f873877
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_restrant.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_setting.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_setting.png
new file mode 100644
index 0000000000..a5b6ea462a
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_setting.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_sound_low.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_sound_low.png
new file mode 100644
index 0000000000..190173c4da
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_sound_low.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_sound_plus.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_sound_plus.png
new file mode 100644
index 0000000000..69058045d4
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_sound_plus.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_tolit.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_tolit.png
new file mode 100644
index 0000000000..2a7886378a
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_tolit.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_wash.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_wash.png
new file mode 100644
index 0000000000..8721291992
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_navi_wash.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_path_fail.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_path_fail.png
new file mode 100644
index 0000000000..60478cfe62
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_path_fail.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_pb_thumb.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_pb_thumb.png
new file mode 100644
index 0000000000..46980ae3cb
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_pb_thumb.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_search_category_checked.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_search_category_checked.png
new file mode 100644
index 0000000000..2a42bb49e5
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_search_category_checked.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_search_category_unchecked.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_search_category_unchecked.png
new file mode 100644
index 0000000000..682c81390f
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_search_category_unchecked.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_sound_high.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_sound_high.png
new file mode 100644
index 0000000000..b777032791
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_sound_high.png differ
diff --git a/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_sound_low.png b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_sound_low.png
new file mode 100644
index 0000000000..aed0b10afd
Binary files /dev/null and b/modules/mogo-module-search/src/main/res/mipmap-mdpi/icon_sound_low.png differ
diff --git a/modules/mogo-module-search/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-search/src/main/res/values-xhdpi/dimens.xml
index 6de848b620..7405ab41e0 100644
--- a/modules/mogo-module-search/src/main/res/values-xhdpi/dimens.xml
+++ b/modules/mogo-module-search/src/main/res/values-xhdpi/dimens.xml
@@ -1,13 +1,16 @@
-
- @dimen/dp_60
- @dimen/dp_40
- 600dp
- @dimen/dp_120
- @dimen/dp_80
- @dimen/dp_24
- @dimen/dp_20
+
+ @dimen/sp_32
+ @dimen/sp_40
+ 25sp
+ @dimen/dp_60
+ @dimen/dp_40
+ 600dp
+ @dimen/dp_120
+ @dimen/dp_80
+ @dimen/dp_24
+ @dimen/dp_20
@dimen/dp_50
40px
266px
@@ -39,9 +42,9 @@
120px
45px
838px
- 142px
+ 184px
104px
- 154px
+ 154px
32px
212px
26px
diff --git a/modules/mogo-module-search/src/main/res/values/dimens.xml b/modules/mogo-module-search/src/main/res/values/dimens.xml
index be69e1ecf7..a06368577c 100644
--- a/modules/mogo-module-search/src/main/res/values/dimens.xml
+++ b/modules/mogo-module-search/src/main/res/values/dimens.xml
@@ -63,5 +63,4 @@
32px
40px
-
\ No newline at end of file
diff --git a/modules/mogo-module-service/README.md b/modules/mogo-module-service/README.md
new file mode 100644
index 0000000000..3f15b8ae07
--- /dev/null
+++ b/modules/mogo-module-service/README.md
@@ -0,0 +1,10 @@
+# 刷新策略 + 地图事件点刷新
+
+## 刷新策略:自动刷新、手动刷新、刷新接口
+
+## 大而全数据:道路事件
+
+## 在线车辆数据
+
+## 大部分广播的接口:小智语音广播、acc 状态
+
diff --git a/modules/mogo-module-service/build.gradle b/modules/mogo-module-service/build.gradle
index 56451b4364..01bf8f3eaa 100644
--- a/modules/mogo-module-service/build.gradle
+++ b/modules/mogo-module-service/build.gradle
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
+apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
android {
diff --git a/modules/mogo-module-service/consumer-rules.pro b/modules/mogo-module-service/consumer-rules.pro
index e69de29bb2..06d4b04e1d 100644
--- a/modules/mogo-module-service/consumer-rules.pro
+++ b/modules/mogo-module-service/consumer-rules.pro
@@ -0,0 +1,13 @@
+#-----ServiceModule-----
+-keep class com.mogo.module.service.carinfo.CarStateInfo.*{*;}
+-keep class com.mogo.module.service.network.RefreshBody.*{*;}
+-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
+-keep interface com.mogo.module.service.intent.IntentHandler
+-keep interface com.mogo.module.service.marker.IMarkerView
+-keep interface com.mogo.module.service.network.RefreshApiService
+-keep interface com.mogo.module.service.network.RefreshCallback
+-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity
+-keep class com.mogo.module.service.strategy.CarIconDisplayStrategy{
+ public static final ;
+ }
+ -keep class com.mogo.module.service.ServiceConst
\ No newline at end of file
diff --git a/modules/mogo-module-service/proguard-rules.pro b/modules/mogo-module-service/proguard-rules.pro
index f1b424510d..02a339ca47 100644
--- a/modules/mogo-module-service/proguard-rules.pro
+++ b/modules/mogo-module-service/proguard-rules.pro
@@ -19,3 +19,17 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----ServiceModule-----
+-keep class com.mogo.module.service.carinfo.CarStateInfo.*{*;}
+-keep class com.mogo.module.service.network.RefreshBody.*{*;}
+-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
+-keep interface com.mogo.module.service.intent.IntentHandler
+-keep interface com.mogo.module.service.marker.IMarkerView
+-keep interface com.mogo.module.service.network.RefreshApiService
+-keep interface com.mogo.module.service.network.RefreshCallback
+-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity
+-keep class com.mogo.module.service.strategy.CarIconDisplayStrategy{
+ public static final ;
+}
+-keep class com.mogo.module.service.ServiceConst
\ No newline at end of file
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java
index cb7fa6a938..caaf67dd12 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java
@@ -63,8 +63,6 @@ public class MarkerServiceHandler {
private static ICarsChattingProvider sCarChatting;
private static IMogoGpsSimulatorManager sGpsSimulatorManager;
- private static MapMarkerManager sMapMarkerManager;
-
public static synchronized void init( final Context context ) {
if ( sGpsSimulatorManager != null ) {
@@ -92,8 +90,7 @@ public class MarkerServiceHandler {
sCarChatting = ( ICarsChattingProvider ) ARouter.getInstance().build( CallChattingProviderConstant.CAR_CALL_PROVIDER ).navigation( context );
- sMapMarkerManager = MapMarkerManager.getInstance();
- sMapMarkerManager.init( context );
+ MapMarkerManager.getInstance().init( context );
sGpsSimulatorManager = ARouter.getInstance().navigation( IMogoGpsSimulatorManager.class );
}
@@ -143,7 +140,7 @@ public class MarkerServiceHandler {
}
public static MapMarkerManager getMapMarkerManager() {
- return sMapMarkerManager;
+ return MapMarkerManager.getInstance();
}
public static IMogoRegisterCenter getRegisterCenter() {
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 7c5a077101..a019a6189e 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
@@ -741,6 +741,7 @@ public class MogoServices implements IMogoMapListener,
mIsFirstAccOn = false;
return;
}
+ initLocationServiceProcess( mContext );
mADASController.showADAS();
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).start();
MarkerServiceHandler.getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers();
@@ -787,6 +788,14 @@ public class MogoServices implements IMogoMapListener,
restartAutoRefreshAtTime( time, true );
}
+ public void clearAllData(){
+ try {
+ MarkerServiceHandler.getMapService().getMarkerManager( mContext ).removeMarkers();
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
private void restartAutoRefreshAtTime( long time, boolean stopOnlineCarRefresh ) {
if ( time < 0 ) {
Logger.w( TAG, "ignore refresh request case time < 0" );
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java
index dc31c16fb9..54cc5110db 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java
@@ -15,6 +15,9 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
+import com.mogo.map.navi.IMogoNaviListener;
+import com.mogo.map.navi.MogoNaviInfo;
+import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.search.geo.IMogoGeoSearch;
import com.mogo.map.search.geo.IMogoGeoSearchListener;
import com.mogo.map.search.geo.MogoGeocodeResult;
@@ -154,6 +157,49 @@ public class MockIntentHandler implements IntentHandler {
case 13: {
double lat = intent.getFloatExtra( "lat", 0.0f );
double lon = intent.getFloatExtra( "lon", 0.0f );
+ boolean real = intent.getBooleanExtra( "real", false );
+ MarkerServiceHandler.getRegisterCenter().registerMogoNaviListener( TAG, new IMogoNaviListener() {
+ @Override
+ public void onInitNaviFailure() {
+
+ }
+
+ @Override
+ public void onInitNaviSuccess() {
+
+ }
+
+ @Override
+ public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
+
+ }
+
+ @Override
+ public void onStartNavi() {
+
+ }
+
+ @Override
+ public void onStopNavi() {
+
+ }
+
+ @Override
+ public void onCalculateSuccess() {
+ MarkerServiceHandler.getRegisterCenter().unregisterMogoNaviListener( TAG );
+ MarkerServiceHandler.getNavi().startNavi( real );
+ }
+
+ @Override
+ public void onoCalculateFailed() {
+
+ }
+
+ @Override
+ public void onUpdateTraffic( MogoTraffic traffic ) {
+
+ }
+ } );
MarkerServiceHandler.getNavi().naviTo( new MogoLatLng( lat, lon ) );
}
case 14: {
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
index e3af1aa825..062a24a173 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
@@ -3,6 +3,8 @@ package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.Rect;
import android.text.TextUtils;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.LinearInterpolator;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
@@ -11,6 +13,7 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
+import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.entity.MarkerCarPois;
import com.mogo.module.common.entity.MarkerCardResult;
@@ -34,6 +37,7 @@ import com.mogo.service.module.IMogoBizActionDoneListener;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.UiThreadHandler;
+import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import org.json.JSONArray;
@@ -373,15 +377,42 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
IMogoMarker mogoMarker = existCarMap.get( sn );
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
Logger.d( TAG, "draw road condition, sn = %s", sn );
- mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
- }
- if ( mogoMarker != null ) {
- mogoMarker.setVisible( true );
+ try {
+ post2AddAndStartAnimation( markerShowEntity, i * 100L );
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ }
}
}
}
}
+ private void post2AddAndStartAnimation( MarkerShowEntity entity, long delay ) {
+ if ( entity == null ) {
+ return;
+ }
+ WorkThreadHandler.getInstance().postDelayed( () -> {
+ if ( entity == null ) {
+ return;
+ }
+ IMogoMarker marker = drawMapMarker( entity, ServiceConst.MARKER_Z_INDEX_HIGH );
+ marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f,300, new LinearInterpolator(), new OnMarkerAnimationListener() {
+ @Override
+ public void onAnimStart() {
+ Logger.d( TAG, " onAnimStart ---1----> " );
+ }
+
+ @Override
+ public void onAnimEnd() {
+ if ( marker.isDestroyed() ) {
+ return;
+ }
+ marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
+ }
+ } );
+ }, delay );
+ }
+
/**
* S = (A ∩ B) ∪ B
* (A ∩ B)作为旧列表需要保留的部分
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java
index ae5fc33693..b038ac044e 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java
@@ -54,6 +54,7 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
private View mInfoWindowView = null;
+ private View mContentContainer;
private MogoImageView mUserHeader;
private TextView mContent;
private TextView mTag;
@@ -92,12 +93,23 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
if ( mInfoWindowView == null ) {
mInfoWindowView = LayoutInflater.from( mContext ).inflate( R.layout.view_map_data_user_info_window, null );
+ mContentContainer = mInfoWindowView.findViewById( R.id.module_service_id_marker_content );
mUserHeader = mInfoWindowView.findViewById( R.id.module_service_id_user_header );
mContent = mInfoWindowView.findViewById( R.id.module_service_id_content );
mTag = mInfoWindowView.findViewById( R.id.module_service_id_tag );
mCall = mInfoWindowView.findViewById( R.id.module_service_id_call );
}
+ if ( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ) {
+ mContentContainer.setPadding(
+ mContentContainer.getPaddingLeft(),
+ mContentContainer.getPaddingTop(),
+ mContentContainer.getResources().getDimensionPixelSize( R.dimen.module_service_id_marker_content_paddingRight_widthoutCall ),
+ mContentContainer.getPaddingBottom()
+ );
+ mCall.setVisibility( View.GONE );
+ }
+
try {
MarkerShowEntity markerShowEntity = ( MarkerShowEntity ) marker.getObject();
mContent.setText( markerShowEntity.getTextContent() );
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/strategy/MogoRefreshStrategyController.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/strategy/MogoRefreshStrategyController.java
index 51aaf27073..9d09334d74 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/strategy/MogoRefreshStrategyController.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/strategy/MogoRefreshStrategyController.java
@@ -21,6 +21,11 @@ public class MogoRefreshStrategyController implements IMogoRefreshStrategyContro
MogoServices.getInstance().restartAutoRefreshAtTime( delay );
}
+ @Override
+ public void clearAllData() {
+ MogoServices.getInstance().clearAllData();
+ }
+
@Override
public void init( Context context ) {
diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living.png
index f66b3e8176..48d2485529 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living.png and b/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living_light.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living_light.png
index b52aab6bad..0feeb0f206 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living_light.png and b/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_living_light.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/map_api_ic_current_location2_cursor.png b/modules/mogo-module-service/src/main/res/drawable-ldpi/map_api_ic_current_location2_cursor.png
index 374a153333..55dbd72260 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-ldpi/map_api_ic_current_location2_cursor.png and b/modules/mogo-module-service/src/main/res/drawable-ldpi/map_api_ic_current_location2_cursor.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living.png b/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living.png
index f66b3e8176..48d2485529 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living.png and b/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living_light.png b/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living_light.png
index b52aab6bad..0feeb0f206 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living_light.png and b/modules/mogo-module-service/src/main/res/drawable-mdpi/icon_map_marker_living_light.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-mdpi/map_api_ic_current_location2_cursor.png b/modules/mogo-module-service/src/main/res/drawable-mdpi/map_api_ic_current_location2_cursor.png
index 374a153333..55dbd72260 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-mdpi/map_api_ic_current_location2_cursor.png and b/modules/mogo-module-service/src/main/res/drawable-mdpi/map_api_ic_current_location2_cursor.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2_cursor.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2_cursor.png
new file mode 100644
index 0000000000..c24c56f3db
Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2_cursor.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living.png
old mode 100755
new mode 100644
index 3780ecf9b9..d6f1dea192
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living_light.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living_light.png
old mode 100755
new mode 100644
index ae94e4bc3d..1b87f0ce86
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living_light.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_living_light.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/map_api_ic_current_location2_cursor.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/map_api_ic_current_location2_cursor.png
index a293f02f62..c24c56f3db 100644
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/map_api_ic_current_location2_cursor.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/map_api_ic_current_location2_cursor.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park.png
new file mode 100644
index 0000000000..5923d114f6
Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park_light.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park_light.png
new file mode 100644
index 0000000000..dbc420e8e6
Binary files /dev/null and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park_light.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00000.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00000.png
index 91ef580142..017b3297db 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00000.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00000.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00001.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00001.png
index 035c1dc64e..92f1c0228a 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00001.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00001.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00002.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00002.png
index be7329b427..cd3ff2b7c8 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00002.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00002.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00003.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00003.png
index 477ae463a1..0446ad4c96 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00003.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00003.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00004.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00004.png
index 1e9174360a..d42ca11d7c 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00004.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00004.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00005.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00005.png
index 1f5662e952..20db6ea07f 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00005.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00005.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00006.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00006.png
index 99f9c399c7..25bf15e8c0 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00006.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00006.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00007.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00007.png
index 51c2854387..813de01ab2 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00007.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00007.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00008.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00008.png
index e85fbc19bf..90ccdfe6c9 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00008.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00008.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00009.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00009.png
index f2843ce176..c6cc07c4c8 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00009.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00009.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00010.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00010.png
index 2d03318e75..af37d1f103 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00010.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00010.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00011.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00011.png
index ad788d3c68..7b69007808 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00011.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00011.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00012.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00012.png
index dc52364e7b..b828efb708 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00012.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00012.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00013.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00013.png
index b8ea0b316c..3c23dad3c7 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00013.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00013.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00014.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00014.png
index 8abb4ccf51..baa2f9177e 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00014.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00014.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00015.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00015.png
index 41549be007..aeffab3eeb 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00015.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00015.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00016.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00016.png
index 9fb488f78a..51a040b88f 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00016.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00016.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00017.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00017.png
index de08a87e4c..88232212da 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00017.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00017.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00018.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00018.png
index 8a257850cc..2fd401e032 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00018.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00018.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00019.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00019.png
index 938c6485e0..f76ad9ebcf 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00019.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00019.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00020.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00020.png
index 41bf443f4d..4863dc1a5d 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00020.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00020.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00021.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00021.png
index f3f8aa9264..00e9024e99 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00021.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00021.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00022.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00022.png
index 5a12355914..e49e48fa2d 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00022.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00022.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00023.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00023.png
index c189afaf82..5d64c5ce73 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00023.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00023.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00024.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00024.png
index a5e9a3a255..9442cc9744 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00024.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00024.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00025.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00025.png
index 030107cd78..4d291893bf 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00025.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00025.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00026.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00026.png
index 6267571bff..150d2795fc 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00026.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00026.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00027.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00027.png
index abec499d36..7e60f9b34c 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00027.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00027.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00028.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00028.png
index eba6b2bcbf..1437625870 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00028.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00028.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00029.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00029.png
index a67c5f9cec..099dd65337 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00029.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00029.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00030.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00030.png
index 3f33fb9c3a..177ae70578 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00030.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00030.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00031.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00031.png
index 0f3fd7a901..c8815c2488 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00031.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00031.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00032.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00032.png
index 5a9fd6fbd0..69ab4dbf0a 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00032.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00032.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00033.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00033.png
index 3ded233972..190cf679b7 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00033.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00033.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00034.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00034.png
index 3cdb8c6e34..c5fe07c7ca 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00034.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00034.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00035.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00035.png
index 182a4ba602..c9ad6e150b 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00035.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00035.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00036.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00036.png
index ea15361039..856037bf2c 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00036.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00036.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00037.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00037.png
index a8d2759378..144f6fcf1d 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00037.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00037.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00038.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00038.png
index 162dc6d8cc..553bb4e137 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00038.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00038.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00039.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00039.png
index cd55a2012c..57ea2f7cde 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00039.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00039.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00040.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00040.png
index fb2bf1d674..86206d492f 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00040.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00040.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00041.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00041.png
index b9c1d75d70..7e7b5414c7 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00041.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00041.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00042.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00042.png
index 592a4fa684..b5b0ce4638 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00042.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00042.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00043.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00043.png
index 2bf047529a..f350ee34a6 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00043.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00043.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00044.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00044.png
index 1e6b1c62ca..5a4019f576 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00044.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00044.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00045.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00045.png
index 0ef8052522..06783df892 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00045.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00045.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00046.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00046.png
index ddf515a0cc..ce46e3ae92 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00046.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00046.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00047.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00047.png
index 32804bc40f..9373c1e5ed 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00047.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00047.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00048.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00048.png
index e79bb3147b..f7e985acd7 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00048.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00048.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00049.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00049.png
index 5d2e4c32a7..de65b123d7 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00049.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00049.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00050.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00050.png
index b710ad29b0..62e9d890ce 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00050.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00050.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00051.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00051.png
index a3e2f3e5bc..885cd4c015 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00051.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00051.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00052.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00052.png
index c5fd7137d8..a0fc70cae5 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00052.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00052.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00053.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00053.png
index 975e1d8fca..61b7bbfa3f 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00053.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00053.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00054.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00054.png
index f9e8bf57cc..43b58ef2ae 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00054.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00054.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00055.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00055.png
index 3bc6fd7222..00eeb36c32 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00055.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00055.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00056.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00056.png
index d4e83d833b..72953f0741 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00056.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00056.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00057.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00057.png
index 28d16d7b2f..e2ef19c99c 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00057.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00057.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00058.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00058.png
index fabcdee32f..f570b4ae11 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00058.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00058.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00059.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00059.png
index 6bd5034043..f12302e033 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00059.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00059.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00060.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00060.png
index ce803618bc..c56ebedee5 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00060.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00060.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00061.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00061.png
index 973c84895e..d78d849c4b 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00061.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00061.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00062.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00062.png
index 9f2edaa2d8..640766bf68 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00062.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00062.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00063.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00063.png
index dfe6bb88bf..e015ecadf3 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00063.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00063.png differ
diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00064.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00064.png
index c4eeda5a13..eed71ae8ea 100755
Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00064.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_service_ic_seek_helping_00064.png differ
diff --git a/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml b/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml
index 0967298a46..fe110eba36 100644
--- a/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml
+++ b/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml
@@ -13,6 +13,7 @@
android:id="@+id/module_service_id_marker_content"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_services_info_window_height"
+ android:paddingRight="@dimen/module_service_id_marker_content_paddingRight"
android:background="@drawable/module_services_driver_blue_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -44,7 +45,7 @@
app:layout_constraintStart_toEndOf="@+id/module_service_id_user_header"
app:layout_constraintTop_toTopOf="@+id/module_service_id_user_header"
app:layout_goneMarginRight="@dimen/dp_30"
- tools:text="诗" />
+ tools:text="诗一样的远方的远方" />
20dp
- 8dp
+ 4dp
100px
117px
60px
@@ -21,4 +21,5 @@
24px
20px
120px
+ 20px
\ No newline at end of file
diff --git a/modules/mogo-module-service/src/main/res/values/dimens.xml b/modules/mogo-module-service/src/main/res/values/dimens.xml
index 6faf47f1e0..fd1066746d 100644
--- a/modules/mogo-module-service/src/main/res/values/dimens.xml
+++ b/modules/mogo-module-service/src/main/res/values/dimens.xml
@@ -1,7 +1,7 @@
16dp
- 4dp
+ 2dp
56px
65px
35px
@@ -20,4 +20,6 @@
14px
12px
64px
+ 6.5px
+ 10px
\ No newline at end of file
diff --git a/modules/mogo-module-share/consumer-rules.pro b/modules/mogo-module-share/consumer-rules.pro
index e69de29bb2..3cae82b2c2 100644
--- a/modules/mogo-module-share/consumer-rules.pro
+++ b/modules/mogo-module-share/consumer-rules.pro
@@ -0,0 +1,5 @@
+#-----ShareModule-----
+-keep class com.mogo.module.share.bean.**{*;}
+-keep class com.mogo.module.share.constant.**{*;}
+-keep class com.mogo.module.share.manager.ISeekHelpListener
+-keep class com.mogo.module.share.net.ShareApiService
diff --git a/modules/mogo-module-share/proguard-rules.pro b/modules/mogo-module-share/proguard-rules.pro
index f1b424510d..b436d973dd 100644
--- a/modules/mogo-module-share/proguard-rules.pro
+++ b/modules/mogo-module-share/proguard-rules.pro
@@ -19,3 +19,9 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+#-----ShareModule-----
+-keep class com.mogo.module.share.bean.**{*;}
+-keep class com.mogo.module.share.constant.**{*;}
+-keep class com.mogo.module.share.manager.ISeekHelpListener
+-keep class com.mogo.module.share.net.ShareApiService
\ No newline at end of file
diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java
index 813a7e9252..84cb300af5 100644
--- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java
@@ -1,6 +1,7 @@
package com.mogo.module.share;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
@@ -10,20 +11,19 @@ import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.commons.analytics.AnalyticsUtils;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.marker.IMogoMarkerClickListener;
-import com.mogo.map.marker.MogoMarkersHandler;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant;
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener;
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
import com.mogo.module.share.bean.StepAfterAuth;
-import com.mogo.module.share.bean.StepAfterAuthKt;
import com.mogo.module.share.constant.ShareConstants;
import com.mogo.module.share.dialog.LaucherShareDialog;
import com.mogo.module.share.manager.ServiceApisManager;
@@ -41,7 +41,6 @@ import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
-import com.mogo.commons.analytics.AnalyticsUtils;
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_SEEK_HELP;
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_SHOW_DIALOG;
@@ -113,13 +112,26 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
@Override
public void dismissShareDialog() {
if (mShareDialog != null) {
+ Logger.d(TAG,"dismissShareDialog");
mShareDialog.dismiss();
}
}
+ @Override
+ public void resetContext(Context context) {
+ mContext = context;
+ }
+
private void realShowDialog() {
if (mShareDialog == null) {
+ Logger.d(TAG,"realShowDialog context : " + mContext);
mShareDialog = new LaucherShareDialog(mContext);
+ mShareDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ mShareDialog = null;
+ }
+ });
}
mShareDialog.show();
}
@@ -198,6 +210,28 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
UPLOAD_ROAD_CONSTRUCTION, this);
}
+// ServiceApisManager.serviceApis.getRegisterCenterApi().registerObuDataListener("share", new IMogoObuDataChangedListener() {
+// @Override
+// public void showCarLocationInfo(CarLocationInfo info) {
+// Logger.d(TAG, "获取到car location info: " + info.carId);
+// }
+//
+// @Override
+// public void showOtherInfo(String info) {
+// Logger.d(TAG, "获取到other info: " + info);
+// }
+//
+// @Override
+// public void showTrafficLightInfo(TrafficLightInfo info) {
+// Logger.d(TAG, "获取到traffic light info: " + info.id);
+// }
+//
+// @Override
+// public void showCarEventInfo(CarEventInfo info) {
+// Logger.d(TAG, "获取到car event info: " + info.describe);
+// }
+// });
+
Logger.d(TAG,"init over====");
}
diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java
index 0a2e936abb..06a161a806 100644
--- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java
@@ -64,6 +64,8 @@ public class LaucherShareDialog extends BaseFloatDialog implements View.OnClickL
public LaucherShareDialog(Context context) {
super(context);
+// getWindow().setWindowAnimations(R.style.ShareDialogAnim);
+
this.mContext = context;
mApis = (IMogoServiceApis) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(context);
mAnalytics = mApis.getAnalyticsApi();
diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt
index 9a9c1d949f..83282b97f4 100644
--- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt
@@ -5,6 +5,7 @@ import android.content.Context
import android.os.SystemClock
import com.mogo.commons.data.BaseData
import com.mogo.commons.network.SubscribeImpl
+import com.mogo.commons.network.Utils
import com.mogo.commons.voice.AIAssist
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.module.share.bean.SeekRecord
@@ -16,7 +17,6 @@ import com.mogo.utils.TipToast
import com.mogo.utils.logger.Logger
import com.mogo.utils.network.RequestOptions
import com.mogo.utils.storage.SharedPrefsMgr
-import com.zhidao.auto.platform.util.DeviceUtil
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
@@ -152,7 +152,7 @@ object SeekHelpManager {
private fun realSeekHelp() {
Logger.d(TAG, "realSeekHelp")
// 请求故障求助接口
- val seekRequest = SeekRequest(DeviceUtil.getSn())
+ val seekRequest = SeekRequest(Utils.getSn())
val param = mutableMapOf("data" to seekRequest.getJson())
ServiceApisManager.serviceApis.networkApi.create(ShareApiService::class.java, HttpConstant.getNetHost()).sendHelpSignal(param).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(object : SubscribeImpl(RequestOptions.create(context)) {
@@ -209,7 +209,7 @@ object SeekHelpManager {
}
fun debugCancelSeek() {
- val seekRequest = SeekRequest(DeviceUtil.getSn(), 0)
+ val seekRequest = SeekRequest(Utils.getSn(), 0)
val param = mutableMapOf("data" to seekRequest.getJson())
ServiceApisManager.serviceApis.networkApi.create(ShareApiService::class.java, HttpConstant.getNetHost()).sendHelpSignal(param).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(object : SubscribeImpl(RequestOptions.create(context)) {
override fun onSuccess(o: BaseData?) {
diff --git a/modules/mogo-module-share/src/main/res/anim/module_share_dialog_enter_anim.xml b/modules/mogo-module-share/src/main/res/anim/module_share_dialog_enter_anim.xml
new file mode 100644
index 0000000000..a49af94353
--- /dev/null
+++ b/modules/mogo-module-share/src/main/res/anim/module_share_dialog_enter_anim.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-share/src/main/res/anim/module_share_dialog_exit_anim.xml b/modules/mogo-module-share/src/main/res/anim/module_share_dialog_exit_anim.xml
new file mode 100644
index 0000000000..e0914a5b11
--- /dev/null
+++ b/modules/mogo-module-share/src/main/res/anim/module_share_dialog_exit_anim.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/module_share_title_icon_left.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/module_share_title_icon_left.png
new file mode 100644
index 0000000000..aba37467b6
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/module_share_title_icon_left.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/module_share_title_icon_right.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/module_share_title_icon_right.png
new file mode 100644
index 0000000000..719c121eea
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/module_share_title_icon_right.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_accident.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_accident.png
new file mode 100644
index 0000000000..2af41503f9
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_accident.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_block_up.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_block_up.png
new file mode 100644
index 0000000000..c9eb6b0a18
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_block_up.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_dense_fog.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_dense_fog.png
new file mode 100644
index 0000000000..1336432e1d
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_dense_fog.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_real_time_traffic.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_real_time_traffic.png
new file mode 100644
index 0000000000..9504c2bc87
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_real_time_traffic.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_closure.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_closure.png
new file mode 100644
index 0000000000..bcd17dfa93
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_closure.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_construction.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_construction.png
new file mode 100644
index 0000000000..0122719438
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_construction.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_icy.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_icy.png
new file mode 100644
index 0000000000..6d249db767
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_road_icy.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_seek_help.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_seek_help.png
new file mode 100644
index 0000000000..e1d78a093d
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_seek_help.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_stagnant_water.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_stagnant_water.png
new file mode 100644
index 0000000000..27acbbe17b
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_stagnant_water.png differ
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_traffic_check.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_traffic_check.png
new file mode 100644
index 0000000000..4daa5cb903
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi-1920x1000/share_traffic_check.png differ
diff --git a/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml b/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml
index f5012a4dce..448fef5d09 100644
--- a/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml
+++ b/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml
@@ -39,132 +39,132 @@
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_block_up"
android:text="拥堵"
- android:textSize="@dimen/dp_32"
+ android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
app:layout_constraintHorizontal_chainStyle="spread_inside"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/btn_share_title"
app:layout_constraintRight_toLeftOf="@+id/tvTrafficCheck"
app:layout_constraintLeft_toLeftOf="@+id/vBg"
- android:layout_marginStart="@dimen/dp_116"
- android:layout_marginTop="@dimen/dp_78"
- android:drawablePadding="@dimen/dp_30" />
+ android:layout_marginStart="@dimen/share_module_btn_margin_left_right"
+ android:layout_marginTop="@dimen/share_module_first_btn_margin_top"
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:layout_marginTop="@dimen/share_module_sec_btn_margin_top"
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:layout_marginTop="@dimen/share_module_sec_btn_margin_top"
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:layout_marginTop="@dimen/share_module_sec_btn_margin_top"
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
+ android:drawablePadding="@dimen/share_module_drawable_padding" />
\ No newline at end of file
diff --git a/modules/mogo-module-share/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-share/src/main/res/values-xhdpi-1920x1000/dimens.xml
new file mode 100644
index 0000000000..4041b60f30
--- /dev/null
+++ b/modules/mogo-module-share/src/main/res/values-xhdpi-1920x1000/dimens.xml
@@ -0,0 +1,26 @@
+
+
+ 1318px
+ 727px
+ 64px
+ 51px
+ 200px
+ 210px
+ 30px
+ 160px
+ 198px
+ 55px
+ 70px
+ 56px
+ 27px
+ 105px
+
+
+ 36px
+ 32px
+ 28px
+ 28px
+
+
+
+
diff --git a/modules/mogo-module-share/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-share/src/main/res/values-xhdpi/dimens.xml
index 0e3e0cf68a..566d8d9d02 100644
--- a/modules/mogo-module-share/src/main/res/values-xhdpi/dimens.xml
+++ b/modules/mogo-module-share/src/main/res/values-xhdpi/dimens.xml
@@ -10,11 +10,16 @@
160px
198px
55px
+ 78px
+ 62px
+ 30px
+ 116px
40px
32px
28px
+ 32px
diff --git a/modules/mogo-module-share/src/main/res/values/dimens.xml b/modules/mogo-module-share/src/main/res/values/dimens.xml
index ff81f21386..0e92e92f36 100644
--- a/modules/mogo-module-share/src/main/res/values/dimens.xml
+++ b/modules/mogo-module-share/src/main/res/values/dimens.xml
@@ -11,10 +11,15 @@
85px
110px
28px
+ 42.6px
+ 34px
+ 16.4px
+ 63.4px
22px
18px
15px
+ 17.5px
\ No newline at end of file
diff --git a/modules/mogo-module-share/src/main/res/values/styles.xml b/modules/mogo-module-share/src/main/res/values/styles.xml
index 389862f71e..b07cecf669 100644
--- a/modules/mogo-module-share/src/main/res/values/styles.xml
+++ b/modules/mogo-module-share/src/main/res/values/styles.xml
@@ -13,4 +13,9 @@
- @color/all_transparent_white
- @color/all_transparent_white
+
+
diff --git a/modules/mogo-module-splash-noop/.gitignore b/modules/mogo-module-splash-noop/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-splash-noop/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-splash-noop/build.gradle b/modules/mogo-module-splash-noop/build.gradle
new file mode 100644
index 0000000000..509929f10c
--- /dev/null
+++ b/modules/mogo-module-splash-noop/build.gradle
@@ -0,0 +1,58 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'com.alibaba.arouter'
+
+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.androidxccorektx
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.androidxconstraintlayout
+ implementation rootProject.ext.dependencies.arouter
+ kapt rootProject.ext.dependencies.aroutercompiler
+ implementation rootProject.ext.dependencies.rxjava
+ implementation rootProject.ext.dependencies.rxandroid
+
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-splash-noop/consumer-rules.pro b/modules/mogo-module-splash-noop/consumer-rules.pro
new file mode 100644
index 0000000000..880adfb994
--- /dev/null
+++ b/modules/mogo-module-splash-noop/consumer-rules.pro
@@ -0,0 +1 @@
+-keep class com.zhidao.mogo.module.splash.BydConst
\ No newline at end of file
diff --git a/modules/mogo-module-splash-noop/gradle.properties b/modules/mogo-module-splash-noop/gradle.properties
new file mode 100644
index 0000000000..33dc22af32
--- /dev/null
+++ b/modules/mogo-module-splash-noop/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-splash-noop
+VERSION_CODE=1
diff --git a/modules/mogo-module-splash-noop/proguard-rules.pro b/modules/mogo-module-splash-noop/proguard-rules.pro
new file mode 100644
index 0000000000..f5e721d80f
--- /dev/null
+++ b/modules/mogo-module-splash-noop/proguard-rules.pro
@@ -0,0 +1,23 @@
+# 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
+
+-keep class com.zhidao.mogo.module.splash.BydConst
\ No newline at end of file
diff --git a/modules/mogo-module-splash-noop/src/main/AndroidManifest.xml b/modules/mogo-module-splash-noop/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..2ace90a42d
--- /dev/null
+++ b/modules/mogo-module-splash-noop/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-splash-noop/src/main/java/com/zhidao/mogo/module/splash/BydConst.kt b/modules/mogo-module-splash-noop/src/main/java/com/zhidao/mogo/module/splash/BydConst.kt
new file mode 100644
index 0000000000..74536ca572
--- /dev/null
+++ b/modules/mogo-module-splash-noop/src/main/java/com/zhidao/mogo/module/splash/BydConst.kt
@@ -0,0 +1,6 @@
+package com.zhidao.mogo.module.splash
+
+object BydConst {
+ const val MODULE_NAME = "MODULE_BYD"
+ const val PATH_NAME = "/carmachine/byd"
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash-noop/src/main/java/com/zhidao/mogo/module/splash/BydProvider.kt b/modules/mogo-module-splash-noop/src/main/java/com/zhidao/mogo/module/splash/BydProvider.kt
new file mode 100644
index 0000000000..9b134711e7
--- /dev/null
+++ b/modules/mogo-module-splash-noop/src/main/java/com/zhidao/mogo/module/splash/BydProvider.kt
@@ -0,0 +1,72 @@
+package com.zhidao.mogo.module.splash
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.service.module.IMogoModuleProvider
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.splash.BydConst.MODULE_NAME
+import com.zhidao.mogo.module.splash.BydConst.PATH_NAME
+
+/**
+ * 比亚迪车机provider
+ *
+ * @author tongchenfei
+ */
+@Route(path = PATH_NAME)
+class BydProvider:IMogoModuleProvider {
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun init(context: Context?) {
+ Logger.d(MODULE_NAME, "比亚迪noop模块初始化===")
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String {
+ return ""
+ }
+
+ override fun createView(context: Context?): View? {
+ return null
+ }
+
+ override fun createFragment(context: Context?, data: Bundle?): Fragment? {
+ return null
+ }
+
+ override fun getModuleName(): String {
+ return MODULE_NAME
+ }
+
+ override fun getAppName(): String {
+ return ""
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/.gitignore b/modules/mogo-module-splash/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-splash/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-splash/build.gradle b/modules/mogo-module-splash/build.gradle
new file mode 100644
index 0000000000..509929f10c
--- /dev/null
+++ b/modules/mogo-module-splash/build.gradle
@@ -0,0 +1,58 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'com.alibaba.arouter'
+
+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.androidxccorektx
+ implementation rootProject.ext.dependencies.kotlinstdlibjdk7
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.androidxconstraintlayout
+ implementation rootProject.ext.dependencies.arouter
+ kapt rootProject.ext.dependencies.aroutercompiler
+ implementation rootProject.ext.dependencies.rxjava
+ implementation rootProject.ext.dependencies.rxandroid
+
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-splash/consumer-rules.pro b/modules/mogo-module-splash/consumer-rules.pro
new file mode 100644
index 0000000000..77f2669d8c
--- /dev/null
+++ b/modules/mogo-module-splash/consumer-rules.pro
@@ -0,0 +1,2 @@
+#-----ModuleSplash-----
+-keep class com.zhidao.mogo.module.splash.SplashConst.*{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/gradle.properties b/modules/mogo-module-splash/gradle.properties
new file mode 100644
index 0000000000..4c41034d70
--- /dev/null
+++ b/modules/mogo-module-splash/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-splash
+VERSION_CODE=1
diff --git a/modules/mogo-module-splash/proguard-rules.pro b/modules/mogo-module-splash/proguard-rules.pro
new file mode 100644
index 0000000000..f64d6a4170
--- /dev/null
+++ b/modules/mogo-module-splash/proguard-rules.pro
@@ -0,0 +1,24 @@
+# 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
+
+#-----ModuleSplash-----
+-keep class com.zhidao.mogo.module.splash.SplashConst.*{*;}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/androidTest/java/com/zhidao/mogo/module/splash/ExampleInstrumentedTest.kt b/modules/mogo-module-splash/src/androidTest/java/com/zhidao/mogo/module/splash/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000000..b0d35cfd07
--- /dev/null
+++ b/modules/mogo-module-splash/src/androidTest/java/com/zhidao/mogo/module/splash/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package com.zhidao.mogo.module.splash
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("com.zhidao.mogo.module.byd.test", appContext.packageName)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/AndroidManifest.xml b/modules/mogo-module-splash/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..2ace90a42d
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/SplashConst.kt b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/SplashConst.kt
new file mode 100644
index 0000000000..a2ffcbd208
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/SplashConst.kt
@@ -0,0 +1,6 @@
+package com.zhidao.mogo.module.splash
+
+object SplashConst {
+ const val MODULE_NAME = "MODULE_SPLASH"
+ const val PATH_NAME = "/splash/api"
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/SplashProvider.kt b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/SplashProvider.kt
new file mode 100644
index 0000000000..207206469e
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/SplashProvider.kt
@@ -0,0 +1,76 @@
+package com.zhidao.mogo.module.splash
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import androidx.fragment.app.Fragment
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.mogo.commons.debug.DebugConfig
+import com.mogo.map.listener.IMogoMapListener
+import com.mogo.map.location.IMogoLocationListener
+import com.mogo.map.marker.IMogoMarkerClickListener
+import com.mogo.map.navi.IMogoNaviListener
+import com.mogo.service.module.IMogoModuleLifecycle
+import com.mogo.service.module.IMogoModuleProvider
+import com.mogo.utils.logger.Logger
+import com.zhidao.mogo.module.splash.SplashConst.MODULE_NAME
+import com.zhidao.mogo.module.splash.SplashConst.PATH_NAME
+import com.zhidao.mogo.module.splash.fragment.BydSplashFragment
+
+/**
+ * 比亚迪车机provider
+ *
+ * @author tongchenfei
+ */
+@Route(path = PATH_NAME)
+class SplashProvider : IMogoModuleProvider {
+ override fun getNaviListener(): IMogoNaviListener? {
+ return null
+ }
+
+ override fun getLocationListener(): IMogoLocationListener? {
+ return null
+ }
+
+ override fun getType(): Int {
+ return 0
+ }
+
+ override fun getMarkerClickListener(): IMogoMarkerClickListener? {
+ return null
+ }
+
+ override fun init(context: Context?) {
+ Logger.d(MODULE_NAME, "比亚迪模块初始化===")
+ }
+
+ override fun getMapListener(): IMogoMapListener? {
+ return null
+ }
+
+ override fun getAppPackage(): String {
+ return ""
+ }
+
+ override fun createView(context: Context?): View? {
+ return null
+ }
+
+ override fun createFragment(context: Context?, data: Bundle?): Fragment? = if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD) {
+ BydSplashFragment()
+ } else {
+ null
+ }
+
+ override fun getModuleName(): String {
+ return MODULE_NAME
+ }
+
+ override fun getAppName(): String {
+ return ""
+ }
+
+ override fun getCardLifecycle(): IMogoModuleLifecycle? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt
new file mode 100644
index 0000000000..1148d63378
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt
@@ -0,0 +1,55 @@
+package com.zhidao.mogo.module.splash.fragment
+
+import android.os.Handler
+import android.os.Message
+import com.mogo.commons.mvp.MvpFragment
+import com.zhidao.mogo.module.splash.R
+import com.zhidao.mogo.module.splash.presenter.BydSplashPresenter
+import kotlinx.android.synthetic.main.fragment_byd_splash.*
+
+const val DEFAULT_COUNT_DOWN_TIME = 5
+const val MSG_COUNT_DOWN = 1001
+const val DEFAULT_COUNT_DOWN_DELAY = 1000L
+class BydSplashFragment :MvpFragment(),Handler.Callback{
+ private val handler = Handler(this)
+ private var countDownTime = DEFAULT_COUNT_DOWN_TIME
+
+ override fun getLayoutId(): Int = R.layout.fragment_byd_splash
+
+ override fun initViews() {
+ startCountDown()
+ tvByd.setOnClickListener {
+ hideSplash()
+ }
+ }
+
+ override fun createPresenter(): BydSplashPresenter = BydSplashPresenter(this)
+
+ private fun startCountDown(){
+ handler.removeMessages(MSG_COUNT_DOWN)
+ countDownTime = DEFAULT_COUNT_DOWN_TIME
+ tvCountDown.text = countDownTime.toString()
+ handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY)
+ }
+
+ override fun handleMessage(msg: Message): Boolean {
+ if (msg.what == MSG_COUNT_DOWN) {
+ tvCountDown?.also {
+ countDownTime--
+ if(countDownTime>0) {
+ it.text = countDownTime.toString()
+ handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY)
+ }else{
+ hideSplash()
+ }
+ }
+ return true
+ }
+ return false
+ }
+
+ private fun hideSplash(){
+ handler.removeMessages(MSG_COUNT_DOWN)
+ activity!!.supportFragmentManager.beginTransaction().remove(this).commit()
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/presenter/BydSplashPresenter.kt b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/presenter/BydSplashPresenter.kt
new file mode 100644
index 0000000000..b16df959c7
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/presenter/BydSplashPresenter.kt
@@ -0,0 +1,7 @@
+package com.zhidao.mogo.module.splash.presenter
+
+import com.mogo.commons.mvp.Presenter
+import com.zhidao.mogo.module.splash.fragment.BydSplashFragment
+
+class BydSplashPresenter(view: BydSplashFragment) : Presenter(view) {
+}
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/res/drawable-xhdpi-1920x1000/module_byd_splash.webp b/modules/mogo-module-splash/src/main/res/drawable-xhdpi-1920x1000/module_byd_splash.webp
new file mode 100644
index 0000000000..d39b3abe55
Binary files /dev/null and b/modules/mogo-module-splash/src/main/res/drawable-xhdpi-1920x1000/module_byd_splash.webp differ
diff --git a/modules/mogo-module-splash/src/main/res/drawable/byd_count_down_bg.xml b/modules/mogo-module-splash/src/main/res/drawable/byd_count_down_bg.xml
new file mode 100644
index 0000000000..83bc413969
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/res/drawable/byd_count_down_bg.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/res/drawable/byd_enter_btn_bg.xml b/modules/mogo-module-splash/src/main/res/drawable/byd_enter_btn_bg.xml
new file mode 100644
index 0000000000..e34b2f6181
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/res/drawable/byd_enter_btn_bg.xml
@@ -0,0 +1,10 @@
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/main/res/drawable/module_byd_splash.webp b/modules/mogo-module-splash/src/main/res/drawable/module_byd_splash.webp
new file mode 100644
index 0000000000..d39b3abe55
Binary files /dev/null and b/modules/mogo-module-splash/src/main/res/drawable/module_byd_splash.webp differ
diff --git a/modules/mogo-module-splash/src/main/res/layout/fragment_byd_splash.xml b/modules/mogo-module-splash/src/main/res/layout/fragment_byd_splash.xml
new file mode 100644
index 0000000000..bb79601719
--- /dev/null
+++ b/modules/mogo-module-splash/src/main/res/layout/fragment_byd_splash.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-splash/src/test/java/com/zhidao/mogo/module/splash/ExampleUnitTest.kt b/modules/mogo-module-splash/src/test/java/com/zhidao/mogo/module/splash/ExampleUnitTest.kt
new file mode 100644
index 0000000000..35aae2dff8
--- /dev/null
+++ b/modules/mogo-module-splash/src/test/java/com/zhidao/mogo/module/splash/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package com.zhidao.mogo.module.splash
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
\ No newline at end of file
diff --git a/foudations/mogo-connection/.gitignore b/modules/mogo-module-v2x/.gitignore
similarity index 100%
rename from foudations/mogo-connection/.gitignore
rename to modules/mogo-module-v2x/.gitignore
diff --git a/modules/mogo-module-v2x/README.md b/modules/mogo-module-v2x/README.md
new file mode 100644
index 0000000000..aacceabed4
--- /dev/null
+++ b/modules/mogo-module-v2x/README.md
@@ -0,0 +1,25 @@
+#### 项目介绍
+本项目是V2X模块,必须依附于Launcher进行集成使用,无法单独使用,且需要车机安装Autopilot(ADAS)一起使用。
+
+#### 项目结构
+- adapter --- 展示视图适配
+- alarm --- 提醒计算
+- entity --- 数据实体
+- listener --- Socket监听
+- manager --- 管理工具,绘制marker,绘制连接线,记录状态
+- marker --- 地图marker视图适配
+- network --- 网络请求
+- scenario --- 场景,可以简单的理解为每一种弹窗是一种场景
+ - scene
+ - animation --- 场景动画 H5 推送下来的
+ - fatigue --- 疲劳驾驶
+ - help --- 自车故障求助
+ - livecar --- 直播场景,H5推送的和道路事件预警的
+ - park --- 违章停车
+ - push --- 推送的演示场景,取快递、政府公告、顺风车、行人点赞
+ - road --- 道路事件预警
+ - seek --- 他人故障求助预警
+ - test --- 测试页面,一堆按钮,自己点击触发以上场景
+- utils --- 工具类
+- view --- 自定义视图
+- voice --- 语音注册
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/build.gradle b/modules/mogo-module-v2x/build.gradle
new file mode 100644
index 0000000000..bafd090ea7
--- /dev/null
+++ b/modules/mogo-module-v2x/build.gradle
@@ -0,0 +1,81 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'com.alibaba.arouter'
+apply plugin: 'android-aspectjx'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ 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'
+
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = [AROUTER_MODULE_NAME: project.getName()]
+ }
+ }
+ ndk {
+ abiFilters "armeabi", "armeabi-v7a", "arm64-v8a"
+ }
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.tencent.liteavsdk:LiteAVSDK_Smart:7.4.9211'
+ implementation 'ch.hsr:geohash:1.4.0'
+ implementation rootProject.ext.dependencies.flexbox
+ implementation rootProject.ext.dependencies.rxandroid
+ implementation rootProject.ext.dependencies.androidxrecyclerview
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.androidxconstraintlayout
+ implementation rootProject.ext.dependencies.arouter
+ implementation rootProject.ext.dependencies.carcallprovider
+ implementation rootProject.ext.dependencies.carcall
+
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.mogomap
+ implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.mogocommons
+ implementation rootProject.ext.dependencies.mogoservice
+ implementation rootProject.ext.dependencies.mogoserviceapi
+ implementation rootProject.ext.dependencies.modulecommon
+ implementation rootProject.ext.dependencies.moduleservice
+ } else {
+ implementation project(':libraries:mogo-map')
+ implementation project(':foudations:mogo-utils')
+ implementation project(':foudations:mogo-commons')
+ implementation project(':services:mogo-service')
+ implementation project(':services:mogo-service-api')
+ implementation project(':modules:mogo-module-common')
+ implementation project(':modules:mogo-module-service')
+ }
+
+ annotationProcessor rootProject.ext.dependencies.aroutercompiler
+
+ testImplementation 'junit:junit:4.13'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-v2x/consumer-rules.pro b/modules/mogo-module-v2x/consumer-rules.pro
new file mode 100644
index 0000000000..d35f77a3fa
--- /dev/null
+++ b/modules/mogo-module-v2x/consumer-rules.pro
@@ -0,0 +1,17 @@
+#-----V2XModule-----
+-keep class com.tencent.** { *; }
+-keep class com.mogo.module.v2x.entity.net.** { *; }
+-keep class com.mogo.module.v2x.manager.V2XStatusDescriptor
+-keep class com.mogo.module.v2x.utils.SpanUtils.Align
+-keep class com.mogo.module.v2x.utils.TimeConstants.Unit
+-keep interface * implements com.mogo.module.v2x.alarm.V2XAlarmServer.OnFatigueDrivingListener
+-keep interface * implements com.mogo.module.v2x.listener.CarStatusListener
+-keep interface * implements com.mogo.module.v2x.listener.V2XWindowStatusListener
+-keep interface * implements com.mogo.module.v2x.network.V2XApiService
+-keep interface * implements com.mogo.module.v2x.network.V2XRefreshCallback
+-keep interface * implements com.mogo.module.v2x.scenario.view.**{*;}
+-keep interface * implements com.mogo.module.v2x.scenario.impl.**{*;}
+-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenario
+-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenarioManager
+-keep class com.mogo.module.v2x.voice.**{*;}
+-keep class com.mogo.module.v2x.V2XConst
diff --git a/modules/mogo-module-v2x/gradle.properties b/modules/mogo-module-v2x/gradle.properties
new file mode 100644
index 0000000000..2cb3dc2a8a
--- /dev/null
+++ b/modules/mogo-module-v2x/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-v2x
+VERSION_CODE=1
diff --git a/modules/mogo-module-v2x/proguard-rules.pro b/modules/mogo-module-v2x/proguard-rules.pro
new file mode 100644
index 0000000000..c7797fa760
--- /dev/null
+++ b/modules/mogo-module-v2x/proguard-rules.pro
@@ -0,0 +1,39 @@
+# 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
+
+#-----V2XModule-----
+-keep class com.tencent.** { *; }
+-keep class com.mogo.module.v2x.entity.net.** { *; }
+-keep class com.mogo.module.v2x.manager.V2XStatusDescriptor
+-keep class com.mogo.module.v2x.utils.SpanUtils.Align
+-keep class com.mogo.module.v2x.utils.TimeConstants.Unit
+-keep interface * implements com.mogo.module.v2x.alarm.V2XAlarmServer.OnFatigueDrivingListener
+-keep interface * implements com.mogo.module.v2x.listener.CarStatusListener
+-keep interface * implements com.mogo.module.v2x.listener.V2XWindowStatusListener
+-keep interface * implements com.mogo.module.v2x.network.V2XApiService
+-keep interface * implements com.mogo.module.v2x.network.V2XRefreshCallback
+-keep interface * implements com.mogo.module.v2x.scenario.view.**{*;}
+-keep interface * implements com.mogo.module.v2x.scenario.impl.**{*;}
+-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenario
+-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenarioManager
+-keep class com.mogo.module.v2x.voice.**{*;}
+-keep class com.mogo.module.v2x.V2XConst
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/androidTest/java/com/mogo/module/blackbox/ExampleInstrumentedTest.java b/modules/mogo-module-v2x/src/androidTest/java/com/mogo/module/blackbox/ExampleInstrumentedTest.java
new file mode 100644
index 0000000000..7fd2f97597
--- /dev/null
+++ b/modules/mogo-module-v2x/src/androidTest/java/com/mogo/module/blackbox/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.mogo.module.blackbox;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.mogo.module.blackbox.test", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/AndroidManifest.xml b/modules/mogo-module-v2x/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..158659eecc
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/AndroidManifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/MoGoV2XServicePaths.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/MoGoV2XServicePaths.java
new file mode 100644
index 0000000000..20c8dde883
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/MoGoV2XServicePaths.java
@@ -0,0 +1,34 @@
+package com.mogo.module.v2x;
+
+import androidx.annotation.Keep;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 7:35 PM
+ * desc : 对外服务模块路径
+ * version: 1.0
+ * 使用方式:
+ * Arouter.getInstance().path("").navigate()
+ */
+@Keep
+public class MoGoV2XServicePaths {
+ /**
+ * V2X 状态管理
+ */
+ @Keep
+ public static final String PATH_V2X_STATUS_MANAGER = "/v2xStatusManager/api";
+
+ /**
+ * V2X 道路事件POI点
+ */
+ @Keep
+ public static final String PATH_V2X_MARKER_MANAGER = "/v2xMarkerManager/api";
+
+ /**
+ * V2X 道路事件与车辆的连接线
+ */
+ @Keep
+ public static final String PATH_V2X_POLYLINE_MANAGER = "/v2xPolylineManager/api";
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java
new file mode 100644
index 0000000000..270da46d61
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java
@@ -0,0 +1,107 @@
+package com.mogo.module.v2x;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-2114:10
+ * desc : V2X使用到的常量
+ * version: 1.0
+ */
+public class V2XConst {
+ /**
+ * 类型
+ */
+ public static final String MODULE_NAME = "V2X_UI";
+ /**
+ * V2X模块地址
+ */
+ public static final String PATH_V2X_UI = "/v2x/ui";
+ public static final String SEEK_HELP_TIME = "seek_help_time";
+
+ /**
+ * V2X 场景广播 Action
+ */
+ public static final String BROADCAST_SCENE_HANDLER_ACTION = "com.v2x.scene_handler_broadcast";
+ public static final String BROADCAST_SCENE_EXTRA_KEY = "V2XMessageEntity";
+
+ public static final String BROADCAST_SCENE_ACTION = "com.v2x.scene_local_broadcast";
+
+ public static final String V2X_ACC_ON_TIME_STR = "v2x_acc_on_time_str";
+ public static final String V2X_ACC_OFF_TIME_STR = "v2x_acc_off_time_str";
+ public static final String V2X_STRATEGY_PUSH = "v2x_strategy_push";
+
+ public static final int STATE_ERROR = -1;
+ public static final int STATE_IDLE = 0;
+ public static final int STATE_PREPARING = 1;
+ public static final int STATE_PREPARED = 2;
+ public static final int STATE_PLAYING = 3;
+ public static final int STATE_PAUSED = 4;
+ public static final int STATE_PLAYBACK_COMPLETED = 5;
+ public static final int STATE_SEEKING = 6;
+
+ /**
+ * V2X 埋点
+ */
+ public static final String V2X_ROAD_SHOW = "v2x_road_show";
+ public static final String V2X_ROAD_EVET = "v2x_road_event";
+ /**
+ * V2X 道路事件操作类型
+ */
+ public static final String V2X_ROAD_ZAN = "1";
+ public static final String V2X_ROAD_CHAT = "2";
+ public static final String V2X_ROAD_VIDEO = "3";
+ public static final String V2X_ROAD_NAVI = "4";
+ public static final String V2X_ROAD_REPORT_RIGHT = "5";
+ public static final String V2X_ROAD_REPORT_ERROR = "6";
+
+ /**
+ * V2X 地图上发出警告的POI
+ */
+ public static final String V2X_ILLEGAL_PARK_POI = "V2X_ILLEGAL_PARK_POI";
+
+ /**
+ * V2X 地图上发出警告的POI
+ */
+ public static final String V2X_EVENT_ALARM_POI = "V2X_EVENT_ALARM_POI";
+
+ /**
+ * V2X 探路数据
+ */
+ public static final String V2X_CARD_TYPE_ROAD_CONDITION = "V2X_CARD_TYPE_ROAD_CONDITION";
+
+ /**
+ * V2X 用户数据
+ */
+ public static final String V2X_CARD_TYPE_USER_DATA = "V2X_CARD_TYPE_USER_DATA";
+
+ /**
+ * V2X 新鲜事
+ */
+ public static final String V2X_CARD_TYPE_NOVELTY = "V2X_CARD_TYPE_NOVELTY";
+
+ /**
+ * V2X 特殊车辆
+ */
+ public static final String V2X_MARKER_SPECIAL_CAR = "V2X_MARKER_SPECIAL_CAR";
+
+ /**
+ * V2X 可直播车辆
+ */
+ public static final String V2X_MARKER_LIVE_CAR = "V2X_MARKER_LIVE_CAR";
+
+ /**
+ * V2X 取快递
+ */
+ public static final String V2X_MARKER_EXPRESS = "V2X_MARKER_EXPRESS";
+
+ /**
+ * V2X 顺风车
+ */
+ public static final String V2X_MARKER_TAXI = "V2X_MARKER_TAXI";
+
+ /**
+ * V2X 政府推送消息
+ */
+ public static final String V2X_MARKER_GOVERNMENT = "V2X_MARKER_GOVERNMENT";
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XDemoManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XDemoManager.java
new file mode 100644
index 0000000000..212cde2ea7
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XDemoManager.java
@@ -0,0 +1,139 @@
+package com.mogo.module.v2x;
+
+import android.content.Intent;
+import android.text.TextUtils;
+
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.common.entity.MarkerUserInfo;
+import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes;
+import com.mogo.module.v2x.network.V2XRefreshCallback;
+import com.mogo.module.v2x.utils.ChartingUtil;
+import com.mogo.module.v2x.voice.V2XVoiceConstants;
+import com.mogo.module.v2x.voice.V2XVoiceManager;
+import com.mogo.utils.logger.Logger;
+
+import java.util.List;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/28 12:24 PM
+ * desc : 演示DEMO管理
+ * version: 1.0
+ */
+public class V2XDemoManager {
+ private List userListBeanList;
+ private V2XDemoUserInfoRes.ResultBean.UserListBean mV2XDemoUserInfoEntity1;
+ private V2XDemoUserInfoRes.ResultBean.UserListBean mV2XDemoUserInfoEntity2;
+ private V2XDemoUserInfoRes.ResultBean.UserListBean mV2XDemoUserInfoEntity3;
+ private static V2XDemoManager mV2XDemoManager;
+
+ private V2XDemoManager() {
+ }
+
+ public static V2XDemoManager getInstance() {
+ if (mV2XDemoManager == null) {
+ synchronized (V2XDemoManager.class) {
+ if (mV2XDemoManager == null) {
+ mV2XDemoManager = new V2XDemoManager();
+ }
+ }
+ }
+ return mV2XDemoManager;
+ }
+
+ public void initData() {
+ // 获取演示车辆信息
+ V2XServiceManager
+ .getV2XRefreshModel()
+ .getMockUserInfos(new V2XRefreshCallback() {
+ @Override
+ public void onSuccess(V2XDemoUserInfoRes result) {
+ userListBeanList = result.getResult().getUserList();
+ Logger.w(MODULE_NAME, "V2X演示用户数据:" + userListBeanList);
+
+ for (V2XDemoUserInfoRes.ResultBean.UserListBean userListBean : userListBeanList) {
+ switch (userListBean.getSceneType()) {
+ case "1":
+ mV2XDemoUserInfoEntity1 = userListBean;
+ break;
+ case "2":
+ mV2XDemoUserInfoEntity2 = userListBean;
+ break;
+ case "3":
+ mV2XDemoUserInfoEntity3 = userListBean;
+ break;
+ }
+ }
+
+ // 呼叫前方车辆
+ V2XVoiceManager.INSTANCE.registerWakeCmd(
+ V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR,
+ (String command, Intent intent) -> {
+ String dataStr = intent.getStringExtra("data");
+ Logger.w(MODULE_NAME, "mData。。。。" + dataStr);
+ if (!TextUtils.isEmpty(dataStr)) {
+ if (dataStr.contains("address")) {
+ roadCallChart(mV2XDemoUserInfoEntity2);
+ }
+ } else {
+ roadCallChart(mV2XDemoUserInfoEntity1);
+ }
+ }
+ );
+ }
+
+ @Override
+ public void onFail(String msg) {
+
+ }
+ });
+ }
+
+ public void release() {
+ // 呼叫前方车辆
+ V2XVoiceManager.INSTANCE.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR);
+ }
+
+
+ /**
+ * 打电话
+ */
+ private void roadCallChart(V2XDemoUserInfoRes.ResultBean.UserListBean mV2XDemoUserInfoEntity) {
+ Logger.w(MODULE_NAME, "正在拨打电话。。。。" + mV2XDemoUserInfoEntity);
+
+ try {
+ if (mV2XDemoUserInfoEntity != null) {
+ MarkerUserInfo mUserInfo = new MarkerUserInfo();
+ MarkerLocation location = new MarkerLocation();
+ location.setLon(mV2XDemoUserInfoEntity.getLocation().getLon());
+ location.setLat(mV2XDemoUserInfoEntity.getLocation().getLat());
+ mUserInfo.setSn(mV2XDemoUserInfoEntity.getUserInfo().getSn());
+ mUserInfo.setUserHead(mV2XDemoUserInfoEntity.getUserInfo().getUserHead());
+ mUserInfo.setUserName(mV2XDemoUserInfoEntity.getUserInfo().getUserName());
+ mUserInfo.setGender(mV2XDemoUserInfoEntity.getUserInfo().getGender());
+ mUserInfo.setAge(mV2XDemoUserInfoEntity.getUserInfo().getAge());
+ ChartingUtil.callChatting(mUserInfo, location);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ // 1-拨打前方车辆,
+ public V2XDemoUserInfoRes.ResultBean.UserListBean getV2XDemoUserInfoEntity1() {
+ return mV2XDemoUserInfoEntity1;
+ }
+
+ // 2-拨打中关村附近好友,
+ public V2XDemoUserInfoRes.ResultBean.UserListBean getV2XDemoUserInfoEntity2() {
+ return mV2XDemoUserInfoEntity2;
+ }
+
+ // 3-点击地图图标拨打电话
+ public V2XDemoUserInfoRes.ResultBean.UserListBean getV2XDemoUserInfoEntity3() {
+ return mV2XDemoUserInfoEntity3;
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XMarkerService.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XMarkerService.java
new file mode 100644
index 0000000000..69497f597a
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XMarkerService.java
@@ -0,0 +1,108 @@
+package com.mogo.module.v2x;
+
+import android.content.Context;
+import android.os.Handler;
+
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.location.MogoLocation;
+import com.mogo.module.v2x.listener.V2XLocationListener;
+import com.mogo.module.v2x.network.V2XRefreshModel;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/6 5:37 PM
+ * desc :
+ * version: 1.0
+ */
+public class V2XMarkerService {
+ private final String TAG = "V2XMarkerService";
+
+ // 一分钟获取一次最新的路况信息
+ private final int refreshTime = 60_000;
+ private static V2XMarkerService mV2XMarkerService;
+
+ private V2XRefreshModel mV2XRefreshModel;
+ private Handler refreshHandler;
+ private Runnable refreshRunnable;
+
+ public synchronized static V2XMarkerService getInstance(Context context) {
+ if (mV2XMarkerService == null) {
+ mV2XMarkerService = new V2XMarkerService();
+ mV2XMarkerService.init(context);
+ }
+ return mV2XMarkerService;
+ }
+
+ private void init(Context context) {
+ mV2XRefreshModel = V2XRefreshModel.getInstance(context);
+ }
+
+ public V2XRefreshModel getV2XRefreshModel() {
+ return mV2XRefreshModel;
+ }
+
+ public void refreshMarkerData(MogoLocation location) {
+ try {
+ if (mV2XRefreshModel != null && location != null) {
+ //Logger.d(MODULE_NAME, "V2X道路事件:执行气泡刷新操作。");
+ // 获取目前最新的周边的poi点
+ mV2XRefreshModel.querySnapshotAsync(
+ new MogoLatLng(location.getLatitude(), location.getLongitude()),
+ (int) getMapCameraFactWidth(),
+ 999);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 地图视图对应的实际宽度
+ */
+ private float getMapCameraFactWidth() {
+ return 1_000;
+ }
+
+ /**
+ * 关闭自动刷新
+ */
+ public void stopAutoRefresh() {
+ Logger.w(MODULE_NAME, "V2X道路事件:关闭V2X地图气泡自动刷新。");
+ V2XServiceManager
+ .getMogoRegisterCenter()
+ .unregisterMogoLocationListener(MODULE_NAME);
+
+ if (refreshHandler != null) {
+ refreshHandler.removeCallbacks(refreshRunnable);
+ }
+ refreshRunnable = null;
+ }
+
+ /**
+ * 开始刷新
+ */
+ public void startAutoRefresh() {
+ // 设置地图定位监听
+ V2XServiceManager.getMogoRegisterCenter()
+ .registerMogoLocationListener(MODULE_NAME, V2XLocationListener.getInstance());
+
+ Logger.d(MODULE_NAME, "V2X道路事件:开启V2X地图气泡自动绘制。");
+ if (refreshHandler == null) {
+ refreshHandler = new Handler();
+ }
+ if (refreshRunnable == null) {
+ refreshRunnable = new Runnable() {
+ @Override
+ public void run() {
+ refreshMarkerData(V2XLocationListener.getInstance().getLastCarLocation());
+ refreshHandler.postDelayed(this, refreshTime);
+ }
+ };
+ }
+ refreshHandler.post(refreshRunnable);
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java
new file mode 100644
index 0000000000..5188f2398a
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java
@@ -0,0 +1,336 @@
+package com.mogo.module.v2x;
+
+import android.content.Context;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.view.MotionEvent;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.listener.IMogoMapListener;
+import com.mogo.map.location.IMogoLocationListener;
+import com.mogo.map.marker.IMogoMarker;
+import com.mogo.map.marker.IMogoMarkerClickListener;
+import com.mogo.map.model.MogoPoi;
+import com.mogo.map.navi.IMogoNaviListener;
+import com.mogo.map.uicontroller.EnumMapUI;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerShowEntity;
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.service.ServiceConst;
+import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
+import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
+import com.mogo.module.v2x.network.V2XRefreshCallback;
+import com.mogo.module.v2x.receiver.SceneBroadcastReceiver;
+import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
+import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
+import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkWindow;
+import com.mogo.module.v2x.scenario.scene.test.V2XTestConsoleWindow;
+import com.mogo.module.v2x.utils.FatigueDrivingUtils;
+import com.mogo.module.v2x.utils.TimeUtils;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.module.v2x.voice.V2XVoiceManager;
+import com.mogo.service.module.IMogoModuleLifecycle;
+import com.mogo.service.module.IMogoModuleProvider;
+import com.mogo.service.module.ModuleType;
+import com.mogo.service.statusmanager.IMogoStatusChangedListener;
+import com.mogo.service.statusmanager.StatusDescriptor;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+import com.mogo.utils.storage.SharedPrefsMgr;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-2114:03
+ * desc : V2X的管理
+ * version: 2.0
+ */
+@Route(path = V2XConst.PATH_V2X_UI)
+public class V2XModuleProvider implements
+ IMogoModuleProvider,
+ IMogoStatusChangedListener,
+ IMogoMapListener {
+ private final String TAG = "V2XMocduleProvider";
+
+ private Context mContext;
+
+ @Override
+ public Fragment createFragment(Context context, Bundle data) {
+ return null;
+ }
+
+ @Override
+ public View createView(Context context) {
+ return null;
+ }
+
+ @NonNull
+ @Override
+ public String getModuleName() {
+ return ServiceConst.TYPE;
+ }
+
+ @Override
+ public IMogoModuleLifecycle getCardLifecycle() {
+ return null;
+ }
+
+ @Override
+ public IMogoMapListener getMapListener() {
+ return null;
+ }
+
+ @Override
+ public int getType() {
+ return ModuleType.TYPE_SERVICE;
+ }
+
+ @Override
+ public IMogoNaviListener getNaviListener() {
+ return null;
+ }
+
+ @Override
+ public IMogoLocationListener getLocationListener() {
+ return null;
+ }
+
+ @Override
+ public IMogoMarkerClickListener getMarkerClickListener() {
+ return null;
+ }
+
+ @Override
+ public String getAppPackage() {
+ return null;
+ }
+
+ @Override
+ public String getAppName() {
+ return null;
+ }
+
+ @Override
+ public void init(Context context) {
+ Logger.e(MODULE_NAME, "V2X模块初始化。。。。");
+ mContext = context;
+
+ V2XUtils.init(context);
+ V2XServiceManager.init(context);
+ initVoice(context);
+ handleAdas();
+ initData();
+
+
+ V2XServiceManager.getMogoRegisterCenter().registerMogoMapListener(V2XConst.MODULE_NAME, this);
+
+ // 注册广播接收场景弹窗使用的
+ SceneBroadcastReceiver localReceiver = new SceneBroadcastReceiver();
+ LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
+ localBroadcastManager.registerReceiver(localReceiver, intentFilter);
+
+// if (BuildConfig.DEBUG) {
+// // TODO 这是测试页面
+// V2XServiceManager
+// .getIMogoWindowManager()
+// .addView(new V2XTestConsoleWindow(context), 0, 0, false);
+// }
+ }
+
+ private void initVoice(Context context) {
+ V2XVoiceManager.INSTANCE.init(context);
+ }
+
+ private void initData() {
+ try {
+ // 查询ACC状态
+ SharedPrefsMgr.getInstance(V2XUtils.getApp()).putBoolean("descriptor_ACC_STATUS", isAccOn());
+ if (isAccOn()) {
+ // 记录开机时间
+ FatigueDrivingUtils.refreshAccOnTime();
+ // 刷新配置文件
+ refreshStrategyConfig();
+ } else {
+ // 记录关机时间
+ SharedPrefsMgr.getInstance(V2XUtils.getApp())
+ .putString(V2XConst.V2X_ACC_OFF_TIME_STR, TimeUtils.getNowString());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // 刷新配置文件
+ refreshStrategyConfig();
+
+ // 响应违章停车的POI点击
+ V2XServiceManager
+ .getMogoRegisterCenter()
+ .registerMogoMarkerClickListener(V2XConst.MODULE_NAME,
+ new IMogoMarkerClickListener() {
+ @Override
+ public boolean onMarkerClicked(IMogoMarker marker) {
+ try {
+ MarkerExploreWay markerExploreWay =
+ (MarkerExploreWay) ((MarkerShowEntity) marker.getObject()).getBindObj();
+ Logger.d(V2XConst.MODULE_NAME,
+ "V2X===违章停车:onMarkerClicked=" + markerExploreWay);
+
+ ((V2XIllegalParkWindow) V2XIllegalParkScenario.getInstance()
+ .getV2XWindow())
+ .show(markerExploreWay, false);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+ });
+ }
+
+ private void refreshStrategyConfig() {
+ // 获取疲劳驾驶的配置
+ V2XServiceManager
+ .getV2XRefreshModel()
+ .getStrategyPush(new V2XRefreshCallback() {
+ @Override
+ public void onSuccess(V2XStrategyPushRes result) {
+ Logger.w(MODULE_NAME, "V2X疲劳驾驶配置数据更新:" + GsonUtil.jsonFromObject(result));
+ V2XStrategyPushRes.ResultBean resultBean = result.getResult();
+ if (resultBean != null) {
+ // 更新本地的v2x提醒策略
+ SharedPrefsMgr.getInstance(V2XUtils.getApp())
+ .putString(V2XConst.V2X_STRATEGY_PUSH, GsonUtil.jsonFromObject(resultBean));
+ }
+ }
+
+ @Override
+ public void onFail(String msg) {
+
+ }
+ });
+ }
+
+ private void handleAdas() {
+ V2XServiceManager.getMoGoStatusManager()
+ .registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this);
+ V2XServiceManager.getMoGoStatusManager()
+ .registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this);
+
+ // 注册V2X场景Socket
+ V2XServiceManager.getV2XSocketManager().registerSocketMessage();
+ // 开启自动刷新
+ V2XServiceManager.getV2XMarkerService().startAutoRefresh();
+ // 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
+ V2XServiceManager.getMapUIController().recoverLockMode();
+ }
+
+ private void handleSeekHelp(boolean isTrue) {
+ V2XMessageEntity entity = new V2XMessageEntity<>();
+ entity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP);
+ entity.setContent(isTrue);
+ V2XScenarioManager.getInstance().handlerMessage(entity);
+ }
+
+ @Override
+ public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
+ Logger.d(MODULE_NAME, "状态发生改变\ndescriptor:" + descriptor + "\nisTrue:" + isTrue);
+ // 记录状态更改
+ SharedPrefsMgr.getInstance(V2XUtils.getApp()).putBoolean("descriptor_" + descriptor, isTrue);
+ if (descriptor == StatusDescriptor.ACC_STATUS) {
+ if (isTrue) {
+ // 记录开机时间
+ FatigueDrivingUtils.refreshAccOnTime();
+ initCarForHelpStatus();
+ } else {
+ // 记录关机时间
+ SharedPrefsMgr.getInstance(V2XUtils.getApp())
+ .putString(V2XConst.V2X_ACC_OFF_TIME_STR, TimeUtils.getNowString());
+ }
+ } else if (descriptor == StatusDescriptor.SEEK_HELPING) {
+ handleSeekHelp(isTrue);
+ }
+ }
+
+ public boolean isAccOn() {
+ int accState = Settings.System.getInt(mContext.getContentResolver(), "mcu_state", -0x02);
+ Logger.d(MODULE_NAME, "状态发生改变\ndescriptor:ACC_STSTUS" + "\nisTrue:" + accState);
+ return accState == 1;
+ }
+
+ private void initCarForHelpStatus() {
+ //本地查询是否超时
+ V2XServiceManager.getV2XRefreshModel().getHelpSignal(new V2XRefreshCallback() {
+ @Override
+ public void onSuccess(V2XSeekHelpRes result) {
+ if (result != null) {
+ V2XSeekHelpRes.ResultBean resultBean = result.getResult();
+ if (resultBean != null) {
+ int vehicleType = resultBean.getVehicleType();
+ //故障车
+ if (vehicleType == 4) {
+ if (!V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
+ handleSeekHelp(true);
+ V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
+ }
+ } else {
+ if (V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
+ handleSeekHelp(false);
+ V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, false);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onFail(String msg) {
+
+ }
+ });
+ }
+
+ @Override
+ public void onMapLoaded() {
+ //初始化获得自车求助状态
+ initCarForHelpStatus();
+ }
+
+ @Override
+ public void onTouch(MotionEvent motionEvent) {
+
+ }
+
+ @Override
+ public void onPOIClick(MogoPoi poi) {
+
+ }
+
+ @Override
+ public void onMapClick(MogoLatLng latLng) {
+
+ }
+
+ @Override
+ public void onLockMap(boolean isLock) {
+
+ }
+
+ @Override
+ public void onMapModeChanged(EnumMapUI ui) {
+
+ }
+
+ @Override
+ public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
+
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java
new file mode 100644
index 0000000000..621b7bd291
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java
@@ -0,0 +1,246 @@
+package com.mogo.module.v2x;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.map.location.IMogoLocationClient;
+import com.mogo.map.marker.IMogoMarkerManager;
+import com.mogo.map.navi.IMogoNavi;
+import com.mogo.map.overlay.IMogoOverlayManager;
+import com.mogo.map.search.geo.IMogoGeoSearch;
+import com.mogo.map.uicontroller.IMogoMapUIController;
+import com.mogo.module.carchattingprovider.ICarsChattingProvider;
+import com.mogo.module.v2x.alarm.V2XCalculateServer;
+import com.mogo.module.v2x.network.V2XRefreshModel;
+import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
+import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
+import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.service.adas.IMogoADASController;
+import com.mogo.service.analytics.IMogoAnalytics;
+import com.mogo.service.connection.IMogoSocketManager;
+import com.mogo.service.entrance.IMogoEntranceButtonController;
+import com.mogo.service.imageloader.IMogoImageloader;
+import com.mogo.service.intent.IMogoIntentManager;
+import com.mogo.service.map.IMogoMapService;
+import com.mogo.service.module.IMogoActionManager;
+import com.mogo.service.module.IMogoMarkerService;
+import com.mogo.service.module.IMogoRegisterCenter;
+import com.mogo.service.module.IMogoSearchManager;
+import com.mogo.service.statusmanager.IMogoStatusManager;
+import com.mogo.service.strategy.IMogoRefreshStrategyController;
+import com.mogo.service.windowview.IMogoTopViewManager;
+import com.mogo.service.windowview.IMogoWindowManager;
+import com.zhidao.carchattingprovider.CallChattingProviderConstant;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-2114:01
+ * desc : V2X 服务
+ * version: 1.0
+ */
+public class V2XServiceManager {
+ private static final String TAG = "V2XServiceManager";
+ private static Context mContext;
+ private static IMogoServiceApis mMogoServiceApis;
+
+ private static IMogoMapService mMapService;
+ private static IMogoMarkerManager mMarkerManager;
+ private static IMogoNavi mNavi;
+ private static IMogoMapUIController mMapUIController;
+ private static IMogoLocationClient mMogoLocationClient;
+ private static IMogoGeoSearch mIMogoGeoSearch;
+ private static IMogoSearchManager mIMogoSearchManager;
+
+ private static IMogoTopViewManager mMogoTopViewManager;
+ private static IMogoStatusManager mMogoStatusManager;
+ private static IMogoWindowManager mIMogoWindowManager;
+ private static IMogoImageloader mImageLoader;
+ private static IMogoSocketManager mMogoSocketManager;
+ private static IMogoAnalytics mMogoAnalytics;
+ private static IMogoOverlayManager mMogoOverlayManager;
+ private static IMogoRegisterCenter mMogoRegisterCenter;
+ private static IMogoRefreshStrategyController mIMogoRefreshStrategyController;
+ private static IMogoMarkerService mIMogoMarkerService;
+
+ private static IMogoActionManager mMogoActionManager;
+ private static ICarsChattingProvider mCarsChattingProvider;
+ private static IMogoADASController mIMogoADASController;
+ private static IMogoIntentManager mMogoIntentManager;
+ private static IMogoEntranceButtonController mMogoEntranceButtonController;
+
+ private static V2XRefreshModel mV2XRefreshModel;
+ private static V2XMarkerService mV2XMarkerService;
+ private static V2XStatusManager mV2XStatusManager;
+ private static V2XSocketManager mV2XSocketManager;
+ private static V2XCalculateServer mV2XCalculateServer;
+
+
+ // 下面的是重构后的代码,建议
+ private static IMoGoV2XMarkerManager moGoV2XMarkerManager;
+ private static IMoGoV2XPolylineManager moGoV2XPolylineManager;
+ private static IMoGoV2XStatusManager moGoV2XStatusManager;
+
+
+ public static void init(final Context context) {
+ mContext = context;
+ mMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
+
+ mMapService = mMogoServiceApis.getMapServiceApi();
+ mImageLoader = mMogoServiceApis.getImageLoaderApi();
+ mMogoStatusManager = mMogoServiceApis.getStatusManagerApi();
+ mMogoSocketManager = mMogoServiceApis.getSocketManagerApi(context);
+ mMogoAnalytics = mMogoServiceApis.getAnalyticsApi();
+ mIMogoWindowManager = mMogoServiceApis.getWindowManagerApi();
+ mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi();
+ mIMogoRefreshStrategyController = mMogoServiceApis.getRefreshStrategyControllerApi();
+ mIMogoADASController = mMogoServiceApis.getAdasControllerApi();
+ mMogoEntranceButtonController = mMogoServiceApis.getEntranceButtonController();
+ mMogoActionManager = mMogoServiceApis.getActionManagerApi();
+ mMogoTopViewManager = mMogoServiceApis.getTopViewManager();
+ mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi();
+ mIMogoMarkerService = mMogoServiceApis.getMarkerService();
+
+ mMarkerManager = mMapService.getMarkerManager(context);
+ mNavi = mMapService.getNavi(context);
+ mMapUIController = mMapService.getMapUIController();
+ mMogoLocationClient = mMapService.getSingletonLocationClient(context);
+ mMogoOverlayManager = mMapService.getOverlayManager(context);
+ mIMogoGeoSearch = mMapService.getGeoSearch(context);
+
+ mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
+ mMogoIntentManager = mMogoServiceApis.getIntentManagerApi();
+
+ mV2XRefreshModel = V2XRefreshModel.getInstance(context);
+ mV2XMarkerService = V2XMarkerService.getInstance(context);
+ mV2XStatusManager = V2XStatusManager.getInstance();
+ mV2XSocketManager = V2XSocketManager.getInstance();
+ mV2XCalculateServer = V2XCalculateServer.getInstance();
+
+ moGoV2XMarkerManager = (IMoGoV2XMarkerManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER).navigation(context);
+ moGoV2XPolylineManager = (IMoGoV2XPolylineManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER).navigation(context);
+ moGoV2XStatusManager = (IMoGoV2XStatusManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER).navigation(context);
+ }
+
+ public static Context getContext() {
+ return mContext;
+ }
+
+ public static IMogoTopViewManager getMogoTopViewManager() {
+ return mMogoTopViewManager;
+ }
+
+ public static IMogoEntranceButtonController getMogoEntranceButtonController() {
+ return mMogoEntranceButtonController;
+ }
+
+ public static IMogoMapService getMapService() {
+ return mMapService;
+ }
+
+ public static IMogoOverlayManager getMogoOverlayManager() {
+ return mMogoOverlayManager;
+ }
+
+ public static IMogoRegisterCenter getMogoRegisterCenter() {
+ return mMogoRegisterCenter;
+ }
+
+ public static IMogoMarkerManager getMarkerManager() {
+ return mMarkerManager;
+ }
+
+ public static IMogoNavi getNavi() {
+ return mNavi;
+ }
+
+ public static IMogoMapUIController getMapUIController() {
+ return mMapUIController;
+ }
+
+ public static IMogoLocationClient getMogoLocationClient() {
+ return mMogoLocationClient;
+ }
+
+ public static IMogoImageloader getImageLoader() {
+ return mImageLoader;
+ }
+
+ public static IMogoSocketManager getMoGoSocketManager() {
+ return mMogoSocketManager;
+ }
+
+ public static IMogoStatusManager getMoGoStatusManager() {
+ return mMogoStatusManager;
+ }
+
+ public static IMogoWindowManager getIMogoWindowManager() {
+ return mIMogoWindowManager;
+ }
+
+ public static ICarsChattingProvider getCarsChattingProvider() {
+ return mCarsChattingProvider;
+ }
+
+ public static IMogoIntentManager getMogoIntentManager() {
+ return mMogoIntentManager;
+ }
+
+ public static V2XMarkerService getV2XMarkerService() {
+ return mV2XMarkerService;
+ }
+
+ public static V2XRefreshModel getV2XRefreshModel() {
+ return mV2XRefreshModel;
+ }
+
+ public static V2XStatusManager getV2XStatusManager() {
+ return mV2XStatusManager;
+ }
+
+ public static V2XSocketManager getV2XSocketManager() {
+ return mV2XSocketManager;
+ }
+
+ public static IMoGoV2XMarkerManager getMoGoV2XMarkerManager() {
+ return moGoV2XMarkerManager;
+ }
+
+ public static IMoGoV2XPolylineManager getMoGoV2XPolylineManager() {
+ return moGoV2XPolylineManager;
+ }
+
+ public static IMoGoV2XStatusManager getMoGoV2XStatusManager() {
+ return moGoV2XStatusManager;
+ }
+
+ public static IMogoActionManager getMogoActionManager() {
+ return mMogoActionManager;
+ }
+
+ public static IMogoGeoSearch getMogoGeoSearch() {
+ return mIMogoGeoSearch;
+ }
+
+ public static IMogoSearchManager getSearchManager() {
+ return mIMogoSearchManager;
+ }
+
+ public static IMogoRefreshStrategyController getIMogoRefreshStrategyController() {
+ return mIMogoRefreshStrategyController;
+ }
+
+ public static IMogoAnalytics getMogoAnalytics() {
+ return mMogoAnalytics;
+ }
+
+ public static IMogoMarkerService getIMogoMarkerService() {
+ return mIMogoMarkerService;
+ }
+
+ public static V2XCalculateServer getV2XCalculateServer() {
+ return mV2XCalculateServer;
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XSocketManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XSocketManager.java
new file mode 100644
index 0000000000..c6163caa39
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XSocketManager.java
@@ -0,0 +1,209 @@
+package com.mogo.module.v2x;
+
+import com.mogo.module.v2x.listener.V2XMessageListener_401003;
+import com.mogo.module.v2x.listener.V2XMessageListener_401005;
+import com.mogo.module.v2x.listener.V2XMessageListener_401006;
+import com.mogo.module.v2x.listener.V2XMessageListener_401007;
+import com.mogo.module.v2x.listener.V2XMessageListener_401009;
+import com.mogo.module.v2x.listener.V2XMessageListener_401010;
+import com.mogo.module.v2x.listener.V2XMessageListener_401011;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/31 5:59 PM
+ * desc : V2X报警事件管理,这里进行报警事件的分发处理,TODO 这里是准备重构使用的
+ * version: 1.0
+ */
+public class V2XSocketManager {
+
+ private static V2XSocketManager mV2XSocketManager;
+
+ private V2XMessageListener_401011 v2XMessageListener_401001;
+ private V2XMessageListener_401003 v2XMessageListener_401003;
+ private V2XMessageListener_401005 v2XMessageListener_401005;
+ private V2XMessageListener_401006 v2XMessageListener_401006;
+ private V2XMessageListener_401007 v2XMessageListener_401007;
+ private V2XMessageListener_401009 v2XMessageListener_401009;
+ private V2XMessageListener_401010 v2XMessageListener_401010;
+
+
+ private V2XSocketManager() {
+ }
+
+ /**
+ * 获取操作实体
+ */
+ public static synchronized V2XSocketManager getInstance() {
+ synchronized (V2XSocketManager.class) {
+ if (mV2XSocketManager == null) {
+ mV2XSocketManager = new V2XSocketManager();
+ }
+ }
+ return mV2XSocketManager;
+ }
+
+ /**
+ * 注册长链接消息处理
+ */
+ public void registerSocketMessage() {
+ Logger.d(MODULE_NAME, "开始注册Socket通道....");
+ register401011();
+ register401005();
+ register401007();
+ register401009();
+ // TODO 这里是前瞻需求,量产版本需要注释
+ //register401003();
+ // TODO 旧版本的一种V2X预警形式,已经废弃了
+ //register401006();
+ }
+
+ /**
+ * 反注册消息通道,不再进行接受
+ */
+ public void unregisterSocketMessage() {
+ Logger.w(MODULE_NAME, "反注册Socket通道....");
+ if (v2XMessageListener_401001 != null) {
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .unregisterOnMessageListener(401011, v2XMessageListener_401001);
+ }
+ if (v2XMessageListener_401003 != null) {
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .unregisterOnMessageListener(401003, v2XMessageListener_401003);
+ }
+ if (v2XMessageListener_401005 != null) {
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .unregisterOnMessageListener(401005, v2XMessageListener_401005);
+ }
+ if (v2XMessageListener_401006 != null) {
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .unregisterOnMessageListener(401006, v2XMessageListener_401006);
+ }
+ if (v2XMessageListener_401007 != null) {
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .unregisterOnMessageListener(401007, v2XMessageListener_401007);
+ }
+ if (v2XMessageListener_401009 != null) {
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .unregisterOnMessageListener(401009, v2XMessageListener_401009);
+ }
+ }
+
+ /**
+ * 道路事件,在线车辆绘制
+ */
+ private void register401011() {
+ v2XMessageListener_401001 = new V2XMessageListener_401011();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401011,
+ v2XMessageListener_401001
+ );
+ }
+
+ /**
+ * ADAS & V2X 场景触发push
+ * TODO 这里是后台下发 http://h5service.zhidaohulian.com/v2x_remoteControl/#/
+ */
+ private void register401003() {
+ v2XMessageListener_401003 = new V2XMessageListener_401003();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401003,
+ v2XMessageListener_401003
+ );
+ }
+
+ /**
+ * 特殊车辆推送绘制
+ */
+ private void register401005() {
+ v2XMessageListener_401005 = new V2XMessageListener_401005();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401005,
+ v2XMessageListener_401005
+ );
+ }
+
+ /**
+ * * 3.2.1、前方静止or慢速车辆报警
+ * * 3.2.2、道路危险状况告警 / 前方拥堵告警
+ */
+ @Deprecated
+ private void register401006() {
+ v2XMessageListener_401006 = new V2XMessageListener_401006();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401006,
+ v2XMessageListener_401006
+ );
+ }
+
+ /**
+ * 限行通知
+ */
+ private void register401007() {
+ v2XMessageListener_401007 = new V2XMessageListener_401007();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401007,
+ v2XMessageListener_401007
+ );
+ }
+
+ /**
+ * * 2.0.2
+ * * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=35786774
+ * * 注册点赞通信接收
+ */
+ public void register401009() {
+ v2XMessageListener_401009 = new V2XMessageListener_401009();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401009,
+ v2XMessageListener_401009
+ );
+ }
+
+
+ /**
+ * * 2.0.3
+ * * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=35788659
+ * * TODO 停车场、加油站推送心跳,这里是前瞻的功能,目前仅在分体机使用,
+ */
+ @Deprecated
+ private void register401010() {
+ v2XMessageListener_401010 = new V2XMessageListener_401010();
+ // 道路事件,在线车辆绘制
+ V2XServiceManager
+ .getMoGoSocketManager()
+ .registerOnMessageListener(
+ 401010,
+ v2XMessageListener_401010
+ );
+ }
+
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XStatusManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XStatusManager.java
new file mode 100644
index 0000000000..12396a786e
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XStatusManager.java
@@ -0,0 +1,62 @@
+package com.mogo.module.v2x;
+
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.location.MogoLocation;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/3 2:34 PM
+ * desc : V2X状态管理
+ * version: 1.0
+ */
+@Deprecated
+public class V2XStatusManager {
+ private static V2XStatusManager mV2XStatusManager;
+ // 正在进行的告警事件详情
+ private V2XRoadEventEntity mAlarmInfo;
+
+ private MogoLocation mLocation;
+
+ private V2XStatusManager() {
+ }
+
+ /**
+ * 获取操作实体
+ */
+ public static synchronized V2XStatusManager getInstance() {
+ synchronized (V2XStatusManager.class) {
+ if (mV2XStatusManager == null) {
+ mV2XStatusManager = new V2XStatusManager();
+ }
+ }
+ return mV2XStatusManager;
+ }
+
+ public void setAlarmInfo(V2XRoadEventEntity eventEntity) {
+ this.mAlarmInfo = eventEntity;
+ }
+
+ // 获取目标事件经纬度
+ public MogoLatLng getTargetMoGoLatLng() {
+ if (mAlarmInfo != null) {
+ return new MogoLatLng(
+ mAlarmInfo.getLocation().getLat(),
+ mAlarmInfo.getLocation().getLon()
+ );
+ }
+ return null;
+ }
+
+ public MogoLocation getLocation() {
+ if (mLocation == null) {
+ mLocation = new MogoLocation();
+ }
+ return mLocation;
+ }
+
+ public void setLocation(MogoLocation mLocation) {
+ this.mLocation = mLocation;
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XPushEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XPushEventAdapter.java
new file mode 100644
index 0000000000..3dae739ced
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XPushEventAdapter.java
@@ -0,0 +1,49 @@
+package com.mogo.module.v2x.adapter;
+
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.mogo.module.v2x.adapter.holder.V2XPushEventDetailVH;
+import com.mogo.module.common.entity.V2XPushMessageEntity;
+
+import java.util.List;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:05 PM
+ * desc : V2X 场景事件列表中的数据适配器
+ * version: 1.0
+ */
+public class V2XPushEventAdapter extends RecyclerView.Adapter {
+
+ private List itemList;
+
+ public V2XPushEventAdapter(List itemList) {
+ this.itemList = itemList;
+ }
+
+ @NonNull
+ @Override
+ public V2XPushEventDetailVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ return new V2XPushEventDetailVH(parent);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull V2XPushEventDetailVH holder, int position) {
+ holder.initView(itemList.get(position));
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return itemList.get(position).getViewType();
+ }
+
+ @Override
+ public int getItemCount() {
+ return itemList == null ? 0 : itemList.size();
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java
new file mode 100644
index 0000000000..5988112df7
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java
@@ -0,0 +1,67 @@
+package com.mogo.module.v2x.adapter;
+
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.mogo.module.common.entity.V2XEventShowEntity;
+import com.mogo.module.v2x.adapter.holder.V2XLiveVideoVH;
+import com.mogo.module.v2x.adapter.holder.V2XRoadEventDetailVH;
+import com.mogo.module.common.entity.V2XWindowTypeEnum;
+
+import java.util.List;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:05 PM
+ * desc : V2X 场景事件列表中的数据适配器
+ * version: 1.0
+ */
+public class V2XRoadEventAdapter extends RecyclerView.Adapter {
+
+ private List itemList;
+
+ public V2XRoadEventAdapter(List itemList) {
+ this.itemList = itemList;
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ RecyclerView.ViewHolder holder;
+ switch (viewType) {
+ case V2XWindowTypeEnum.LIVE_CAR_WINDOW:
+ holder = new V2XLiveVideoVH(parent);
+ break;
+ case V2XWindowTypeEnum.ROAD_EVENT_WINDOW:
+ holder = new V2XRoadEventDetailVH(parent);
+ break;
+ default:
+ holder = new V2XRoadEventDetailVH(parent);
+ }
+ return holder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ if (holder instanceof V2XLiveVideoVH) {
+ ((V2XLiveVideoVH) holder).initView(itemList.get(position));
+ }
+ if (holder instanceof V2XRoadEventDetailVH) {
+ ((V2XRoadEventDetailVH) holder).initView(itemList.get(position));
+ }
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return itemList.get(position).getViewType();
+ }
+
+ @Override
+ public int getItemCount() {
+ return itemList == null ? 0 : itemList.size();
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSeekHelpAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSeekHelpAdapter.java
new file mode 100644
index 0000000000..f1d36a428f
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSeekHelpAdapter.java
@@ -0,0 +1,224 @@
+package com.mogo.module.v2x.adapter;
+
+import android.content.Context;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.mogo.module.carchattingprovider.ICarsChattingProvider;
+import com.mogo.module.v2x.R;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
+import com.mogo.module.v2x.utils.ChartingUtil;
+import com.mogo.module.v2x.utils.SpanUtils;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.service.imageloader.MogoImageView;
+import com.mogo.utils.logger.Logger;
+import com.zhidao.carchattingprovider.ICallChatResponse;
+
+import org.jetbrains.annotations.Nullable;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+import static android.view.View.GONE;
+import static android.view.View.VISIBLE;
+
+/**
+ * author : fenghualong
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:05 PM
+ * desc : V2X 其他车辆发起的故障求助
+ * version: 1.0
+ */
+public class V2XSeekHelpAdapter extends RecyclerView.Adapter {
+ private static final String TAG = V2XSeekHelpAdapter.class.getSimpleName();
+ private List itemList;
+ private LayoutInflater mInflater;
+
+ public V2XSeekHelpAdapter(Context context) {
+ itemList = new ArrayList<>();
+ mInflater = LayoutInflater.from(context);
+ }
+
+ public void addDataList(List list) {
+ if (itemList == null) {
+ itemList = new ArrayList<>();
+ }
+ itemList.addAll(list);
+ }
+
+ public void addData(V2XMarkerEntity entity) {
+ if (itemList == null) {
+ itemList = new ArrayList<>();
+ }
+ itemList.add(entity);
+ }
+
+ public void removeData(V2XMarkerEntity entity) {
+ if (itemList != null) {
+ itemList.remove(entity);
+ }
+ }
+
+ public void removeData(int position) {
+ if (isPositionValid(position)) {
+ itemList.remove(position);
+ }
+ }
+
+ public void clearData() {
+ if (itemList != null) {
+ itemList.clear();
+ }
+ }
+
+ public boolean isPositionValid(int position) {
+ return position > -1 && itemList != null && itemList.size() > position;
+ }
+
+ @NonNull
+ @Override
+ public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = mInflater.inflate(R.layout.item_v2x_fault_help, parent, false);
+ return new MyViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
+ if (isPositionValid(position)) {
+ V2XMarkerEntity entity = itemList.get(position);
+ if (entity != null) {
+ V2XMarkerEntity.UserInfoBean infoBean = entity.getUserInfo();
+ if (infoBean != null) {
+ long time = entity.getCreateTime();
+ SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
+ String eventDistance = String.format("%d", entity.getDistance());
+ String eventTime = String.format("%s发布求助信息", sdf.format(new Date(time)));
+ holder.initView(infoBean.getHeadImgUrl(), infoBean.getDisplayName(), eventDistance, eventTime);
+ }
+ }
+ Log.d(TAG, "onBindViewHolder position=$position, entity= " + entity);
+ setCallData(holder.ivCall, entity);
+ //setCallDataWait(holder.ivCall, entity);
+ holder.ivNavi.setOnClickListener(v -> {
+ if (mListener != null && !V2XUtils.isFastClick()) {
+
+ mListener.onViewNaviClick(entity.getLat(), entity.getLon());
+ }
+ });
+ }
+ }
+
+ private void setCallData(ImageView ivCall, V2XMarkerEntity entity) {
+ ICarsChattingProvider provider = V2XServiceManager.getCarsChattingProvider();
+ // 判断是否可以打电话
+ ChartingUtil.isCanCall(b -> {
+ if (b) {
+ // 判断是否可以打电话
+ ChartingUtil.isOnLine(entity.getSn(), b1 -> {
+ if (b1) {
+ ivCall.setVisibility(VISIBLE);
+ } else {
+ ivCall.setVisibility(GONE);
+ }
+ });
+ } else {
+ ivCall.setVisibility(GONE);
+ }
+ });
+ ivCall.setOnClickListener(v -> {
+ if (!V2XUtils.isFastClick()) {
+ provider.isOnLine(V2XConst.MODULE_NAME, ivCall.getContext(), entity.getSn(), new ICallChatResponse() {
+ @Override
+ public void isOnLine(boolean isOnline, @Nullable String s) {
+ provider.canCall(V2XConst.MODULE_NAME, ivCall.getContext(), new ICallChatResponse() {
+ @Override
+ public void canCall(boolean canCall) {
+ Logger.d(TAG, "调用车聊聊,查询状态! SN=" + entity.getSn() + " is online: " + isOnline + " canCall: " + canCall + ", thread: " + Thread.currentThread().getName());
+ V2XUtils.runOnUiThread(() -> {
+ if (mListener != null && isOnline && canCall) {
+ mListener.onViewChatClick(entity);
+ }
+ });
+
+ }
+ });
+ }
+ }
+ );
+ }
+ });
+ }
+
+ @Override
+ public int getItemCount() {
+ return itemList != null ? itemList.size() : 0;
+ }
+
+ static class MyViewHolder extends RecyclerView.ViewHolder {
+ MogoImageView ivHead;
+ TextView tvName;
+ TextView tvDistance;
+ TextView tvEventTime;
+ ImageView ivCall;
+ ImageView ivNavi;
+
+ MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ ivHead = itemView.findViewById(R.id.ivFaultHelpHead);
+ tvName = itemView.findViewById(R.id.tvFaultHelpName);
+ tvDistance = itemView.findViewById(R.id.tvFaultHelpDistance);
+ tvEventTime = itemView.findViewById(R.id.tvFaultHelpEventTime);
+ ivCall = itemView.findViewById(R.id.ivFaultHelpEventCall);
+ ivNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
+ }
+
+ void initView(String headUrl, String name, String distance, String eventTime) {
+ if (!TextUtils.isEmpty(headUrl)) {
+ V2XServiceManager.getImageLoader()
+ .displayImage(headUrl, ivHead);
+ }
+ tvName.setText(name);
+ tvDistance.setText(distance);
+ SpanUtils.with(tvDistance)
+ .append("" + distance)
+ .setFontSize((int) tvDistance.getResources().getDimension(R.dimen.dp_80))
+ .append("M")
+ .setFontSize((int) tvDistance.getResources().getDimension(R.dimen.dp_30))
+ .create();
+ tvEventTime.setText(eventTime);
+ }
+ }
+
+ private OnViewClickListener mListener;
+
+ public void setOnViewClickListener(OnViewClickListener listener) {
+ mListener = listener;
+ }
+
+ public interface OnViewClickListener {
+ /**
+ * 点击事件,打电话给车聊聊
+ *
+ * @param entity
+ */
+ void onViewChatClick(V2XMarkerEntity entity);
+
+ /**
+ * 点击事件,导航去故障车位置
+ */
+ void onViewNaviClick(double lat, double lng);
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java
new file mode 100644
index 0000000000..50f87a3f4f
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java
@@ -0,0 +1,202 @@
+package com.mogo.module.v2x.adapter.holder;
+
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.mogo.commons.voice.AIAssist;
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.navi.IMogoNaviListener;
+import com.mogo.map.navi.MogoNaviInfo;
+import com.mogo.map.navi.MogoTraffic;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.utils.ChartingUtil;
+import com.mogo.module.v2x.utils.RoadConditionUtils;
+import com.mogo.module.v2x.utils.TrackUtils;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.utils.TipToast;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * V2X展示视图公用的实现
+ *
+ * @author donghongyu
+ */
+public abstract class V2XBaseViewHolder
+ extends RecyclerView.ViewHolder
+ implements IMogoNaviListener {
+
+ public V2XBaseViewHolder(@NonNull View itemView) {
+ super(itemView);
+ }
+
+ /**
+ * 延迟关闭窗体视图
+ */
+ public abstract void delayedCloseWindow();
+
+ /**
+ * 点赞
+ */
+ public void triggerZan(MarkerExploreWay noveltyInfo) {
+ try {
+ AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已点赞", null);
+ showTip("已点赞");
+ if (noveltyInfo != null) {
+ V2XServiceManager.getV2XMarkerService()
+ .getV2XRefreshModel()
+ .giveLikeLiveVideo(null, noveltyInfo.getSn());
+
+ TrackUtils.trackV2xRoadEvent(
+ noveltyInfo.getInfoId(),
+ noveltyInfo.getSn(),
+ V2XConst.V2X_ROAD_ZAN);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ delayedCloseWindow();
+ }
+
+ /**
+ * 打电话
+ */
+ public void triggerCallChart(MarkerExploreWay noveltyInfo) {
+ try {
+ MarkerLocation location = new MarkerLocation();
+ location.setLat(noveltyInfo.getLocation().getLat());
+ location.setLon(noveltyInfo.getLocation().getLon());
+
+ ChartingUtil.callChatting(noveltyInfo.getUserInfo(), location);
+
+ TrackUtils.trackV2xRoadEvent(
+ noveltyInfo.getInfoId(),
+ noveltyInfo.getSn(),
+ V2XConst.V2X_ROAD_CHAT);
+ } catch (Exception e) {
+ e.printStackTrace();
+ TipToast.tip("用户信息异常");
+ }
+ delayedCloseWindow();
+ }
+
+ /**
+ * 反馈路况错误
+ */
+ public void triggerReportErr(MarkerExploreWay noveltyInfo) {
+ try {
+ RoadConditionUtils.sendDataErrorReceiverInfo(
+ noveltyInfo.getPoiType(),
+ noveltyInfo.getInfoId(),
+ "1");
+
+ TrackUtils.trackV2xRoadEvent(
+ noveltyInfo.getInfoId(),
+ noveltyInfo.getSn(),
+ V2XConst.V2X_ROAD_REPORT_ERROR);
+ } catch (Exception e) {
+ e.printStackTrace();
+ TipToast.tip("路况信息异常");
+ }
+ delayedCloseWindow();
+ }
+
+ /**
+ * 反馈路况正确
+ */
+ public void triggerReportTrue(MarkerExploreWay noveltyInfo) {
+ try {
+ RoadConditionUtils.sendDataErrorReceiverInfo(
+ noveltyInfo.getPoiType(),
+ noveltyInfo.getInfoId(),
+ "2");
+
+ TrackUtils.trackV2xRoadEvent(
+ noveltyInfo.getInfoId(),
+ noveltyInfo.getSn(),
+ V2XConst.V2X_ROAD_REPORT_RIGHT);
+ } catch (Exception e) {
+ e.printStackTrace();
+ TipToast.tip("路况信息异常");
+ }
+ delayedCloseWindow();
+ }
+
+ /**
+ * 导航规划路线
+ */
+ public void triggerStartNavi(MarkerExploreWay noveltyInfo) {
+ try {
+ MogoLatLng endPoint = new MogoLatLng(
+ noveltyInfo.getLocation().getLat(),
+ noveltyInfo.getLocation().getLon());
+
+ V2XServiceManager.getNavi().naviTo(endPoint);
+ V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener(MODULE_NAME);
+ V2XServiceManager.getMogoRegisterCenter().registerMogoNaviListener(MODULE_NAME, this);
+
+ TrackUtils.trackV2xRoadEvent(
+ noveltyInfo.getInfoId(),
+ noveltyInfo.getSn(),
+ V2XConst.V2X_ROAD_NAVI);
+ } catch (Exception e) {
+ e.printStackTrace();
+ TipToast.tip("路况信息异常");
+ }
+ delayedCloseWindow();
+ }
+
+ /**
+ * 显示自定义 Toast
+ *
+ * @param msg
+ */
+ public void showTip(String msg) {
+ TipToast.tip(msg);
+ }
+
+ @Override
+ public void onInitNaviFailure() {
+
+ }
+
+ @Override
+ public void onInitNaviSuccess() {
+
+ }
+
+ @Override
+ public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
+
+ }
+
+ @Override
+ public void onStartNavi() {
+
+ }
+
+ @Override
+ public void onStopNavi() {
+
+ }
+
+ @Override
+ public void onCalculateSuccess() {
+ V2XServiceManager.getNavi().startNavi(true);
+ }
+
+ @Override
+ public void onoCalculateFailed() {
+
+ }
+
+ @Override
+ public void onUpdateTraffic(MogoTraffic traffic) {
+
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XLiveVideoVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XLiveVideoVH.java
new file mode 100644
index 0000000000..61dafb34ce
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XLiveVideoVH.java
@@ -0,0 +1,63 @@
+package com.mogo.module.v2x.adapter.holder;
+
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+
+import com.mogo.module.common.entity.MarkerCarInfo;
+import com.mogo.module.common.entity.MarkerUserInfo;
+import com.mogo.module.common.entity.V2XEventShowEntity;
+import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.v2x.R;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
+import com.mogo.module.v2x.utils.TrackUtils;
+import com.mogo.module.v2x.view.V2XLiveGSYVideoView;
+import com.mogo.service.imageloader.MogoImageView;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:35 PM
+ * desc : 直播类型的卡片
+ * version: 1.0
+ */
+public class V2XLiveVideoVH extends V2XBaseViewHolder {
+
+ private V2XLiveGSYVideoView videoPlayer;
+ private MogoImageView ivReportHead;
+
+ // 上传事件的用户信息
+ private MarkerUserInfo mUserInfo = new MarkerUserInfo();
+ // 直播车机数据
+ private V2XLiveCarInfoEntity mV2XLiveCarEntity;
+ // 预警的道路事件数据
+ private V2XRoadEventEntity mV2XRoadEventEntity;
+
+ public V2XLiveVideoVH(ViewGroup viewGroup) {
+ super(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_live_video, viewGroup, false));
+ videoPlayer = itemView.findViewById(R.id.videoPlayer);
+ ivReportHead = itemView.findViewById(R.id.ivReportHead);
+ }
+
+ public void initView(V2XEventShowEntity v2XLiveCarEntity) {
+ mV2XRoadEventEntity = v2XLiveCarEntity.getV2XRoadEventEntity();
+ mV2XLiveCarEntity = v2XLiveCarEntity.getV2XLiveCarInfoRes();
+ initView(mV2XLiveCarEntity);
+ }
+
+ public void initView(V2XLiveCarInfoEntity v2XLiveCarEntity) {
+ mV2XLiveCarEntity = v2XLiveCarEntity;
+ // 由于车机自身推流的原因,这里为了浪费用户不必要的流量,用户滑动到了那个view展示了再进行直播信息的获取及展示
+ MarkerCarInfo.CarLiveInfo carLiveInfo = new MarkerCarInfo.CarLiveInfo();
+ carLiveInfo.setVideoSn(v2XLiveCarEntity.getSn());
+ videoPlayer.setCarLiveInfo(carLiveInfo);
+ TrackUtils.trackV2xRoadEvent(mV2XRoadEventEntity.getNoveltyInfo().getInfoId(), v2XLiveCarEntity.getSn(), V2XConst.V2X_ROAD_VIDEO);
+ }
+
+ @Override
+ public void delayedCloseWindow() {
+ ivReportHead.postDelayed(() -> V2XRoadEventScenario.getInstance().close(), 2000);
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XPushEventDetailVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XPushEventDetailVH.java
new file mode 100644
index 0000000000..c7d4ee87bf
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XPushEventDetailVH.java
@@ -0,0 +1,183 @@
+package com.mogo.module.v2x.adapter.holder;
+
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.common.entity.MarkerUserInfo;
+import com.mogo.module.common.entity.V2XPushMessageEntity;
+import com.mogo.module.v2x.R;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
+import com.mogo.module.v2x.utils.ChartingUtil;
+import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
+import com.mogo.module.v2x.voice.V2XVoiceConstants;
+import com.mogo.module.v2x.voice.V2XVoiceManager;
+import com.mogo.service.imageloader.MogoImageView;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:35 PM
+ * desc : TODO 这里是前瞻演示需求,推送的消息,
+ * version: 1.0
+ */
+public class V2XPushEventDetailVH extends V2XBaseViewHolder {
+ private MogoImageView ivImg;
+ private MogoImageView ivReportHead;
+
+ // 控制按钮
+ private ImageView ivRoadReportTrue;
+ private ImageView ivRoadReportErr;
+ private ImageView ivRoadCallChart;
+ private ImageView ivRoadEventNav;
+ private ImageView ivRoadEventLike;
+
+ // 上传事件的用户信息
+ private MarkerUserInfo mUserInfo = new MarkerUserInfo();
+
+ private V2XPushMessageEntity mV2XRoadEventEntity;
+ private MarkerExploreWay mNoveltyInfo;
+
+ // 语音控制导航
+ private V2XVoiceCallbackListener mNaviCb = (command, intent) -> triggerStartNavi(mNoveltyInfo);
+ // 语音控制拨打电话
+ private V2XVoiceCallbackListener mCallChartingCb = (command, intent) -> {
+ try {
+ mUserInfo.setSn(mV2XRoadEventEntity.getSn());
+ mUserInfo.setUserHead(mV2XRoadEventEntity.getHeadImgUrl());
+ mUserInfo.setUserName("蘑菇用户");
+ mUserInfo.setGender("男");
+ mUserInfo.setAge(30);
+ triggerCallChart(mNoveltyInfo);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ };
+ // 点赞语音回调
+ private V2XVoiceCallbackListener v2XVoiceCallbackLickListener = (command, intent) -> triggerZan(mNoveltyInfo);
+
+ public V2XPushEventDetailVH(ViewGroup viewGroup) {
+ super(LayoutInflater.from(viewGroup.getContext())
+ .inflate(R.layout.item_v2x_push_event_detail, viewGroup, false));
+ ivImg = itemView.findViewById(R.id.ivImg);
+ ivReportHead = itemView.findViewById(R.id.ivReportHead);
+
+ ivRoadReportTrue = itemView.findViewById(R.id.ivRoadReportTrue);
+ ivRoadReportErr = itemView.findViewById(R.id.ivRoadReportErr);
+ ivRoadCallChart = itemView.findViewById(R.id.ivRoadCallChart);
+ ivRoadEventNav = itemView.findViewById(R.id.ivRoadEventNav);
+ ivRoadEventLike = itemView.findViewById(R.id.ivRoadEventLike);
+
+ ivRoadEventNav.getParent().getParent().requestDisallowInterceptTouchEvent(true);
+ ivRoadEventNav.setOnClickListener(v -> triggerStartNavi(mNoveltyInfo));
+ ivRoadCallChart.setOnClickListener(v -> {
+ try {
+ mUserInfo.setSn(mV2XRoadEventEntity.getSn());
+ mUserInfo.setUserHead(mV2XRoadEventEntity.getHeadImgUrl());
+ mUserInfo.setUserName("蘑菇用户");
+ mUserInfo.setGender("男");
+ mUserInfo.setAge(30);
+ triggerCallChart(mNoveltyInfo);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ });
+ ivRoadEventLike.setOnClickListener(v -> triggerZan(mNoveltyInfo));
+
+ // 设置视图状态监听
+ itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
+ @Override
+ public void onViewAttachedToWindow(View v) {
+ //Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewAttachedToWindow");
+ // 注册语音交互
+ V2XVoiceManager.INSTANCE
+ .registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI,
+ mNaviCb)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP,
+ mNaviCb)
+ .registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING,
+ mCallChartingCb)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP,
+ mCallChartingCb)
+ .registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ZAN,
+ v2XVoiceCallbackLickListener)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_ZAN_UN_WAKEUP,
+ v2XVoiceCallbackLickListener);
+ }
+
+ @Override
+ public void onViewDetachedFromWindow(View v) {
+ //Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewDetachedFromWindow");
+ V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener(MODULE_NAME);
+ // 反注册语音交互
+ V2XVoiceManager.INSTANCE
+ .unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CLOSE_WINDOW)
+ .unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP)
+ .unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING)
+ .unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ZAN)
+ .unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_REPORT)
+ .unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP)
+ .unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_ZAN_UN_WAKEUP)
+ .unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_TRUE)
+ .unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_ERROR)
+ .unRegisterPagingCallback();
+ }
+ });
+ }
+
+ public void initView(V2XPushMessageEntity v2XRoadEventEntity) {
+ mV2XRoadEventEntity = v2XRoadEventEntity;
+ mNoveltyInfo = new MarkerExploreWay();
+ mNoveltyInfo.setSn(mV2XRoadEventEntity.getSn());
+ mNoveltyInfo.setInfoId(mV2XRoadEventEntity.getSceneId());
+ MarkerLocation location = new MarkerLocation();
+ location.setLat(mV2XRoadEventEntity.getLat());
+ location.setLon(mV2XRoadEventEntity.getLon());
+ mNoveltyInfo.setLocation(location);
+
+ if (!TextUtils.isEmpty(v2XRoadEventEntity.getMsgImgUrl())) {
+ V2XServiceManager.getImageLoader()
+ .displayImage(v2XRoadEventEntity.getMsgImgUrl(), ivImg);
+ }
+ if (!TextUtils.isEmpty(v2XRoadEventEntity.getHeadImgUrl())) {
+ V2XServiceManager.getImageLoader()
+ .displayImage(v2XRoadEventEntity.getHeadImgUrl(), ivReportHead);
+ }
+
+ switch (v2XRoadEventEntity.getSceneId()) {
+ case "100015"://取快递
+ case "100016"://顺风车
+ ivRoadEventNav.setVisibility(View.VISIBLE);
+ ivRoadCallChart.setVisibility(View.VISIBLE);
+ ivRoadReportTrue.setVisibility(View.GONE);
+ ivRoadReportErr.setVisibility(View.GONE);
+ ivRoadEventLike.setVisibility(View.GONE);
+ break;
+
+ case "100017"://政府公告
+ ivRoadEventLike.setVisibility(View.VISIBLE);
+ ivRoadCallChart.setVisibility(View.GONE);
+ ivRoadEventNav.setVisibility(View.GONE);
+ ivRoadReportTrue.setVisibility(View.GONE);
+ ivRoadReportErr.setVisibility(View.GONE);
+ break;
+ }
+ }
+
+ /**
+ * 延迟关闭窗体
+ */
+ @Override
+ public void delayedCloseWindow() {
+ itemView.postDelayed(() -> V2XPushEventScenario.getInstance().close(), 1000);
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java
new file mode 100644
index 0000000000..d3724def78
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java
@@ -0,0 +1,364 @@
+package com.mogo.module.v2x.adapter.holder;
+
+import android.content.Intent;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerUserInfo;
+import com.mogo.module.common.entity.V2XEventShowEntity;
+import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.common.entity.V2XWindowTypeEnum;
+import com.mogo.module.v2x.R;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
+import com.mogo.module.v2x.network.V2XRefreshCallback;
+import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarScenario;
+import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
+import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventWindow;
+import com.mogo.module.v2x.utils.ChartingUtil;
+import com.mogo.module.v2x.utils.EventTypeUtils;
+import com.mogo.module.v2x.utils.SpanUtils;
+import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
+import com.mogo.module.v2x.voice.V2XVoiceConstants;
+import com.mogo.module.v2x.voice.V2XVoiceManager;
+import com.mogo.service.imageloader.MogoImageView;
+import com.mogo.utils.ArrayUtils;
+import com.mogo.utils.DateTimeUtils;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
+import static android.view.View.GONE;
+import static android.view.View.VISIBLE;
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:35 PM
+ * desc : 道路事件详情
+ * version: 1.0
+ */
+public class V2XRoadEventDetailVH extends V2XBaseViewHolder {
+ private MogoImageView ivEventImg;
+ private MogoImageView ivReportHead;
+ private ImageView ivEventPlay;
+
+ // 控制按钮
+ private TextView tvEventTypeTitle;
+ private TextView tvEventAddress;
+ private TextView tvEventDistance;
+ private TextView tvEventTime;
+ private ImageView ivEventLive;
+ private ImageView ivEventCallChart;
+ private ImageView ivEventReportTrue;
+ private ImageView ivEventReportErr;
+ private ImageView ivEventZan;
+
+
+ // 上传事件的用户信息
+ private MarkerUserInfo mUserInfo;
+ // 当前的新鲜事儿信息
+ private MarkerExploreWay mNoveltyInfo;
+ private V2XRoadEventEntity mV2XRoadEventEntity;
+ private V2XEventShowEntity mV2XEventShowEntity;
+
+ // 拨打车聊聊语音回调
+ private V2XVoiceCallbackListener v2XVoiceCallbackCallListener = new V2XVoiceCallbackListener() {
+ @Override
+ public void onCallback(String command, Intent intent) {
+ triggerCallChart(mNoveltyInfo);
+ }
+ };
+ // 点赞语音回调
+ private V2XVoiceCallbackListener v2XVoiceCallbackLickListener = new V2XVoiceCallbackListener() {
+ @Override
+ public void onCallback(String command, Intent intent) {
+ triggerZan(mNoveltyInfo);
+ }
+ };
+ // 反馈"正确"语音回调
+ private V2XVoiceCallbackListener v2XVoiceCallbackReportTrueListener = new V2XVoiceCallbackListener() {
+ @Override
+ public void onCallback(String command, Intent intent) {
+ triggerReportTrue(mNoveltyInfo);
+ }
+ };
+ // 反馈"错误"语音回调
+ private V2XVoiceCallbackListener v2XVoiceCallbackReportErrorListener = new V2XVoiceCallbackListener() {
+ @Override
+ public void onCallback(String command, Intent intent) {
+ triggerReportErr(mNoveltyInfo);
+ }
+ };
+ // 反馈"错误"语音回调
+ private V2XVoiceCallbackListener v2XVoiceOpenLiveListener = new V2XVoiceCallbackListener() {
+ @Override
+ public void onCallback(String command, Intent intent) {
+ showLiveCar(mV2XEventShowEntity);
+ }
+ };
+
+ private void init(View itemView) {
+ ivEventImg = itemView.findViewById(R.id.ivEventImg);
+ ivReportHead = itemView.findViewById(R.id.ivEventHead);
+ ivEventPlay = itemView.findViewById(R.id.ivEventPlay);
+ tvEventTypeTitle = itemView.findViewById(R.id.tvEventTypeTitle);
+ tvEventAddress = itemView.findViewById(R.id.tvEventAddress);
+ tvEventDistance = itemView.findViewById(R.id.tvEventDistance);
+ tvEventTime = itemView.findViewById(R.id.tvEventTime);
+ ivEventLive = itemView.findViewById(R.id.ivEventLive);
+ ivEventCallChart = itemView.findViewById(R.id.ivEventCallChart);
+ ivEventZan = itemView.findViewById(R.id.ivEventZan);
+ ivEventReportTrue = itemView.findViewById(R.id.ivEventReportTrue);
+ ivEventReportErr = itemView.findViewById(R.id.ivEventReportErr);
+ }
+
+ public V2XRoadEventDetailVH(ViewGroup viewGroup) {
+ super(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false));
+ init(itemView);
+ // 设置视图状态监听
+ itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
+ @Override
+ public void onViewAttachedToWindow(View v) {
+// Logger.w(MODULE_NAME, "列表View V2XRoadEventDetailVH 触发 onViewAttachedToWindow");
+ // 注册语音交互
+ V2XVoiceManager.INSTANCE
+ .registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING,
+ v2XVoiceCallbackCallListener)
+ .registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ZAN,
+ v2XVoiceCallbackLickListener)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP,
+ v2XVoiceCallbackCallListener)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_ZAN_UN_WAKEUP,
+ v2XVoiceCallbackLickListener)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_TRUE,
+ v2XVoiceCallbackReportTrueListener)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_ERROR,
+ v2XVoiceCallbackReportErrorListener);
+ }
+
+ @Override
+ public void onViewDetachedFromWindow(View v) {
+// Logger.w(MODULE_NAME, "列表View V2XRoadEventDetailVH 触发 onViewDetachedFromWindow");
+ }
+ });
+ }
+
+ public void initView(V2XEventShowEntity v2XEventShowEntity) {
+ try {
+ if (v2XEventShowEntity == null) {
+ return;
+ }
+ mV2XEventShowEntity = v2XEventShowEntity;
+ mV2XRoadEventEntity = v2XEventShowEntity.getV2XRoadEventEntity();
+
+ if (mV2XRoadEventEntity == null) {
+ return;
+ }
+ mNoveltyInfo = mV2XRoadEventEntity.getNoveltyInfo();
+ if (mNoveltyInfo != null) {
+ mUserInfo = mNoveltyInfo.getUserInfo();
+ if (!ArrayUtils.isEmpty(mNoveltyInfo.getItems())) {
+ String imgUrl = mNoveltyInfo.getItems().get(0).getThumbnail();
+ if (TextUtils.isEmpty(imgUrl)) {
+ imgUrl = mNoveltyInfo.getItems().get(0).getUrl();
+ }
+ if (!TextUtils.isEmpty(imgUrl)) {
+ V2XServiceManager.getImageLoader()
+ .displayImage(imgUrl, ivEventImg);
+ }
+ }
+ if (mNoveltyInfo.getUserInfo() != null &&
+ !TextUtils.isEmpty(mNoveltyInfo.getUserInfo().getUserHead())) {
+ V2XServiceManager.getImageLoader()
+ .displayImage(mNoveltyInfo.getUserInfo().getUserHead(), ivReportHead);
+ }
+
+ String poiType = EventTypeUtils.getPoiTypeStr(mNoveltyInfo.getPoiType());
+ if (!TextUtils.isEmpty(poiType)) {
+ tvEventTypeTitle.setText(poiType);
+ tvEventTypeTitle.setBackgroundResource(EventTypeUtils.getPoiTypeBg(mNoveltyInfo.getPoiType()));
+ }
+ tvEventAddress.setText(mNoveltyInfo.getAddr());
+ tvEventDistance.setText("距离 " + (int) mNoveltyInfo.getDistance() + "M");
+
+ Calendar c = Calendar.getInstance();
+ c.setTimeInMillis(mNoveltyInfo.getGenerateTime());
+ String eventTime = DateTimeUtils.printCalendarByPattern(c, "yyyy/MM/dd HH:mm");
+ if (!TextUtils.isEmpty(eventTime)) {
+ tvEventTime.setText(eventTime);
+ }
+
+ // 事件距离车辆小于50米的时候可以用户纠错
+ if (mV2XRoadEventEntity.getDistance() < 50) {
+ ivEventReportTrue.setVisibility(VISIBLE);
+ ivEventReportErr.setVisibility(VISIBLE);
+
+ ivEventLive.setVisibility(GONE);
+ ivEventZan.setVisibility(GONE);
+ } else {
+ if (!ArrayUtils.isEmpty(mV2XEventShowEntity.getV2XLiveCarList())) {
+ ivEventLive.setVisibility(VISIBLE);
+ V2XVoiceManager.INSTANCE
+ .registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_LIVE_ROAD,
+ v2XVoiceOpenLiveListener)
+ .registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_LIVE_UN_WAKEUP,
+ v2XVoiceOpenLiveListener);
+ ivEventLive.setOnClickListener(v -> {
+ showLiveCar(v2XEventShowEntity);
+ });
+ } else {
+ ivEventLive.setVisibility(GONE);
+ }
+
+ ivEventReportTrue.setVisibility(GONE);
+ ivEventReportErr.setVisibility(GONE);
+ ivEventZan.setVisibility(VISIBLE);
+
+ // 用户上报的才会展示拨打电话
+ if (!TextUtils.isEmpty(mNoveltyInfo.getUploadType())
+ && mNoveltyInfo.getUploadType().equals("1")) {
+ requestUserInfo(mNoveltyInfo);
+ }
+ }
+
+ ivEventReportTrue.setOnClickListener(v -> {
+ triggerReportTrue(mNoveltyInfo);
+ });
+ ivEventReportErr.setOnClickListener(v -> {
+ triggerReportErr(mNoveltyInfo);
+ });
+ ivEventCallChart.setOnClickListener(v -> {
+ ivEventCallChart.setVisibility(GONE);
+ triggerCallChart(mNoveltyInfo);
+ });
+ ivEventZan.setOnClickListener(v -> {
+ triggerZan(mNoveltyInfo);
+ });
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 展示直播信息
+ *
+ * @param v2XEventShowEntity
+ */
+ private void showLiveCar(V2XEventShowEntity v2XEventShowEntity) {
+ if (v2XEventShowEntity != null) {
+ // 展示周边的直播车辆
+ List eventShowEntityArrayList = new ArrayList<>();
+ for (V2XLiveCarInfoEntity v2XLiveCarInfoRes : v2XEventShowEntity.getV2XLiveCarList()) {
+ V2XEventShowEntity showEntity = new V2XEventShowEntity();
+ showEntity.setViewType(V2XWindowTypeEnum.LIVE_CAR_WINDOW);
+ showEntity.setV2XLiveCarInfoRes(v2XLiveCarInfoRes);
+ showEntity.setV2XRoadEventEntity(mV2XRoadEventEntity);
+ eventShowEntityArrayList.add(showEntity);
+ }
+
+ Logger.d(MODULE_NAME, "要展示的直播:" + GsonUtil.jsonFromObject(eventShowEntityArrayList));
+ V2XMessageEntity> v2XMessageEntity = new V2XMessageEntity<>();
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_LIVE_CAR_WARNING);
+ v2XMessageEntity.setContent(eventShowEntityArrayList);
+ v2XMessageEntity.setShowState(true);
+ V2XRoadLiveCarScenario.getInstance().init(v2XMessageEntity);
+
+ // 打开直播后,窗口倒计时暂停关闭,直播被关闭后继续倒计时
+ V2XRoadEventWindow window = (V2XRoadEventWindow) V2XRoadEventScenario.getInstance().getV2XWindow();
+ window.stopCountDown();
+ }
+ }
+
+ /**
+ * 为了给车聊聊更多的信息需要重新查询一次
+ *
+ * @param noveltyInfo
+ */
+ private void requestUserInfo(MarkerExploreWay noveltyInfo) {
+ Logger.d(MODULE_NAME, "上报事件的用户SN:" + noveltyInfo.getSn());
+ // 获取道路事件周边的直播车机
+ if (!TextUtils.isEmpty(noveltyInfo.getSn())) {
+ V2XServiceManager
+ .getV2XRefreshModel()
+ .queryUserInfoBySn(
+ noveltyInfo.getSn(),
+ new V2XRefreshCallback() {
+ @Override
+ public void onSuccess(V2XUserInfoRes result) {
+ if (result != null && result.getResult() != null && result.getResult().getInfo() != null) {
+ V2XUserInfoRes.Result.Info infoBean = result.getResult().getInfo();
+ if (mUserInfo == null) {
+ mUserInfo = new MarkerUserInfo();
+ }
+ mUserInfo.setSn(infoBean.getSn());
+ try {
+ if (!TextUtils.isEmpty(infoBean.getCardIdAge())) {
+ mUserInfo.setAge(Integer.parseInt(infoBean.getCardIdAge()));
+ }
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ mUserInfo.setUserName(infoBean.getUserNickName());
+ mUserInfo.setUserHead(infoBean.getHeadImgUrl());
+ mUserInfo.setGender(infoBean.getCardIdSex());
+
+ // 重新设置用户信息
+ mNoveltyInfo.setUserInfo(mUserInfo);
+
+ // 只有自研车机才会 有车聊聊通话
+ if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
+ // 判断是否可以打电话
+ ChartingUtil.isCanCall(b -> {
+ if (b) {
+ // 判断是否可以打电话
+ ChartingUtil.isOnLine(mUserInfo.getSn(), b1 -> {
+ if (b1) {
+ ivEventCallChart.setVisibility(VISIBLE);
+ } else {
+ ivEventCallChart.setVisibility(GONE);
+ }
+ });
+ } else {
+ ivEventCallChart.setVisibility(GONE);
+ }
+ });
+ }
+ }
+ }
+
+ @Override
+ public void onFail(String msg) {
+ ivEventCallChart.setVisibility(GONE);
+ }
+ });
+ }
+ }
+
+ /**
+ * 延迟关闭窗体
+ */
+ @Override
+ public void delayedCloseWindow() {
+ itemView.postDelayed(() -> {
+ // 移除窗体
+ V2XServiceManager
+ .getIMogoWindowManager()
+ .removeView(V2XRoadEventScenario.getInstance().getV2XWindow().getView());
+ V2XRoadEventScenario.getInstance().close();
+ }, 1000);
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java
new file mode 100644
index 0000000000..f96ae6e301
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java
@@ -0,0 +1,408 @@
+package com.mogo.module.v2x.alarm;
+
+import android.text.TextUtils;
+
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.location.MogoLocation;
+import com.mogo.map.search.geo.IMogoGeoSearchListener;
+import com.mogo.map.search.geo.MogoGeocodeResult;
+import com.mogo.map.search.geo.MogoPoiItem;
+import com.mogo.map.search.geo.MogoRegeocodeResult;
+import com.mogo.map.search.poisearch.IMogoPoiSearch;
+import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
+import com.mogo.map.search.poisearch.MogoPoiResult;
+import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.common.entity.V2XPushMessageEntity;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.service.Utils;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
+import com.mogo.module.v2x.utils.DrivingDirectionUtils;
+import com.mogo.module.v2x.utils.FatigueDrivingUtils;
+import com.mogo.module.v2x.utils.LocationUtils;
+import com.mogo.module.v2x.utils.TimeConstants;
+import com.mogo.module.v2x.utils.TimeUtils;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.utils.ArrayUtils;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.storage.SharedPrefsMgr;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/13 11:02 AM
+ * desc :
+ * 这里是车机端自己实现预警信息的触发操作,首先获取当前车位置周围2公里范围的道路事件,
+ * 普通模式:根据当前「车辆位置」及「行驶方向」判断「车辆前方」「500米」是否有道路事件需要触发。
+ * 导航模式:根据当前「路径规划」及「行驶方向」判断「路径前方」「500米」是否有道路事件需要触发。
+ * version: 1.0
+ */
+public class V2XAlarmServer {
+ // 记录道路播报的事件
+ private static HashMap mAlertRoadEventList = new HashMap<>();
+ private static HashSet mAlertRoadEventCorrectionList = new HashSet<>();
+
+ // 记录违章停车播报事件
+ private static HashMap mAlertIllegalParkEventList = new HashMap<>();
+
+ // 记录疲劳驾驶播报的事件
+ private static HashSet mV2XFatigueDrivingEventLevel = new HashSet<>();
+
+ /**
+ * 获取当前车辆前方距离最近的道路事件
+ */
+ public static V2XRoadEventEntity getDriveFrontAlarmEvent(
+ CopyOnWriteArrayList v2XRoadEventEntityList,
+ MogoLocation currentLocation) {
+ try {
+// Logger.w(MODULE_NAME, "V2X预警--车辆状态:" + currentLocation);
+// Logger.w(MODULE_NAME, "V2X预警--车辆速度:" + currentLocation.getSpeed());
+// Logger.w(MODULE_NAME, "V2X预警--v2XRoadEventEntityList:" + GsonUtil.jsonFromObject(v2XRoadEventEntityList));
+ // 60(km/h)
+ if (currentLocation != null && v2XRoadEventEntityList != null) {
+ // 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
+ for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
+ // 先计算当前车辆的车头朝向是否与事件方向相同,这里采用的是区间值,只要在20度上下即可使用
+ // 道路事件必须有朝向,角度>=0;
+ //Logger.w(MODULE_NAME,
+ // "V2X预警--车辆与事件信息:" +
+ // "\n事件名称:" + markerNoveltyInfo.getNoveltyInfo().getContentData().getTitle() +
+ // "\n事件角度:" + markerNoveltyInfo.getLocation().getAngle() +
+ // "\n车头角度:" + currentLocation.getAngle() +
+ // "\n角度差值:" + Math.abs(currentLocation.getAngle() - markerNoveltyInfo.getLocation().getAngle()));
+ if (v2XRoadEventEntity.getLocation().getAngle() >= 0 &&
+ Math.abs(currentLocation.getBearing() - v2XRoadEventEntity.getLocation().getAngle()) <= 10) {
+ // 计算车辆距离指定气泡的距离
+ MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
+
+ // 判断是否到达了触发距离,20 ~ 500,
+ if (v2XRoadEventEntity.getDistance() <= 500) {
+ double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
+ currentLocation.getLongitude(),
+ currentLocation.getLatitude(),
+ eventLocation.getLon(),
+ eventLocation.getLat(),
+ (int) currentLocation.getBearing()
+ );
+ // Logger.w(MODULE_NAME, "V2X预警--事件位置===" + eventLocation);
+ if (0 <= eventAngle && eventAngle <= 20) {
+ // 判断是否已经提示过道路事件
+ boolean isAlreadyAlert = false;
+ String lastTime = mAlertRoadEventList.get(v2XRoadEventEntity);
+ if (!TextUtils.isEmpty(lastTime)) {
+ long timeSpan = TimeUtils.getTimeSpanByNow(lastTime, TimeConstants.MIN);
+// Logger.w(MODULE_NAME,
+// "V2X预警--事件ID:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
+// "\n上一次预警时间:" + lastTime +
+// "\n距离当前时间:" + timeSpan);
+ // 5分钟内不重复提醒
+ if (timeSpan < 5) {
+ isAlreadyAlert = true;
+ }
+ }
+ // 判断是否是纠错,如果是纠错就忽略掉带有时间段的道路提醒
+ if (v2XRoadEventEntity.getDistance() <= 50) {
+ if (!mAlertRoadEventCorrectionList.contains(v2XRoadEventEntity)) {
+ mAlertRoadEventCorrectionList.add(v2XRoadEventEntity);
+ isAlreadyAlert = false;
+ }
+ }
+// Logger.w(MODULE_NAME, "V2X预警--车辆与事件信息:" +
+// "\n距离:" + v2XRoadEventEntity.getDistance() + "米" +
+// "\n是否已经提醒:" + isAlreadyAlert +
+// "\n事件ID:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
+// "\n事件详情:" + GsonUtil.jsonFromObject(v2XRoadEventEntity.getNoveltyInfo())
+// );
+ // 进行提醒
+ if (!isAlreadyAlert) {
+ mAlertRoadEventList.put(v2XRoadEventEntity, TimeUtils.getNowString());
+ return v2XRoadEventEntity;
+ }
+ return null;
+ } else {
+// Logger.w(MODULE_NAME, "V2X预警--车辆与事件信息:" +
+// "\n角度:" + eventAngle + " 度" +
+// "\n事件详情:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId()
+// );
+ }
+ } else {
+// Logger.w(MODULE_NAME, "V2X预警--车辆与事件信息:" +
+// "\n距离:" + v2XRoadEventEntity.getDistance() + "米" +
+// "\n事件详情:" + v2XRoadEventEntity.getNoveltyInfo().getInfoId()
+// );
+ }
+ } else {
+// Logger.w(MODULE_NAME,
+// "车头方向: " + currentLocation.getAngle() +
+// "\n事件方向:" + v2XRoadEventEntity.getLocation().getAngle()
+// );
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * 疲劳驾驶的展示数据
+ * 分级说明:
+ * 1,驾驶时段 0-2小时为正常状态;
+ * 2,驾驶时段2-3小时为轻度疲劳;
+ * 3,驾驶时段3-4小时为中度疲劳;
+ * 4,驾驶时段4小时以上为重度疲劳;
+ */
+ public static void getFatigueDrivingShow(MogoLocation location, OnFatigueDrivingListener onFatigueDrivingListener) {
+ try {
+ long drivingTime = FatigueDrivingUtils.getDrivingTime();
+ //Logger.i(V2XConst.MODULE_NAME, "车机已经开机: " + drivingTime + " 分钟");
+
+ V2XStrategyPushRes.ResultBean strategyPushEntity =
+ GsonUtil.objectFromJson(SharedPrefsMgr.getInstance(V2XUtils.getApp())
+ .getString(V2XConst.V2X_STRATEGY_PUSH), V2XStrategyPushRes.ResultBean.class);
+
+ V2XPushMessageEntity drivingShowEntity = new V2XPushMessageEntity();
+ drivingShowEntity.setSceneId(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING);
+
+ if (strategyPushEntity != null &&
+ !ArrayUtils.isEmpty(strategyPushEntity.getLevelList())) {
+ for (V2XStrategyPushRes.ResultBean.LevelListBean levelListBean :
+ strategyPushEntity.getLevelList()) {
+ // 找到当前驾驶时常对应的疲劳等级
+ if (drivingTime >= levelListBean.getMinMinute()
+ && drivingTime < levelListBean.getMaxMinute()) {
+ //疲劳等级:NORMAL-正常、SLIGHT-轻度、MODERATE-中度、SEVERE-重度
+ switch (levelListBean.getLevel()) {
+ //正常
+ case "NORMAL":
+ Logger.d(MODULE_NAME, "驾驶疲劳程度: 正常");
+ break;
+ //轻度
+ case "SLIGHT":
+ Logger.w(MODULE_NAME, "驾驶疲劳程度: 轻度");
+ if (!mV2XFatigueDrivingEventLevel.contains("SLIGHT")) {
+ mV2XFatigueDrivingEventLevel.add("SLIGHT");
+ drivingShowEntity.setShowWindow(false);
+ drivingShowEntity.setAlarmContent(levelListBean.getContent());
+ drivingShowEntity.setTts(levelListBean.getTts());
+ drivingShowEntity.setExpireTime(levelListBean.getShowSeconds());
+ // 回调提醒
+ if (onFatigueDrivingListener != null) {
+ onFatigueDrivingListener.onAlarmMessage(drivingShowEntity);
+ }
+ }
+ break;
+ //中度
+ case "MODERATE":
+ Logger.e(MODULE_NAME, "驾驶疲劳程度: 中度");
+ warningParkPoi(location, onFatigueDrivingListener, drivingShowEntity, levelListBean);
+ break;
+ //重度
+ case "SEVERE":
+ Logger.e(MODULE_NAME, "驾驶疲劳程度: 重度");
+ break;
+ default:
+ Logger.e(MODULE_NAME, "驾驶疲劳程度: 超出定义范围");
+ break;
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ // 提醒停车
+ private static void warningParkPoi(MogoLocation location,
+ OnFatigueDrivingListener onFatigueDrivingListener,
+ V2XPushMessageEntity drivingShowEntity,
+ V2XStrategyPushRes.ResultBean.LevelListBean levelListBean) {
+ if (!mV2XFatigueDrivingEventLevel.contains("MODERATE")) {
+ mV2XFatigueDrivingEventLevel.add("MODERATE");
+ // 定位当前位置是否是高速
+ LocationUtils.geoCodeSearch(location, new IMogoGeoSearchListener() {
+ @Override
+ public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) {
+ Logger.i(MODULE_NAME, "根据经纬度查询结果为:" + regeocodeResult.getRegeocodeAddress().getFormatAddress());
+ String keyword = "停车场";
+ boolean isHighWay = false;
+ // 如果当前位置是高速则推荐服务区
+ if (regeocodeResult.getRegeocodeAddress().getFormatAddress().contains("高速")) {
+ keyword = "停车场|服务区";
+ isHighWay = true;
+ }
+ MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(keyword, keyword);
+ poiSearchQuery.setPageSize(5);
+ poiSearchQuery.setLocation(LocationUtils.getCurrentLatLon());
+ IMogoPoiSearch poiSearch = V2XServiceManager.getMapService().getPoiSearch(V2XUtils.getApp(), poiSearchQuery);
+ boolean finalIsHighWay = isHighWay;
+ poiSearch.setPoiSearchListener(new IMogoPoiSearchListener() {
+ @Override
+ public void onPoiSearched(MogoPoiResult result, int errorCode) {
+ Logger.i(MODULE_NAME, "附近的停车场/服务区:" + GsonUtil.jsonFromObject(result));
+ drivingShowEntity.setAlarmContent(levelListBean.getContent());
+
+ ArrayList pois = result.getPois();
+ if (pois.size() > 0) {
+ MogoPoiItem mogoPoiItem = getFrontPoi(finalIsHighWay, pois, location);
+ Logger.e(MODULE_NAME, "推荐车头前方最近的停车场/服务区:" + GsonUtil.jsonFromObject(mogoPoiItem));
+ if (mogoPoiItem != null) {
+ drivingShowEntity.setExpireTime(levelListBean.getShowSeconds());
+ drivingShowEntity.setShowWindow(true);
+ drivingShowEntity.setTts(levelListBean.getTts());
+ drivingShowEntity.setLon(mogoPoiItem.getPoint().getLon());
+ drivingShowEntity.setLat(mogoPoiItem.getPoint().getLat());
+ drivingShowEntity.setAddress(mogoPoiItem.getTitle());
+ float calculateDistance = Utils.calculateLineDistance(
+ new MogoLatLng(mogoPoiItem.getPoint().getLat(), mogoPoiItem.getPoint().getLon()),
+ LocationUtils.getCurrentLatLon()
+ );
+ drivingShowEntity.setDistance(calculateDistance);
+ } else {
+ drivingShowEntity.setShowWindow(false);
+ drivingShowEntity.setTts(levelListBean.getNoReTts());
+ }
+ } else {
+ drivingShowEntity.setShowWindow(false);
+ drivingShowEntity.setTts(levelListBean.getNoReTts());
+ }
+
+ // 回调提醒
+ if (onFatigueDrivingListener != null) {
+ onFatigueDrivingListener.onAlarmMessage(drivingShowEntity);
+ }
+ }
+
+ @Override
+ public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
+
+ }
+ });
+ poiSearch.searchPOIAsyn();
+ }
+
+ @Override
+ public void onGeocodeSearched(MogoGeocodeResult geocodeResult) {
+
+ }
+ });
+ }
+ }
+
+ public interface OnFatigueDrivingListener {
+ void onAlarmMessage(V2XPushMessageEntity drivingShowEntity);
+ }
+
+
+ // 计算出与车头朝向相同的poi点
+ public static MogoPoiItem getFrontPoi(boolean isHighWay, ArrayList pois, MogoLocation location) {
+ if (location != null && pois != null) {
+ // (高速道路)推荐道路前方180度服务区(限定30公里)
+ // (非高速)推荐停车场(限定5公里内)
+ for (MogoPoiItem poiItem : pois) {
+ // 计算距离
+ float calculateDistance = Utils.calculateLineDistance(
+ new MogoLatLng(poiItem.getPoint().getLat(), poiItem.getPoint().getLon()),
+ LocationUtils.getCurrentLatLon()
+ );
+ Logger.e(MODULE_NAME, "车辆距离POI点距离:" + calculateDistance);
+ Logger.e(MODULE_NAME, "当前车辆是否在高速:" + isHighWay);
+ if (isHighWay) {
+ if (calculateDistance > 100 && calculateDistance < 30000) {
+ // 计算角度
+ double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
+ location.getLongitude(),
+ location.getLatitude(),
+ poiItem.getPoint().getLon(),
+ poiItem.getPoint().getLat(),
+ (int) location.getBearing()
+ );
+ Logger.e(MODULE_NAME, "车辆距离POI角度:" + eventAngle);
+ // 车辆前方180度
+ if (0 <= eventAngle && eventAngle <= 90) {
+ return poiItem;
+ }
+ }
+ } else {
+ if (calculateDistance < 5000) {
+ return poiItem;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 获取车辆的前方的违章停车事件
+ */
+ public static MarkerExploreWay getIllegalParkAlarmEvent(
+ ArrayList v2XExploreWayEntityList,
+ MogoLocation currentLocation) {
+ try {
+ Logger.w(MODULE_NAME, "V2X预警--车辆状态:" + currentLocation);
+ // 60(km/h)
+ if (currentLocation != null && v2XExploreWayEntityList != null) {
+ // 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
+ for (MarkerExploreWay markerExploreWay : v2XExploreWayEntityList) {
+ // 计算车辆距离
+ float distance = Utils.calculateLineDistance(
+ new MogoLatLng(markerExploreWay.getLocation().getLat(), markerExploreWay.getLocation().getLon()),
+ new MogoLatLng(currentLocation.getLatitude(), currentLocation.getLongitude())
+ );
+
+ Logger.w(MODULE_NAME, "V2X预警--车辆与违章道路信息:" +
+ "\n当前车辆距离违章停车点:" + distance);
+
+ // 判断是否到达了触发距离,50 米
+ if (distance <= 50) {
+ Logger.w(MODULE_NAME, "V2X预警--车辆与违章道路信息:" +
+ "\n违章道路名称:" + markerExploreWay.getAddr() +
+ "\n车头角度:" + currentLocation.getBearing());
+
+ // 判断是否已经提示过道路事件
+ boolean isAlreadyAlert = false;
+ String lastTime = mAlertIllegalParkEventList.get(markerExploreWay);
+ Logger.w(MODULE_NAME,
+ "V2X预警--事件ID:" + markerExploreWay.getInfoId() +
+ "\n上一次预警时间:" + lastTime);
+ if (!TextUtils.isEmpty(lastTime)) {
+ long timeSpan = TimeUtils.getTimeSpanByNow(lastTime, TimeConstants.MIN);
+ Logger.w(MODULE_NAME,
+ "V2X预警--事件ID:" + markerExploreWay.getInfoId() +
+ "\n距离当前时间:" + timeSpan);
+ // 5分钟内不重复提醒
+ if (timeSpan < 5) {
+ isAlreadyAlert = true;
+ }
+ }
+ // 进行提醒
+ if (!isAlreadyAlert) {
+ mAlertIllegalParkEventList.put(markerExploreWay, TimeUtils.getNowString());
+ return markerExploreWay;
+ }
+ return null;
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XCalculateServer.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XCalculateServer.java
new file mode 100644
index 0000000000..e330df3505
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XCalculateServer.java
@@ -0,0 +1,150 @@
+package com.mogo.module.v2x.alarm;
+
+
+import android.os.Handler;
+
+import com.mogo.map.location.MogoLocation;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XStatusManager;
+import com.mogo.module.v2x.listener.CarStatusListener;
+import com.mogo.utils.logger.Logger;
+
+import java.util.HashMap;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/13 11:02 AM
+ * desc :
+ * 这里充当计算服务
+ * 计算 当前 车速变化回调、方向角度
+ * version: 1.0
+ */
+public class V2XCalculateServer {
+
+ private static final String TAG = "V2XCalculateServer";
+
+ // 当前的车辆位置,主要用 经纬度,角度,速度
+ private static MogoLocation mCurrentLocation;
+
+ // 是否处于停车状态
+ private static boolean mIsPark = true;
+ // 没有行驶的次数
+ private static int mNoDriveCount = 0;
+
+ private static HashMap mCarStatusListener = new HashMap<>();
+ private static V2XCalculateServer mV2XCalculateServer;
+
+ // 一分钟获取一次最新的路况信息
+ private static final int refreshTime = 5_000;
+ private static Handler refreshHandler;
+ private static Runnable refreshRunnable;
+
+ private V2XCalculateServer() {
+ }
+
+ public synchronized static V2XCalculateServer getInstance() {
+ synchronized (V2XCalculateServer.class) {
+ if (mV2XCalculateServer == null) {
+ mV2XCalculateServer = new V2XCalculateServer();
+ if (refreshHandler == null) {
+ refreshHandler = new Handler();
+ }
+ if (refreshRunnable == null) {
+ refreshRunnable = new Runnable() {
+ @Override
+ public void run() {
+ calculateCarStatus();
+ refreshHandler.postDelayed(this, refreshTime);
+ }
+ };
+ }
+ refreshHandler.post(refreshRunnable);
+ }
+ }
+ return mV2XCalculateServer;
+ }
+
+ /**
+ * 添加车辆状态监听
+ *
+ * @param tag 标记
+ * @param carStatusListener 回调
+ */
+ public void addCarStatusListener(String tag, CarStatusListener carStatusListener) {
+ if (mCarStatusListener == null) {
+ mCarStatusListener = new HashMap<>();
+ }
+ mCarStatusListener.put(tag, carStatusListener);
+ }
+
+ /**
+ * 移除指定的标记的回调
+ *
+ * @param tag 标记
+ */
+ public void removeCarStatusListener(String tag) {
+ if (mCarStatusListener != null) {
+ mCarStatusListener.remove(tag);
+ }
+ }
+
+ /**
+ * 记录车辆行驶轨迹
+ *
+ * @param location 车辆位置
+ */
+ public void addCarTrajectory(MogoLocation location) {
+ // 记录最后一次车辆位置信息
+ mCurrentLocation = location;
+ // 车辆状态计算
+ calculateCarStatus();
+ }
+
+ /**
+ * 计算车辆状态
+ */
+ private static void calculateCarStatus() {
+ if (mCurrentLocation != null) {
+ // 获取当前的车速
+ float currentSpeed = mCurrentLocation.getSpeed();
+// Logger.d(V2XConst.MODULE_NAME + "_" + TAG, "车辆状态:" +
+// "\n当前车辆位置->" + V2XStatusManager.getInstance().getLocation().getAddress() +
+// "\ncurrentSpeed 速度->" + currentSpeed +
+// "\n车辆行驶状态mIsPark->" + mIsPark +
+// "\nmNoDriveCount->" + mNoDriveCount);
+
+ // 获取没有车速
+ if (currentSpeed == 0) {
+ // 防止重复播报
+ if (!mIsPark) {
+ // 超过 2 次的速度为 0 ,判定为 行驶->停止
+ if ((++mNoDriveCount) > 2) {
+ if (mCarStatusListener != null) {
+ Logger.d(V2XConst.MODULE_NAME, "车辆状态:车辆从 行驶->停止");
+ mIsPark = true;
+ for (CarStatusListener statusListener : mCarStatusListener.values()) {
+ statusListener.onCarDriving2Stop(mCurrentLocation);
+ }
+ }
+ }
+ }
+ }
+ // 获取到了车速 大于 3m/s = 10公里/小时 判定为行驶状态
+ else if (currentSpeed > 3) {
+ mNoDriveCount = 0;
+ if (mIsPark) {
+ if (mCarStatusListener != null) {
+ Logger.d(V2XConst.MODULE_NAME, "车辆状态:车辆从 停止->行驶");
+ mIsPark = false;
+ for (CarStatusListener statusListener : mCarStatusListener.values()) {
+ statusListener.onCarStop2Driving(mCurrentLocation);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XAlarmEventRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XAlarmEventRes.java
new file mode 100644
index 0000000000..2e2b2a1a3f
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XAlarmEventRes.java
@@ -0,0 +1,280 @@
+
+package com.mogo.module.v2x.entity.net;
+
+import android.text.TextUtils;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import com.mogo.commons.data.BaseData;
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.common.entity.MarkerOnlineCar;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+@SuppressWarnings("unused")
+public class V2XAlarmEventRes extends BaseData implements Serializable {
+ @Expose
+ private Result result;
+
+ public Result getResult() {
+ return result;
+ }
+
+ public void setResult(Result result) {
+ this.result = result;
+ }
+
+ public class Result {
+ @Expose
+ @SerializedName(value = "recommendInfo", alternate = {"alarmInfo"})
+ private AlarmInfo alarmInfo;
+ @Expose
+ private ArrayList onlineCar;
+
+ public ArrayList getOnlineCar() {
+ return onlineCar;
+ }
+
+ public void setOnlineCar(ArrayList onlineCar) {
+ this.onlineCar = onlineCar;
+ }
+
+ public AlarmInfo getAlarmInfo() {
+ return alarmInfo;
+ }
+
+ public void setAlarmInfo(AlarmInfo alarmInfo) {
+ this.alarmInfo = alarmInfo;
+ }
+
+ @Override
+ public String toString() {
+ return "Result{" +
+ "alarmInfo=" + alarmInfo +
+ ", onlineCar=" + onlineCar +
+ '}';
+ }
+
+ }
+
+ public static class AlarmInfo {
+
+ @Expose
+ private ContentData contentData;
+ @Expose
+ private Double distance;
+ @Expose
+ private MarkerLocation location;
+ @Expose
+ private String poiType;
+ @Expose
+ private String tts;
+ @Expose
+ private String type;
+ @Expose
+ private String alarmContent;
+ @Expose
+ private int expireTime;
+ @Expose
+ private int parkingSpaceSurplusNum;
+
+ public ContentData getContentData() {
+ return contentData;
+ }
+
+ public void setContentData(ContentData contentData) {
+ this.contentData = contentData;
+ }
+
+ public Double getDistance() {
+ return distance;
+ }
+
+ public void setDistance(Double distance) {
+ this.distance = distance;
+ }
+
+ public MarkerLocation getLocation() {
+ return location;
+ }
+
+ public void setLocation(MarkerLocation location) {
+ this.location = location;
+ }
+
+ public String getPoiType() {
+ if (TextUtils.isEmpty(poiType)) {
+ return "";
+ }
+ return poiType;
+ }
+
+ public void setPoiType(String poiType) {
+ this.poiType = poiType;
+ }
+
+ public String getTts() {
+ if (TextUtils.isEmpty(tts)) {
+ return "";
+ }
+ return tts;
+ }
+
+ public void setTts(String tts) {
+ this.tts = tts;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getAlarmContent() {
+ return alarmContent;
+ }
+
+ public void setAlarmContent(String alarmContent) {
+ this.alarmContent = alarmContent;
+ }
+
+ public int getExpireTime() {
+ return expireTime;
+ }
+
+ public void setExpireTime(int expireTime) {
+ this.expireTime = expireTime;
+ }
+
+ public int getParkingSpaceSurplusNum() {
+ return parkingSpaceSurplusNum;
+ }
+
+ public void setParkingSpaceSurplusNum(int parkingSpaceSurplusNum) {
+ this.parkingSpaceSurplusNum = parkingSpaceSurplusNum;
+ }
+
+ @Override
+ public String toString() {
+ return "AlarmInfo{" +
+ "contentData=" + contentData +
+ ", distance=" + distance +
+ ", location=" + location +
+ ", poiType='" + poiType + '\'' +
+ ", tts='" + tts + '\'' +
+ ", type='" + type + '\'' +
+ ", alarmContent='" + alarmContent + '\'' +
+ ", expireTime=" + expireTime +
+ ", parkingSpaceSurplusNum=" + parkingSpaceSurplusNum +
+ '}';
+ }
+ }
+
+ public class ContentData {
+
+ @Expose
+ private String iconUrl;
+ @Expose
+ private String imgUrl;
+ @Expose
+ private String infoId = ""; // POI 唯一标示 「纠错」或「确认」「点赞」使用
+ @Expose
+ private String title;
+ @Expose
+ private String content;
+ @Expose
+ private String gasPrices;//"[{\"gasCode\":\"95\",\"gasPrice\":10.0},{\"gasCode\":\"98\",\"gasPrice\":23.0}]"
+ @Expose
+ private String styleType;// 内容类型,image-图片类型,video-视频类型
+ @Expose
+ private String carSn;// 如果是用户上报的,则需要返回该字段
+
+ public String getIconUrl() {
+ return iconUrl;
+ }
+
+ public void setIconUrl(String iconUrl) {
+ this.iconUrl = iconUrl;
+ }
+
+ public String getImgUrl() {
+ return imgUrl;
+ }
+
+ public void setImgUrl(String imgUrl) {
+ this.imgUrl = imgUrl;
+ }
+
+ public String getInfoId() {
+ return infoId;
+ }
+
+ public void setInfoId(String infoId) {
+ this.infoId = infoId;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getGasPrices() {
+ return gasPrices;
+ }
+
+ public void setGasPrices(String gasPrices) {
+ this.gasPrices = gasPrices;
+ }
+
+ public String getStyleType() {
+ return styleType;
+ }
+
+ public void setStyleType(String styleType) {
+ this.styleType = styleType;
+ }
+
+ public String getCarSn() {
+ return carSn;
+ }
+
+ public void setCarSn(String carSn) {
+ this.carSn = carSn;
+ }
+
+ @Override
+ public String toString() {
+ return "ContentData{" +
+ "iconUrl='" + iconUrl + '\'' +
+ ", imgUrl='" + imgUrl + '\'' +
+ ", infoId='" + infoId + '\'' +
+ ", title='" + title + '\'' +
+ ", content='" + content + '\'' +
+ ", gasPrices='" + gasPrices + '\'' +
+ ", styleType='" + styleType + '\'' +
+ ", carSn='" + carSn + '\'' +
+ '}';
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "V2XAlarmEventMessage{" +
+ "result=" + result +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XDemoUserInfoRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XDemoUserInfoRes.java
new file mode 100644
index 0000000000..6413f75f40
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XDemoUserInfoRes.java
@@ -0,0 +1,258 @@
+package com.mogo.module.v2x.entity.net;
+
+import com.mogo.commons.data.BaseData;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/24 4:20 PM
+ * desc : TODO 前瞻需求演示使用的用户数据
+ * version: 1.0
+ */
+public class V2XDemoUserInfoRes extends BaseData implements Serializable {
+
+ /**
+ * code : 0
+ * msg :
+ * detailMsg :
+ * result : {"userList":[{"sceneType":"1","location":{"lat":39.97541,"lon":116.41782761},"userInfo":{"sn":"ZD801B1920L00818","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}},{"sceneType":"2","location":{"lat":39.97541,"lon":116.41782761},"userInfo":{"sn":"ZD802B1932L00779","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}},{"sceneType":"3","location":{"lat":39.97541,"lon":116.41782761},"userInfo":{"sn":"ZD802B1932L00779","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}}]}
+ */
+
+ private ResultBean result;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ public ResultBean getResult() {
+ return result;
+ }
+
+ public void setResult(ResultBean result) {
+ this.result = result;
+ }
+
+ public static class ResultBean {
+ private List userList;
+
+ public List getUserList() {
+ return userList;
+ }
+
+ public void setUserList(List userList) {
+ this.userList = userList;
+ }
+
+ public static class UserListBean {
+ /**
+ * sceneType : 1
+ * location : {"lat":39.97541,"lon":116.41782761}
+ * userInfo : {"sn":"ZD801B1920L00818","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}
+ */
+
+ private String sceneType;
+ private LocationBean location;
+ private UserInfoBean userInfo;
+
+ public String getSceneType() {
+ return sceneType;
+ }
+
+ public void setSceneType(String sceneType) {
+ this.sceneType = sceneType;
+ }
+
+ public LocationBean getLocation() {
+ return location;
+ }
+
+ public void setLocation(LocationBean location) {
+ this.location = location;
+ }
+
+ public UserInfoBean getUserInfo() {
+ return userInfo;
+ }
+
+ public void setUserInfo(UserInfoBean userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ public static class LocationBean {
+ /**
+ * lat : 39.97541
+ * lon : 116.41782761
+ */
+
+ private double lat;
+ private double lon;
+
+ public double getLat() {
+ return lat;
+ }
+
+ public void setLat(double lat) {
+ this.lat = lat;
+ }
+
+ public double getLon() {
+ return lon;
+ }
+
+ public void setLon(double lon) {
+ this.lon = lon;
+ }
+
+ @Override
+ public String toString() {
+ return "LocationBean{" +
+ "lat=" + lat +
+ ", lon=" + lon +
+ '}';
+ }
+ }
+
+ public static class UserInfoBean {
+ /**
+ * sn : ZD801B1920L00818
+ * userId : 1
+ * userName : 用户昵称
+ * userHead : https://www.baidu.com/img/baidu_jgylogo3.png
+ * gender : 男
+ * age : 20
+ * lastActiveweekAvgscore : 96
+ * safeLabel : 老司机
+ * safeLabelType : 1
+ */
+
+ private String sn;
+ private int userId;
+ private String userName;
+ private String userHead;
+ private String gender;
+ private int age;
+ private String lastActiveweekAvgscore;
+ private String safeLabel;
+ private int safeLabelType;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public int getUserId() {
+ return userId;
+ }
+
+ public void setUserId(int userId) {
+ this.userId = userId;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getUserHead() {
+ return userHead;
+ }
+
+ public void setUserHead(String userHead) {
+ this.userHead = userHead;
+ }
+
+ public String getGender() {
+ return gender;
+ }
+
+ public void setGender(String gender) {
+ this.gender = gender;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getLastActiveweekAvgscore() {
+ return lastActiveweekAvgscore;
+ }
+
+ public void setLastActiveweekAvgscore(String lastActiveweekAvgscore) {
+ this.lastActiveweekAvgscore = lastActiveweekAvgscore;
+ }
+
+ public String getSafeLabel() {
+ return safeLabel;
+ }
+
+ public void setSafeLabel(String safeLabel) {
+ this.safeLabel = safeLabel;
+ }
+
+ public int getSafeLabelType() {
+ return safeLabelType;
+ }
+
+ public void setSafeLabelType(int safeLabelType) {
+ this.safeLabelType = safeLabelType;
+ }
+
+ @Override
+ public String toString() {
+ return "UserInfoBean{" +
+ "sn='" + sn + '\'' +
+ ", userId=" + userId +
+ ", userName='" + userName + '\'' +
+ ", userHead='" + userHead + '\'' +
+ ", gender='" + gender + '\'' +
+ ", age=" + age +
+ ", lastActiveweekAvgscore='" + lastActiveweekAvgscore + '\'' +
+ ", safeLabel='" + safeLabel + '\'' +
+ ", safeLabelType=" + safeLabelType +
+ '}';
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "UserListBean{" +
+ "sceneType='" + sceneType + '\'' +
+ ", location=" + location +
+ ", userInfo=" + userInfo +
+ '}';
+ }
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "V2XDemoUserInfoEntity{" +
+ "result=" + result +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XGiveLike.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XGiveLike.java
new file mode 100644
index 0000000000..9b6e16990b
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XGiveLike.java
@@ -0,0 +1,52 @@
+
+package com.mogo.module.v2x.entity.net;
+
+import com.google.gson.annotations.Expose;
+
+import java.io.Serializable;
+
+@SuppressWarnings("unused")
+public class V2XGiveLike implements Serializable {
+
+ @Expose
+ private Long code;
+ @Expose
+ private String msg;
+ @Expose
+ private String result;
+ @Expose
+ private String sign;
+
+ public Long getCode() {
+ return code;
+ }
+
+ public void setCode(Long code) {
+ this.code = code;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public String getSign() {
+ return sign;
+ }
+
+ public void setSign(String sign) {
+ this.sign = sign;
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLiveCarBroadcastReq.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLiveCarBroadcastReq.kt
new file mode 100644
index 0000000000..da482ace67
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLiveCarBroadcastReq.kt
@@ -0,0 +1,25 @@
+package com.mogo.module.v2x.entity.net
+
+/**
+ * 直播心跳请求
+ */
+class V2XLiveCarBroadcastReq {
+
+ var eventId: String? = null
+ var sn: String
+ var type: Int = 0
+ var videoChannel: String
+
+ constructor(sn: String, videoChannel: String) {
+ this.sn = sn
+ this.videoChannel = videoChannel
+ }
+
+ constructor(eventId: String, sn: String, type: Int, videoChannel: String) {
+ this.eventId = eventId
+ this.sn = sn
+ this.type = type
+ this.videoChannel = videoChannel
+ }
+
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLiveCarRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLiveCarRes.java
new file mode 100644
index 0000000000..14fe86261e
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLiveCarRes.java
@@ -0,0 +1,56 @@
+package com.mogo.module.v2x.entity.net;
+
+import com.google.gson.annotations.Expose;
+import com.mogo.commons.data.BaseData;
+import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/14 2:58 PM
+ * desc : 根据经纬度查询附近可直播车机直播信息
+ * version: 1.0
+ */
+public class V2XLiveCarRes extends BaseData implements Serializable {
+ @Expose
+ private ResultBean result;
+
+ public static class ResultBean {
+
+ private List info;
+
+ public List getInfo() {
+ return info;
+ }
+
+ public void setInfo(List info) {
+ this.info = info;
+ }
+
+ @Override
+ public String toString() {
+ return "ResultBean{" +
+ "info=" + info +
+ '}';
+ }
+ }
+
+ public ResultBean getResult() {
+ return result;
+ }
+
+ public void setResult(ResultBean result) {
+ this.result = result;
+ }
+
+ @Override
+ public String toString() {
+ return "V2XLiveCarRes{" +
+ "result=" + result +
+ '}';
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLivePushVoRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLivePushVoRes.java
new file mode 100644
index 0000000000..d0bc3fa292
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XLivePushVoRes.java
@@ -0,0 +1,113 @@
+package com.mogo.module.v2x.entity.net;
+
+import com.mogo.commons.data.BaseData;
+
+import java.io.Serializable;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/16 1:43 PM
+ * desc : 推流与停止推流接口
+ * version: 1.0
+ */
+public class V2XLivePushVoRes extends BaseData implements Serializable {
+ public V2XLivePushVoEntity result;
+
+ public V2XLivePushVoEntity getResult() {
+ return result;
+ }
+
+ public void setResult(V2XLivePushVoEntity result) {
+ this.result = result;
+ }
+
+ @Override
+ public String toString() {
+ return "V2XLivePushVoRes{" +
+ "result=" + result +
+ ", code=" + code +
+ ", msg='" + msg + '\'' +
+ '}';
+ }
+
+ public class V2XLivePushVoEntity {
+ private String livePlayUrl;
+ private PlayUrl playUrl;
+ private String videoChannel;
+
+ public String getLivePlayUrl() {
+ return livePlayUrl;
+ }
+
+ public void setLivePlayUrl(String livePlayUrl) {
+ this.livePlayUrl = livePlayUrl;
+ }
+
+ public PlayUrl getPlayUrl() {
+ return playUrl;
+ }
+
+ public void setPlayUrl(PlayUrl playUrl) {
+ this.playUrl = playUrl;
+ }
+
+ public String getVideoChannel() {
+ return videoChannel;
+ }
+
+ public void setVideoChannel(String videoChannel) {
+ this.videoChannel = videoChannel;
+ }
+
+ public class PlayUrl {
+
+ private String flv;
+ private String hls;
+ private String rtmp;
+
+ public String getFlv() {
+ return flv;
+ }
+
+ public void setFlv(String flv) {
+ this.flv = flv;
+ }
+
+ public String getHls() {
+ return hls;
+ }
+
+ public void setHls(String hls) {
+ this.hls = hls;
+ }
+
+ public String getRtmp() {
+ return rtmp;
+ }
+
+ public void setRtmp(String rtmp) {
+ this.rtmp = rtmp;
+ }
+
+ @Override
+ public String toString() {
+ return "PlayUrl{" +
+ "flv='" + flv + '\'' +
+ ", hls='" + hls + '\'' +
+ ", rtmp='" + rtmp + '\'' +
+ '}';
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "V2XLivePushVoEntity{" +
+ "livePlayUrl='" + livePlayUrl + '\'' +
+ ", playUrl=" + playUrl +
+ ", videoChannel='" + videoChannel + '\'' +
+ '}';
+ }
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XSeekHelpRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XSeekHelpRes.java
new file mode 100644
index 0000000000..705615b72b
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XSeekHelpRes.java
@@ -0,0 +1,52 @@
+package com.mogo.module.v2x.entity.net;
+
+import com.mogo.commons.data.BaseData;
+
+import java.io.Serializable;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/3/11 4:25 PM
+ * desc : 故障求助查询,当前车辆是否处于求助中
+ * version: 1.0
+ */
+public class V2XSeekHelpRes extends BaseData implements Serializable {
+ private ResultBean result;
+
+ public ResultBean getResult() {
+ return result;
+ }
+
+ public void setResult(ResultBean result) {
+ this.result = result;
+ }
+
+ public static class ResultBean {
+ private int vehicleType;
+
+ public int getVehicleType() {
+ return vehicleType;
+ }
+
+ public void setVehicleType(int vehicleType) {
+ this.vehicleType = vehicleType;
+ }
+
+ @Override
+ public String toString() {
+ return "ResultBean{" +
+ "vehicleType=" + vehicleType +
+ '}';
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "V2XSeekHelpResult{" +
+ "result=" + result +
+ ", code=" + code +
+ ", msg='" + msg + '\'' +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XSpecialCarRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XSpecialCarRes.java
new file mode 100644
index 0000000000..9ffc90ca91
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XSpecialCarRes.java
@@ -0,0 +1,205 @@
+
+package com.mogo.module.v2x.entity.net;
+
+import java.io.Serializable;
+import java.util.List;
+
+@SuppressWarnings("unused")
+public class V2XSpecialCarRes implements Serializable {
+
+ private List coordinates;
+
+ public List getCoordinates() {
+ return coordinates;
+ }
+
+ public void setCoordinates(List coordinates) {
+ this.coordinates = coordinates;
+ }
+
+ @Override
+ public String toString() {
+ return "V2XMarkerResult{" +
+ "coordinates=" + coordinates +
+ '}';
+ }
+
+ public class V2XMarkerEntity implements Serializable {
+
+ /**
+ * createTime : 1587111513507
+ * distance : 100
+ * lat : 39.96911187
+ * lon : 116.41777396
+ * sn : ZD802B1932L00681
+ * targetId : 20007
+ * targetName : 故障车
+ * userInfo : {"age":33,"displayName":"飞","headImgUrl":"http://img.zhidaohulian.com/fileServer/api/qa/user_info/1068057333299/67933ffb9a7e237c8cc2d8d9f66efcd0.jpg","sex":1,"sn":"ZD801B1920L00568","userId":1068057333299}
+ */
+
+ private long createTime;
+ private int distance;
+ private double lat;
+ private double lon;
+ private String sn;
+ private int targetId;
+ private String targetName;
+ private V2XMarkerEntity.UserInfoBean userInfo;
+
+ public long getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(long createTime) {
+ this.createTime = createTime;
+ }
+
+ public int getDistance() {
+ return distance;
+ }
+
+ public void setDistance(int distance) {
+ this.distance = distance;
+ }
+
+ public double getLat() {
+ return lat;
+ }
+
+ public void setLat(double lat) {
+ this.lat = lat;
+ }
+
+ public double getLon() {
+ return lon;
+ }
+
+ public void setLon(double lon) {
+ this.lon = lon;
+ }
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public int getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(int targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public V2XMarkerEntity.UserInfoBean getUserInfo() {
+ return userInfo;
+ }
+
+ public void setUserInfo(V2XMarkerEntity.UserInfoBean userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ public class UserInfoBean implements Serializable {
+ /**
+ * age : 33
+ * displayName : 飞
+ * headImgUrl : http://img.zhidaohulian.com/fileServer/api/qa/user_info/1068057333299/67933ffb9a7e237c8cc2d8d9f66efcd0.jpg
+ * sex : 1
+ * sn : ZD801B1920L00568
+ * userId : 1068057333299
+ */
+
+ private int age;
+ private String displayName;
+ private String headImgUrl;
+ private int sex;
+ private String sn;
+ private long userId;
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getHeadImgUrl() {
+ return headImgUrl;
+ }
+
+ public void setHeadImgUrl(String headImgUrl) {
+ this.headImgUrl = headImgUrl;
+ }
+
+ public int getSex() {
+ return sex;
+ }
+
+ public void setSex(int sex) {
+ this.sex = sex;
+ }
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ @Override
+ public String toString() {
+ return "UserInfoBean{" +
+ "age=" + age +
+ ", displayName='" + displayName + '\'' +
+ ", headImgUrl='" + headImgUrl + '\'' +
+ ", sex=" + sex +
+ ", sn='" + sn + '\'' +
+ ", userId=" + userId +
+ '}';
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "V2XMarkerEntity{" +
+ "createTime=" + createTime +
+ ", distance=" + distance +
+ ", lat=" + lat +
+ ", lon=" + lon +
+ ", sn='" + sn + '\'' +
+ ", targetId=" + targetId +
+ ", targetName='" + targetName + '\'' +
+ ", userInfo=" + userInfo +
+ '}';
+ }
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XStrategyPushRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XStrategyPushRes.java
new file mode 100644
index 0000000000..250c4131b7
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XStrategyPushRes.java
@@ -0,0 +1,253 @@
+package com.mogo.module.v2x.entity.net;
+
+import com.mogo.commons.data.BaseData;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/5/26 2:30 PM
+ * desc : 疲劳驾驶提醒策略
+ * version: 1.0
+ */
+public class V2XStrategyPushRes extends BaseData implements Serializable {
+
+ /**
+ * result : {"levelList":[{"level":"NORMAL","minMinute":0,"maxMinute":120},{"content":"已连续驾驶2小时,请注意休息","level":"SLIGHT","tts":"已连续驾驶2小时,听歌可以缓解疲劳,可以对我说打开音乐","showSeconds":15,"minMinute":120,"maxMinute":180},{"content":"已连续驾驶3小时,请注意停车休息","highSpeed":{"recommend":"REST_AREA","direction":"FRONT","angle":180,"distance":30},"level":"MODERATE","lowSpeed":{"recommend":"PARK","direction":"FRONT","angle":180,"distance":5},"tts":"已连续驾驶3小时,已为您找到附近服务区/停车场,请停车休息,可以对我说导航前往","showSeconds":20,"noReTts":"已连续驾驶3小时,为避免事故发生,请尽快进入停车区休息","minMinute":180,"maxMinute":240}],"drivingIgnoreMinutes":20,"restIgnoreMinutes":20}
+ */
+ private ResultBean result;
+
+ public ResultBean getResult() {
+ return result;
+ }
+
+ public void setResult(ResultBean result) {
+ this.result = result;
+ }
+
+ public static class ResultBean {
+ /**
+ * levelList : [{"level":"NORMAL","minMinute":0,"maxMinute":120},{"content":"已连续驾驶2小时,请注意休息","level":"SLIGHT","tts":"已连续驾驶2小时,听歌可以缓解疲劳,可以对我说打开音乐","showSeconds":15,"minMinute":120,"maxMinute":180},{"content":"已连续驾驶3小时,请注意停车休息","highSpeed":{"recommend":"REST_AREA","direction":"FRONT","angle":180,"distance":30},"level":"MODERATE","lowSpeed":{"recommend":"PARK","direction":"FRONT","angle":180,"distance":5},"tts":"已连续驾驶3小时,已为您找到附近服务区/停车场,请停车休息,可以对我说导航前往","showSeconds":20,"noReTts":"已连续驾驶3小时,为避免事故发生,请尽快进入停车区休息","minMinute":180,"maxMinute":240}]
+ * drivingIgnoreMinutes : 20
+ * restIgnoreMinutes : 20
+ */
+
+ private int drivingIgnoreMinutes;
+ private int restIgnoreMinutes;
+ private List levelList;
+
+ public int getDrivingIgnoreMinutes() {
+ return drivingIgnoreMinutes;
+ }
+
+ public void setDrivingIgnoreMinutes(int drivingIgnoreMinutes) {
+ this.drivingIgnoreMinutes = drivingIgnoreMinutes;
+ }
+
+ public int getRestIgnoreMinutes() {
+ return restIgnoreMinutes;
+ }
+
+ public void setRestIgnoreMinutes(int restIgnoreMinutes) {
+ this.restIgnoreMinutes = restIgnoreMinutes;
+ }
+
+ public List getLevelList() {
+ return levelList;
+ }
+
+ public void setLevelList(List levelList) {
+ this.levelList = levelList;
+ }
+
+ public static class LevelListBean {
+ /**
+ * level : NORMAL
+ * minMinute : 0
+ * maxMinute : 120
+ * content : 已连续驾驶2小时,请注意休息
+ * tts : 已连续驾驶2小时,听歌可以缓解疲劳,可以对我说打开音乐
+ * showSeconds : 15
+ * highSpeed : {"recommend":"REST_AREA","direction":"FRONT","angle":180,"distance":30}
+ * lowSpeed : {"recommend":"PARK","direction":"FRONT","angle":180,"distance":5}
+ * noReTts : 已连续驾驶3小时,为避免事故发生,请尽快进入停车区休息
+ */
+
+ private String level;
+ private int minMinute;
+ private int maxMinute;
+ private String content;
+ private String tts;
+ private int showSeconds;
+ private HighSpeedBean highSpeed;
+ private LowSpeedBean lowSpeed;
+ private String noReTts;
+
+ public String getLevel() {
+ return level;
+ }
+
+ public void setLevel(String level) {
+ this.level = level;
+ }
+
+ public int getMinMinute() {
+ return minMinute;
+ }
+
+ public void setMinMinute(int minMinute) {
+ this.minMinute = minMinute;
+ }
+
+ public int getMaxMinute() {
+ return maxMinute;
+ }
+
+ public void setMaxMinute(int maxMinute) {
+ this.maxMinute = maxMinute;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getTts() {
+ return tts;
+ }
+
+ public void setTts(String tts) {
+ this.tts = tts;
+ }
+
+ public int getShowSeconds() {
+ return showSeconds;
+ }
+
+ public void setShowSeconds(int showSeconds) {
+ this.showSeconds = showSeconds;
+ }
+
+ public HighSpeedBean getHighSpeed() {
+ return highSpeed;
+ }
+
+ public void setHighSpeed(HighSpeedBean highSpeed) {
+ this.highSpeed = highSpeed;
+ }
+
+ public LowSpeedBean getLowSpeed() {
+ return lowSpeed;
+ }
+
+ public void setLowSpeed(LowSpeedBean lowSpeed) {
+ this.lowSpeed = lowSpeed;
+ }
+
+ public String getNoReTts() {
+ return noReTts;
+ }
+
+ public void setNoReTts(String noReTts) {
+ this.noReTts = noReTts;
+ }
+
+ public static class HighSpeedBean {
+ /**
+ * recommend : REST_AREA
+ * direction : FRONT
+ * angle : 180
+ * distance : 30
+ */
+
+ private String recommend;
+ private String direction;
+ private int angle;
+ private int distance;
+
+ public String getRecommend() {
+ return recommend;
+ }
+
+ public void setRecommend(String recommend) {
+ this.recommend = recommend;
+ }
+
+ public String getDirection() {
+ return direction;
+ }
+
+ public void setDirection(String direction) {
+ this.direction = direction;
+ }
+
+ public int getAngle() {
+ return angle;
+ }
+
+ public void setAngle(int angle) {
+ this.angle = angle;
+ }
+
+ public int getDistance() {
+ return distance;
+ }
+
+ public void setDistance(int distance) {
+ this.distance = distance;
+ }
+ }
+
+ public static class LowSpeedBean {
+ /**
+ * recommend : PARK
+ * direction : FRONT
+ * angle : 180
+ * distance : 5
+ */
+
+ private String recommend;
+ private String direction;
+ private int angle;
+ private int distance;
+
+ public String getRecommend() {
+ return recommend;
+ }
+
+ public void setRecommend(String recommend) {
+ this.recommend = recommend;
+ }
+
+ public String getDirection() {
+ return direction;
+ }
+
+ public void setDirection(String direction) {
+ this.direction = direction;
+ }
+
+ public int getAngle() {
+ return angle;
+ }
+
+ public void setAngle(int angle) {
+ this.angle = angle;
+ }
+
+ public int getDistance() {
+ return distance;
+ }
+
+ public void setDistance(int distance) {
+ this.distance = distance;
+ }
+ }
+ }
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XUserInfoRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XUserInfoRes.java
new file mode 100644
index 0000000000..bc5a567ec6
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XUserInfoRes.java
@@ -0,0 +1,344 @@
+
+package com.mogo.module.v2x.entity.net;
+
+import com.google.gson.annotations.Expose;
+import com.mogo.commons.data.BaseData;
+
+import java.io.Serializable;
+
+public class V2XUserInfoRes extends BaseData implements Serializable {
+
+ @Expose
+ private Result result;
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ public Result getResult() {
+ return result;
+ }
+
+ public void setResult(Result result) {
+ this.result = result;
+ }
+
+ public class Result {
+
+ @Expose
+ private Info info;
+
+ public Info getInfo() {
+ return info;
+ }
+
+ public void setInfo(Info info) {
+ this.info = info;
+ }
+
+
+ public class Info {
+
+ @Expose
+ private Long activeStatus;
+ @Expose
+ private Long bindStatus;
+ @Expose
+ private String bindType;
+ @Expose
+ private String bindUserId;
+ @Expose
+ private String erpSnGroup;
+ @Expose
+ private String erpSnType;
+ @Expose
+ private String iccid;
+ @Expose
+ private String ifCarcorder;
+ @Expose
+ private String ifImdemo;
+ @Expose
+ private String ifSocketservice;
+ @Expose
+ private String lastActiveCity;
+ @Expose
+ private Long lastBrandId;
+ @Expose
+ private String lastBrandName;
+ @Expose
+ private String lastCarNum;
+ @Expose
+ private String lastCarNumEn;
+ @Expose
+ private String lastFortaVersion;
+ @Expose
+ private Long lastModelId;
+ @Expose
+ private String lastModelName;
+ @Expose
+ private String sn;
+ @Expose
+ private String snGroupDetail;
+ @Expose
+ private String songTypeTop2;
+ @Expose
+ private String userNickName;
+ @Expose
+ private String cardIdAge;
+ @Expose
+ private String headImgUrl;
+ @Expose
+ private String cardIdSex;
+
+ public String getHeadImgUrl() {
+ return headImgUrl;
+ }
+
+ public void setHeadImgUrl(String headImgUrl) {
+ this.headImgUrl = headImgUrl;
+ }
+
+ public String getCardIdSex() {
+ return cardIdSex;
+ }
+
+ public void setCardIdSex(String cardIdSex) {
+ this.cardIdSex = cardIdSex;
+ }
+
+ public String getCardIdAge() {
+ return cardIdAge;
+ }
+
+ public void setCardIdAge(String cardIdAge) {
+ this.cardIdAge = cardIdAge;
+ }
+
+ public Long getActiveStatus() {
+ return activeStatus;
+ }
+
+ public void setActiveStatus(Long activeStatus) {
+ this.activeStatus = activeStatus;
+ }
+
+ public Long getBindStatus() {
+ return bindStatus;
+ }
+
+ public void setBindStatus(Long bindStatus) {
+ this.bindStatus = bindStatus;
+ }
+
+ public String getBindType() {
+ return bindType;
+ }
+
+ public void setBindType(String bindType) {
+ this.bindType = bindType;
+ }
+
+ public String getBindUserId() {
+ return bindUserId;
+ }
+
+ public void setBindUserId(String bindUserId) {
+ this.bindUserId = bindUserId;
+ }
+
+ @Override
+ public String toString() {
+ return "Info{" +
+ "activeStatus=" + activeStatus +
+ ", bindStatus=" + bindStatus +
+ ", bindType='" + bindType + '\'' +
+ ", bindUserId='" + bindUserId + '\'' +
+ ", erpSnGroup='" + erpSnGroup + '\'' +
+ ", erpSnType='" + erpSnType + '\'' +
+ ", iccid='" + iccid + '\'' +
+ ", ifCarcorder='" + ifCarcorder + '\'' +
+ ", ifImdemo='" + ifImdemo + '\'' +
+ ", ifSocketservice='" + ifSocketservice + '\'' +
+ ", lastActiveCity='" + lastActiveCity + '\'' +
+ ", lastBrandId=" + lastBrandId +
+ ", lastBrandName='" + lastBrandName + '\'' +
+ ", lastCarNum='" + lastCarNum + '\'' +
+ ", lastCarNumEn='" + lastCarNumEn + '\'' +
+ ", lastFortaVersion='" + lastFortaVersion + '\'' +
+ ", lastModelId=" + lastModelId +
+ ", lastModelName='" + lastModelName + '\'' +
+ ", sn='" + sn + '\'' +
+ ", snGroupDetail='" + snGroupDetail + '\'' +
+ ", songTypeTop2='" + songTypeTop2 + '\'' +
+ ", userNickName='" + userNickName + '\'' +
+ ", cardIdAge='" + cardIdAge + '\'' +
+ ", headImgUrl='" + headImgUrl + '\'' +
+ ", cardIdSex='" + cardIdSex + '\'' +
+ '}';
+ }
+
+ public String getErpSnGroup() {
+ return erpSnGroup;
+ }
+
+ public void setErpSnGroup(String erpSnGroup) {
+ this.erpSnGroup = erpSnGroup;
+ }
+
+ public String getErpSnType() {
+ return erpSnType;
+ }
+
+ public void setErpSnType(String erpSnType) {
+ this.erpSnType = erpSnType;
+ }
+
+ public String getIccid() {
+ return iccid;
+ }
+
+ public void setIccid(String iccid) {
+ this.iccid = iccid;
+ }
+
+ public String getIfCarcorder() {
+ return ifCarcorder;
+ }
+
+ public void setIfCarcorder(String ifCarcorder) {
+ this.ifCarcorder = ifCarcorder;
+ }
+
+ public String getIfImdemo() {
+ return ifImdemo;
+ }
+
+ public void setIfImdemo(String ifImdemo) {
+ this.ifImdemo = ifImdemo;
+ }
+
+ public String getIfSocketservice() {
+ return ifSocketservice;
+ }
+
+ public void setIfSocketservice(String ifSocketservice) {
+ this.ifSocketservice = ifSocketservice;
+ }
+
+ public String getLastActiveCity() {
+ return lastActiveCity;
+ }
+
+ public void setLastActiveCity(String lastActiveCity) {
+ this.lastActiveCity = lastActiveCity;
+ }
+
+ public Long getLastBrandId() {
+ return lastBrandId;
+ }
+
+ public void setLastBrandId(Long lastBrandId) {
+ this.lastBrandId = lastBrandId;
+ }
+
+ public String getLastBrandName() {
+ return lastBrandName;
+ }
+
+ public void setLastBrandName(String lastBrandName) {
+ this.lastBrandName = lastBrandName;
+ }
+
+ public String getLastCarNum() {
+ return lastCarNum;
+ }
+
+ public void setLastCarNum(String lastCarNum) {
+ this.lastCarNum = lastCarNum;
+ }
+
+ public String getLastCarNumEn() {
+ return lastCarNumEn;
+ }
+
+ public void setLastCarNumEn(String lastCarNumEn) {
+ this.lastCarNumEn = lastCarNumEn;
+ }
+
+ public String getLastFortaVersion() {
+ return lastFortaVersion;
+ }
+
+ public void setLastFortaVersion(String lastFortaVersion) {
+ this.lastFortaVersion = lastFortaVersion;
+ }
+
+ public Long getLastModelId() {
+ return lastModelId;
+ }
+
+ public void setLastModelId(Long lastModelId) {
+ this.lastModelId = lastModelId;
+ }
+
+ public String getLastModelName() {
+ return lastModelName;
+ }
+
+ public void setLastModelName(String lastModelName) {
+ this.lastModelName = lastModelName;
+ }
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public String getSnGroupDetail() {
+ return snGroupDetail;
+ }
+
+ public void setSnGroupDetail(String snGroupDetail) {
+ this.snGroupDetail = snGroupDetail;
+ }
+
+ public String getSongTypeTop2() {
+ return songTypeTop2;
+ }
+
+ public void setSongTypeTop2(String songTypeTop2) {
+ this.songTypeTop2 = songTypeTop2;
+ }
+
+ public String getUserNickName() {
+ return userNickName;
+ }
+
+ public void setUserNickName(String userNickName) {
+ this.userNickName = userNickName;
+ }
+
+ }
+
+ @Override
+ public String toString() {
+ return "Result{" +
+ "info=" + info +
+ '}';
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "UserInfoEntity{" +
+ "result=" + result +
+ '}';
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/CarStatusListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/CarStatusListener.java
new file mode 100644
index 0000000000..f147a94a7c
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/CarStatusListener.java
@@ -0,0 +1,23 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.map.location.MogoLocation;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/13 11:02 AM
+ * desc : 车辆速度状态回调
+ *
+ * version: 1.0
+ */
+public interface CarStatusListener {
+ /**
+ * 当车辆从 行驶状态 进入 的时候回调
+ */
+ void onCarDriving2Stop(MogoLocation location);
+
+ /**
+ * 当车辆从 停车状态 进入 行驶状态 的时候回调
+ */
+ void onCarStop2Driving(MogoLocation location);
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java
new file mode 100644
index 0000000000..0bbc8473b1
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java
@@ -0,0 +1,299 @@
+package com.mogo.module.v2x.listener;
+
+import android.content.Context;
+
+import com.mogo.commons.debug.DebugConfig;
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.location.IMogoLocationListener;
+import com.mogo.map.location.MogoLocation;
+import com.mogo.map.overlay.IMogoPolyline;
+import com.mogo.map.search.geo.IMogoGeoSearchListener;
+import com.mogo.map.search.geo.MogoGeocodeResult;
+import com.mogo.map.search.geo.MogoRegeocodeResult;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerResponse;
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.common.entity.V2XPushMessageEntity;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.service.Utils;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.alarm.V2XAlarmServer;
+import com.mogo.module.v2x.network.V2XRefreshCallback;
+import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
+import com.mogo.module.v2x.utils.ADASUtils;
+import com.mogo.module.v2x.utils.DrivingDirectionUtils;
+import com.mogo.module.v2x.utils.LocationUtils;
+import com.mogo.module.v2x.utils.MarkerUtils;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/9 2:31 PM
+ * desc : V2X中用到的位置监听。处理刷新频率,以及位置改变是否触发道路事件警报
+ * version: 1.0
+ */
+public class V2XLocationListener implements IMogoLocationListener, CarStatusListener {
+ private String TAG = "V2XLocationListener";
+
+ private MogoLocation mLastCarLocation;
+ // 记录历史行驶轨迹,用于车行驶方向计算,只保留两个数据
+ private MogoLocation[] historyPath = new MogoLocation[2];
+ // 触发刷新的距离
+ private final int minDistance = 200;
+
+ private static V2XLocationListener mV2XLocationListener;
+
+ private V2XLocationListener() {
+ }
+
+ public synchronized static V2XLocationListener getInstance() {
+ synchronized (V2XLocationListener.class) {
+ if (mV2XLocationListener == null) {
+ mV2XLocationListener = new V2XLocationListener();
+ }
+ }
+ return mV2XLocationListener;
+ }
+
+ @Override
+ public void onLocationChanged(MogoLocation location) {
+ try {
+ Logger.d(V2XConst.MODULE_NAME, "V2X预警--onLocationChanged: " + GsonUtil.jsonFromObject(location));
+
+ // 刷新角度
+ getCurrentCarAngle(location);
+
+ // 只有车速大于 5 的时候进行计算
+ if (location.getSpeed() >= 5) {
+ refreshCurrentCarState(location);
+ }
+
+ // 车速从10降为0 这里统一交到 计算中心服务 进行计算,相应的状态会通过回调的方式调用
+ V2XServiceManager.getV2XCalculateServer().addCarStatusListener(TAG, this);
+ V2XServiceManager.getV2XCalculateServer().addCarTrajectory(location);
+
+ // 下面是道路刷新逻辑
+ if (mLastCarLocation == null) {
+ V2XServiceManager.getV2XMarkerService().refreshMarkerData(location);
+ mLastCarLocation = location;
+ }
+ // 计算车辆距离指定气泡的距离
+ float calculateDistance = Utils.calculateLineDistance(
+ new MogoLatLng(location.getLatitude(), location.getLongitude()),
+ new MogoLatLng(mLastCarLocation.getLatitude(), mLastCarLocation.getLongitude())
+ );
+
+ // 行驶距离 > 200M 重新请求
+ if (calculateDistance > minDistance) {
+ // Logger.d(MODULE_NAME, "V2X预警--移动距离>100米,重新刷新道路事件");
+ V2XServiceManager.getV2XMarkerService().refreshMarkerData(location);
+ mLastCarLocation = location;
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param location 刷新当前车辆状态
+ */
+ private void refreshCurrentCarState(MogoLocation location) {
+ // 如果有道路事件正在预警的时候这里实时进行更新绘制
+ IMogoPolyline mMogoPolyline = V2XServiceManager.getMoGoV2XPolylineManager().getMogoPolyline();
+ if (mMogoPolyline != null && (V2XServiceManager.getMoGoV2XStatusManager().isRoadEventPOIShow()
+ || V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpPOIShow())
+ && V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng() != null) {
+ mMogoPolyline.setPoints(Arrays.asList(new MogoLatLng(location.getLatitude(), location.getLongitude()),
+ V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng()));
+
+ float zoomLevel = V2XServiceManager.getMapUIController().getZoomLevel();
+ //Logger.d(V2XConst.MODULE_NAME, "当前地图的缩放比例为:" + zoomLevel);
+ if (zoomLevel <= 17 && !V2XServiceManager.getMoGoV2XStatusManager().isRoadEventWindowShow()) {
+ // 缩放地图
+ Context context = V2XServiceManager.getContext();
+ MarkerUtils.zoomMap(V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng(), context);
+ }
+ }
+
+ // 只有自研车机才有疲劳驾驶检测
+ if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
+ V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> {
+ Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity));
+
+ String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2";
+ trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style);
+
+ V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>();
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING);
+ v2XMessageEntity.setContent(drivingShowEntity);
+ v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow());
+ // 广播给ADAS Launcher
+ ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity);
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ });
+ }
+
+ // 巡航处理
+ V2XRoadEventEntity v2XRoadEventEntity =
+ V2XAlarmServer.getDriveFrontAlarmEvent(
+ V2XServiceManager.getMoGoV2XMarkerManager().getV2XRoadEventEntityList(),
+ V2XServiceManager.getV2XStatusManager().getLocation());
+ // 距离是否大于10米 && 消息是否不为空
+ if (v2XRoadEventEntity != null && v2XRoadEventEntity.getDistance() >= 5) {
+ Logger.w(MODULE_NAME,
+ //"\nV2X预警--当前导航状态:" + V2XServiceManager.getNavi().isNaviing() +
+ //"\nV2X预警--roadEventIsNullCount:" + roadEventIsNullCount +
+ "\nV2X预警--当前预警事件:" + v2XRoadEventEntity
+ );
+ // Logger.w(MODULE_NAME, "V2X预警--前方数据距离:" + v2XRoadEventEntity.getDistance());
+ // 触发展示操作
+ V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>();
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
+ v2XMessageEntity.setContent(v2XRoadEventEntity);
+ v2XMessageEntity.setShowState(true);
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ }
+ }
+
+ public MogoLocation getLastCarLocation() {
+ try {
+ if (mLastCarLocation == null) {
+ MogoLatLng mogoLatLng = V2XServiceManager.getNavi().getCarLocation();
+ mLastCarLocation = new MogoLocation();
+ if (mogoLatLng != null) {
+ mLastCarLocation.setLongitude(mogoLatLng.getLon());
+ mLastCarLocation.setLatitude(mogoLatLng.getLat());
+ } else {
+ mLastCarLocation.setLongitude(0.0);
+ mLastCarLocation.setLatitude(0.0);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return mLastCarLocation;
+ }
+
+ /**
+ * 获取当前车辆的行驶方向 0<=Angle<=360
+ *
+ * @return 0<= Angle < = 3 6 0
+ */
+ private void getCurrentCarAngle(MogoLocation location) {
+ // 记录位置轨迹
+ if (historyPath[0] != null) {
+ historyPath[1] = historyPath[0];
+ }
+ historyPath[0] = location;
+
+ if (historyPath[1] != null && historyPath[0] != null) {
+ double carAngle =
+ DrivingDirectionUtils.getCarAngle(
+ historyPath[1].getLatitude(), historyPath[1].getLongitude(),
+ historyPath[0].getLatitude(), historyPath[0].getLongitude()
+ );
+
+ //Logger.d(MODULE_NAME,
+ // "\n车辆经纬度:" + Arrays.toString(historyPath) +
+ // "\n车辆角度:" + carAngle);
+ // 这里是真实的车辆角度
+ location.setBearing((float) carAngle);
+ } else {
+ //Logger.e(MODULE_NAME,
+ // "\n首次获取经纬度,默认车头朝北:" + Arrays.toString(historyPath));
+ location.setBearing(0.0f);
+ }
+ V2XServiceManager.getV2XStatusManager().setLocation(location);
+ }
+
+ /**
+ * 获取定位相关信息
+ */
+ private void getLocationInfo(MogoLocation location) {
+ // 定位当前位置是否是高速
+ LocationUtils.geoCodeSearch(location, new IMogoGeoSearchListener() {
+ @Override
+ public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) {
+ Logger.i(MODULE_NAME, " 根据经纬度查询结果为:" + regeocodeResult.getRegeocodeAddress().getFormatAddress());
+ location.setAddress(regeocodeResult.getRegeocodeAddress().getFormatAddress());
+ // 如果有 "高速"、"环线"、"快速路"等字眼的,视为封闭式道路,流程结束;
+ if (regeocodeResult.getRegeocodeAddress().getFormatAddress().contains("高速")
+ || regeocodeResult.getRegeocodeAddress().getFormatAddress().contains("环线")
+ || regeocodeResult.getRegeocodeAddress().getFormatAddress().contains("快速路")) {
+ } else {
+ searchIllegalParkData();
+ }
+ }
+
+ @Override
+ public void onGeocodeSearched(MogoGeocodeResult geocodeResult) {
+ }
+ });
+ }
+
+ /**
+ * 查询50米的违章停车数据
+ */
+ private void searchIllegalParkData() {
+ double lon = V2XServiceManager.getV2XStatusManager().getLocation().getLongitude();
+ double lat = V2XServiceManager.getV2XStatusManager().getLocation().getLatitude();
+
+ V2XServiceManager.getV2XRefreshModel()
+ .queryIllegalPark(new V2XRefreshCallback() {
+ @Override
+ public void onSuccess(MarkerResponse result) {
+ Logger.i(MODULE_NAME, "搜索附近的违章停车点 成功:" + GsonUtil.jsonFromObject(result));
+ if (result != null) {
+ if (result.getResult().getExploreWay().size() > 0) {
+ V2XMessageEntity> entity = new V2XMessageEntity<>();
+ entity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING);
+ entity.setContent(result.getResult().getExploreWay());
+ entity.setShowState(true);
+ V2XScenarioManager.getInstance().handlerMessage(entity);
+ }
+ }
+ }
+
+ @Override
+ public void onFail(String msg) {
+ Logger.e(MODULE_NAME, "搜索附近的违章停车点 失败:" + msg);
+ }
+ }, lon, lat);
+ }
+
+
+ @Override
+ public void onCarDriving2Stop(MogoLocation location) {
+ // 推迟30s主Launcher中的大而全的POI刷新时间
+ V2XServiceManager.getIMogoRefreshStrategyController().restartAutoRefreshAtTime(30000);
+ getLocationInfo(location);
+ }
+
+ @Override
+ public void onCarStop2Driving(MogoLocation location) {
+
+ }
+
+ //埋点
+ private static void trackWithType(String type, double lon, double lat, String style) {
+ Map properties = new HashMap<>();
+ properties.put("type", type);
+ properties.put("lng", lon);
+ properties.put("lat", lat);
+ properties.put("style", style);
+ V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMarkerClickListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMarkerClickListener.java
new file mode 100644
index 0000000000..cb79510fc4
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMarkerClickListener.java
@@ -0,0 +1,129 @@
+package com.mogo.module.v2x.listener;
+
+import android.text.TextUtils;
+
+import com.mogo.map.marker.IMogoMarker;
+import com.mogo.map.marker.IMogoMarkerClickListener;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.common.entity.MarkerOnlineCar;
+import com.mogo.module.common.entity.MarkerShowEntity;
+import com.mogo.module.service.ServiceConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.v2x.utils.ChartingUtil;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/7 7:13 PM
+ * desc :
+ * version: 1.0
+ */
+public class V2XMarkerClickListener implements IMogoMarkerClickListener {
+
+ private static V2XMarkerClickListener markerClickListener;
+
+ // 最后一次选中的气泡
+ private IMogoMarker mLastCheckMarker;
+
+ private V2XMarkerClickListener() {
+ }
+
+ public synchronized static V2XMarkerClickListener getInstance() {
+ synchronized (V2XMarkerClickListener.class) {
+ if (markerClickListener == null) {
+ markerClickListener = new V2XMarkerClickListener();
+ }
+ }
+ return markerClickListener;
+ }
+
+ @Override
+ public boolean onMarkerClicked(IMogoMarker marker) {
+ try {
+ if (mLastCheckMarker != null) {
+ // 判断点击的是否是同一个
+ if (marker.equals(mLastCheckMarker)) {
+ Logger.d(MODULE_NAME, "onMarkerClicked 与上一次点击的Marker一样,不做处理:" + marker);
+ // 判断是在线车辆的时候处理打电话场景
+ try {
+ Object object = marker.getObject();
+ if (object != null) {
+ // 修改数据
+ MarkerShowEntity showEntity = (MarkerShowEntity) object;
+ if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)) {
+ Object bindObj = showEntity.getBindObj();
+ if (bindObj instanceof MarkerOnlineCar) {
+ MarkerLocation location = new MarkerLocation();
+ location.setLon(marker.getPosition().getLon());
+ location.setLat(marker.getPosition().getLat());
+ ChartingUtil.callChatting(
+ ((MarkerOnlineCar) bindObj).getUserInfo(),
+ location
+ );
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+ // 关闭上次的气泡
+ V2XServiceManager.getMoGoV2XMarkerManager().closeMarker(V2XServiceManager.getContext(), mLastCheckMarker);
+ }
+ // 将当前的Marker设置为选中
+ mLastCheckMarker = V2XServiceManager.getMoGoV2XMarkerManager().openMarker(V2XServiceManager.getContext(), marker);
+
+ // marker点击展示上半部分的浮窗,只加了道路事件
+ Object nov = marker.getObject();
+ Logger.d(MODULE_NAME, "marker点击====" + nov);
+ if (nov != null) {
+ MarkerShowEntity showEntity = (MarkerShowEntity) nov;
+ if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_NOVELTY)) {
+ Object bindObj = showEntity.getBindObj();
+ if (bindObj instanceof MarkerExploreWay) {
+ MarkerExploreWay noveltyInfo = (MarkerExploreWay) bindObj;
+ Logger.d(MODULE_NAME, "新鲜事marker点击===" + bindObj);
+ V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
+ v2XRoadEventEntity.setLocation(noveltyInfo.getLocation());
+ v2XRoadEventEntity.setPoiType(noveltyInfo.getPoiType());
+ v2XRoadEventEntity.setNoveltyInfo(noveltyInfo);
+ v2XRoadEventEntity.setExpireTime(20000);
+ v2XRoadEventEntity.setDistance(1000);
+ //V2XServiceManager.getMoGoV2XScenarioManager().showRoadEventWindow(v2XRoadEventEntity, false);
+ return true;
+ }
+ } else if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_ROAD_CONDITION)) {
+ Object bindObj = showEntity.getBindObj();
+ if (bindObj instanceof MarkerExploreWay) {
+ MarkerExploreWay markerExploreWay = (MarkerExploreWay) bindObj;
+ if (markerExploreWay.getItems().size() > 0
+ && !TextUtils.isEmpty(markerExploreWay.getItems().get(0).getUrl())) {
+ Logger.d(MODULE_NAME, "MarkerExploreWay点击===" + bindObj);
+ // 记录道路事件
+ V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
+ v2XRoadEventEntity.setLocation(markerExploreWay.getLocation());
+ // 探路目前只有上报拥堵
+ v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.FOURS_BLOCK_UP);
+
+ v2XRoadEventEntity.setDistance(1000);
+ v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
+ v2XRoadEventEntity.setExpireTime(20000);
+ //V2XServiceManager.getMoGoV2XScenarioManager().showRoadEventWindow(v2XRoadEventEntity, false);
+ return true;
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java
new file mode 100644
index 0000000000..57e1a24978
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java
@@ -0,0 +1,113 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.common.entity.V2XPushMessageEntity;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
+import com.mogo.module.v2x.utils.ADASUtils;
+import com.mogo.module.v2x.utils.MarkerUtils;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.TipToast;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc :
+ * ADAS & V2X 场景触发push
+ * TODO 前瞻需求,这里是后台下发 http://h5service.zhidaohulian.com/v2x_remoteControl/#/
+ * version: 1.0
+ */
+public class V2XMessageListener_401003 implements IMogoOnMessageListener {
+
+ @Override
+ public Class target() {
+ return V2XPushMessageEntity.class;
+ }
+
+ @Override
+ public void onMsgReceived(V2XPushMessageEntity message) {
+ Logger.i(MODULE_NAME, "V2XMessageListener_401003:" + GsonUtil.jsonFromObject(message));
+ V2XUtils.runOnUiThread(() -> {
+ try {
+ handlerV2XAlarm(message);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ });
+ }
+
+ /**
+ * 处理V2X场景
+ *
+ * @param alarmMessage V2X消息
+ */
+ private void handlerV2XAlarm(V2XPushMessageEntity alarmMessage) {
+ // 绘制道路事件
+ //Logger.w(MODULE_NAME, "处理V2X场景SceneId==" + alarmMessage.getSceneId());
+
+ // 修改地图比例尺
+ if (alarmMessage.getZoomScale() > 0) {
+ V2XServiceManager.getMoGoStatusManager().setUserInteractionStatus(MODULE_NAME, true, true);
+ MarkerUtils.resetMapZoom(alarmMessage.getZoomScale());
+ }
+
+ V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>();
+ switch (alarmMessage.getSceneId()) {
+ case "100000"://前车碰撞预警
+ case "100001"://车道偏离预警
+ //V2XWindowManager.removeAllV2XView();
+ break;
+
+ // 下面的场景,地图缩小,显示30秒直播小视频,视频播放结束恢复地图比例尺
+ case "100002"://盲区换道警告
+ case "100003"://盲区行人碰撞预警
+ case "100009"://危险路段(施工)告警
+ case "100010"://拥堵告警
+ case "100004"://逆向超车碰撞预警
+ case "100011"://失控车辆告警
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING);
+ v2XMessageEntity.setContent(alarmMessage);
+ v2XMessageEntity.setShowState(true);
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ break;
+ // 下面的场景禁行动画效果展示
+ case "100005"://前车紧急制动告警
+ case "100006"://十字路口碰撞预警
+ case "100007"://岔路口碰撞预警
+ case "100008"://禁行车道预警
+ case "100012"://应急车辆优先通行
+ case "100013"://闯红灯预警
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ANIMATION_WARNING);
+ v2XMessageEntity.setContent(alarmMessage);
+ v2XMessageEntity.setShowState(true);
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ break;
+ case "100015"://取快递
+ case "100016"://顺风车
+ case "100017"://政府公告
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING);
+ v2XMessageEntity.setContent(alarmMessage);
+ v2XMessageEntity.setShowState(true);
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ break;
+ case "100014"://行人点赞
+ showTip(alarmMessage.getTts());
+ ADASUtils.broadcastToADAS_TTS(V2XServiceManager.getContext(), alarmMessage);
+ break;
+ default:
+ ADASUtils.broadcastToADAS_TTS(V2XServiceManager.getContext(), alarmMessage);
+ break;
+ }
+ }
+
+ private void showTip(String msg) {
+ TipToast.tip(msg);
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java
new file mode 100644
index 0000000000..0a790863af
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java
@@ -0,0 +1,94 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
+import com.mogo.module.v2x.utils.MarkerUtils;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc : 特殊车辆推送绘制
+ * version: 1.0
+ */
+public class V2XMessageListener_401005 implements IMogoOnMessageListener {
+ @Override
+ public Class target() {
+ return V2XSpecialCarRes.class;
+ }
+
+ @Override
+ public void onMsgReceived(V2XSpecialCarRes message) {
+ Logger.i(MODULE_NAME, "V2XMessageListener_401005:" + GsonUtil.jsonFromObject(message));
+ if (!V2XServiceManager.getMoGoV2XStatusManager().isRoadEventWindowShow()) {
+ V2XUtils.runOnBackgroundThread(() -> {
+ try {
+ MarkerUtils.handlerV2XSpecialVehicleMarker(
+ message,
+ V2XServiceManager.getContext(),
+ V2XMarkerClickListener.getInstance());
+
+ //获取经纬度信息
+ //根据sn获取用户信息
+ //V2XWindowManager展示
+ handleSeekHelp(message);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ });
+ }
+ }
+
+
+ /**
+ * 处理故障求助
+ */
+ private void handleSeekHelp(V2XSpecialCarRes message) {
+ if (message == null) {
+ return;
+ }
+ V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_MARKER_SPECIAL_CAR);
+ List coordinates = message.getCoordinates();
+ List entityList = new ArrayList<>();
+ // 移除上一次的数据
+ //Context context = V2XServiceManager.getContext();
+
+ for (V2XMarkerEntity coordinate : coordinates) {
+ //故障车机
+ if (coordinate.getTargetId() == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING) {
+ //V2XMarkerEntity.UserInfoBean userInfoBean = coordinate.getUserInfo();
+ //if (userInfoBean != null) {
+ entityList.add(coordinate);
+ //}
+ //绘制
+ //V2XServiceManager
+ // .getMoGoV2XMarkerManager()
+ // .drawableSpecialCarPOI(context, coordinate, V2XMarkerClickListener.getInstance());
+ }
+ }
+ if (!entityList.isEmpty()) {
+ //V2XUtils.runOnUiThread(() -> V2XServiceManager.getMoGoV2XScenarioManager().showOtherSeekHelpWindow(entityList));
+ V2XUtils.runOnUiThread(() -> {
+ V2XMessageEntity> v2XMessageEntity = new V2XMessageEntity<>();
+ v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING);
+ v2XMessageEntity.setContent(entityList);
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ });
+ }
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401006.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401006.java
new file mode 100644
index 0000000000..def6c3032b
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401006.java
@@ -0,0 +1,30 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.module.v2x.entity.net.V2XAlarmEventRes;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc :
+ * 3.2.1、前方静止or慢速车辆报警
+ * 3.2.2、道路危险状况告警 / 前方拥堵告警
+ * version: 1.0
+ */
+@Deprecated
+public class V2XMessageListener_401006 implements IMogoOnMessageListener {
+
+ @Override
+ public Class target() {
+ return V2XAlarmEventRes.class;
+ }
+
+ @Override
+ public void onMsgReceived(V2XAlarmEventRes message) {
+ Logger.i(MODULE_NAME, "iMogoOnMessageListener_401006:" + message);
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401007.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401007.java
new file mode 100644
index 0000000000..fe6d581741
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401007.java
@@ -0,0 +1,48 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.module.service.MarkerServiceHandler;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.entity.net.V2XAlarmEventRes;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.v2x.utils.ADASUtils;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.logger.Logger;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc : 限行通知
+ * version: 1.0
+ */
+public class V2XMessageListener_401007 implements IMogoOnMessageListener {
+ @Override
+ public Class target() {
+ return V2XAlarmEventRes.class;
+ }
+
+ @Override
+ public void onMsgReceived(V2XAlarmEventRes message) {
+ Logger.i(MODULE_NAME, "V2XMessageListener_401007:" + message);
+ try {
+ if (message != null) {
+
+ // 发送广播
+ V2XAlarmEventRes.AlarmInfo alarmInfo = message.getResult().getAlarmInfo();
+ ADASUtils.broadcastToADAS_TTS(V2XServiceManager.getContext(), alarmInfo);
+
+ // 统计代码
+ final Map properties = new HashMap<>();
+ properties.put("warning_id", V2XPoiTypeEnum.ALERT_TRAFFIC_CONTROL);
+ MarkerServiceHandler.getMogoAnalytics().track("v2x_warning", properties);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401009.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401009.java
new file mode 100644
index 0000000000..2b081aba24
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401009.java
@@ -0,0 +1,50 @@
+package com.mogo.module.v2x.listener;
+
+import android.view.Gravity;
+import android.view.LayoutInflater;
+
+import com.mogo.module.v2x.R;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.common.entity.V2XPushMessageEntity;
+import com.mogo.module.v2x.entity.net.V2XGiveLike;
+import com.mogo.module.v2x.utils.ADASUtils;
+import com.mogo.module.v2x.utils.ToastUtils;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc :
+ * * 2.0.2
+ * * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=35786774
+ * * 注册点赞通信接收
+ * version: 1.0
+ */
+public class V2XMessageListener_401009 implements IMogoOnMessageListener {
+ @Override
+ public Class target() {
+ return V2XGiveLike.class;
+ }
+
+ @Override
+ public void onMsgReceived(V2XGiveLike message) {
+ Logger.i(MODULE_NAME, "V2XMessageListener_401009:" + message);
+ try {
+ V2XPushMessageEntity v2XAlarmMessage = new V2XPushMessageEntity();
+ v2XAlarmMessage.setTts(message.getResult());
+ v2XAlarmMessage.setAlarmContent(message.getResult());
+ v2XAlarmMessage.setExpireTime(20000);
+ v2XAlarmMessage.setSceneId("000000");
+ ADASUtils.broadcastToADAS_TTS(V2XServiceManager.getContext(), v2XAlarmMessage);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ ToastUtils.setGravity(Gravity.CENTER, 0, 0);
+ ToastUtils.showCustomLong(LayoutInflater.from(V2XServiceManager.getContext()).inflate(R.layout.toast_view_feedback_img_text, null));
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401010.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401010.java
new file mode 100644
index 0000000000..16883842ff
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401010.java
@@ -0,0 +1,47 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.module.v2x.entity.net.V2XAlarmEventRes;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.logger.Logger;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc :
+ * * 2.0.3
+ * * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=35788659
+ * * TODO 停车场、加油站推送心跳,这里是前瞻的功能,目前仅在分体机使用,
+ * version: 1.0
+ */
+@Deprecated
+public class V2XMessageListener_401010 implements IMogoOnMessageListener {
+
+ @Override
+ public Class target() {
+ return V2XAlarmEventRes.class;
+ }
+
+ @Override
+ public void onMsgReceived(V2XAlarmEventRes message) {
+ Logger.i(MODULE_NAME, "V2XMessageListener_401010:" + message);
+ try {
+ if (message != null
+ && message.getResult() != null) {
+
+ // 处理报警事件
+ handlerAlarmInfo();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 处理道路事件提醒
+ */
+ private void handlerAlarmInfo() {
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java
new file mode 100644
index 0000000000..728898f2f4
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java
@@ -0,0 +1,43 @@
+package com.mogo.module.v2x.listener;
+
+import com.mogo.module.common.entity.MarkerCardResult;
+import com.mogo.module.common.entity.MarkerResponse;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/1 10:23 AM
+ * desc : 道路事件,实际就是大而全的数据进行的过滤
+ * version: 1.0
+ */
+public class V2XMessageListener_401011 implements IMogoOnMessageListener {
+
+ @Override
+ public Class target() {
+ return MarkerResponse.class;
+ }
+
+ @Override
+ public void onMsgReceived(MarkerResponse response) {
+ Logger.d(MODULE_NAME, "V2XMessageListener_401011==V2X地图气泡数据刷新:\n" + GsonUtil.jsonFromObject(response));
+ if (!V2XServiceManager.getMoGoV2XStatusManager().isRoadEventWindowShow()) {
+ V2XUtils.runOnBackgroundThread(() -> {
+ // 解析不同的Marker类型,然后对应的进行绘制
+ if (response != null && response.getResult() != null) {
+ MarkerCardResult markerCardResult = response.getResult();
+ // 解析存储道路事件
+ //V2XServiceManager.getMoGoV2XMarkerManager().drawableV2XMarker(markerCardResult);
+ V2XServiceManager.getMoGoV2XMarkerManager().analysisV2XRoadEvent(markerCardResult);
+ }
+ });
+ }
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XWindowStatusListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XWindowStatusListener.java
new file mode 100644
index 0000000000..41d26f5d34
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XWindowStatusListener.java
@@ -0,0 +1,14 @@
+package com.mogo.module.v2x.listener;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/15 10:20 AM
+ * desc : V2X 窗体状态回调
+ * version: 1.0
+ */
+public interface V2XWindowStatusListener {
+ void onViewShow();
+
+ void onViewClose();
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XMarkerManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XMarkerManager.java
new file mode 100644
index 0000000000..f1e987d46d
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XMarkerManager.java
@@ -0,0 +1,163 @@
+package com.mogo.module.v2x.manager;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.template.IProvider;
+import com.mogo.map.marker.IMogoMarker;
+import com.mogo.map.marker.IMogoMarkerClickListener;
+import com.mogo.module.common.entity.MarkerCardResult;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerNoveltyInfo;
+import com.mogo.module.common.entity.MarkerOnlineCar;
+import com.mogo.module.common.entity.MarkerShowEntity;
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 8:15 PM
+ * desc : V2X 涉及到的地图 POI 点的绘制
+ * version: 1.0
+ */
+public interface IMoGoV2XMarkerManager extends IProvider {
+
+ /**
+ * 重新绘制最后一次的POI点
+ */
+ void drawableLastAllPOI();
+
+ /**
+ * 获取所有的道路事件点,探路事件,返回结果是按照距离当前车辆从近到远排列好的
+ *
+ * @return 按从近到远排列好的道路事件
+ */
+ CopyOnWriteArrayList getV2XRoadEventEntityList();
+
+ /**
+ * 从探路数据和新鲜事儿的路况信息中解析出道路事件信息
+ */
+ void analysisV2XRoadEvent(MarkerCardResult markerCardResult);
+
+ /**
+ * 绘制V2X 地图点事件
+ *
+ * @param markerCardResult 大而全中过滤出来的点事件
+ */
+ void drawableV2XMarker(MarkerCardResult markerCardResult);
+
+ /**
+ * 绘制 在线车辆 POI
+ *
+ * @param markerOnlineCars
+ * @param clickListener
+ */
+ void drawableOnlineCarPOI(List markerOnlineCars, IMogoMarkerClickListener clickListener);
+
+ /**
+ * 清除 在线车辆 POI
+ */
+ void clearOnlineCarPOI();
+
+ /**
+ * 绘制 特殊车辆
+ *
+ * @param context
+ * @param v2XMarkerEntity
+ * @param clickListener
+ */
+ void drawableSpecialCarPOI(Context context, V2XMarkerEntity v2XMarkerEntity, IMogoMarkerClickListener clickListener);
+
+ /**
+ * 清除 特殊车辆 POI
+ */
+ void clearSpecialCarPOI();
+
+ /**
+ * 绘制可以直播的在线车辆
+ *
+ * @param markerOnlineCars
+ * @param clickListener
+ */
+ void drawableLiveCarPOI(List markerOnlineCars, IMogoMarkerClickListener clickListener);
+
+ /**
+ * 清除 可以直播的在线车辆 POI
+ */
+ void clearLiveCarPOI();
+
+ /**
+ * 绘制 探路
+ *
+ * @param exploreWayList
+ * @param clickListener
+ */
+ void drawableExplorePOI(List exploreWayList, IMogoMarkerClickListener clickListener);
+
+ /**
+ * 清除 探路 POI
+ */
+ void clearExplorePOI();
+
+ /**
+ * 绘制 新鲜事儿
+ *
+ * @param noveltyInfoList
+ * @param clickListener
+ */
+ void drawableNoveltyPOI(List noveltyInfoList, IMogoMarkerClickListener clickListener);
+
+ /**
+ * 清除 新鲜事儿 POI
+ */
+ void clearNoveltyPOI();
+
+ /**
+ * 绘制Marker,上面调用的都是这个方法
+ *
+ * @param context
+ * @param markerShowEntity
+ * @param clickListener
+ */
+ void drawableMarker(Context context, MarkerShowEntity markerShowEntity, IMogoMarkerClickListener clickListener);
+
+
+ /**
+ * 展开气泡
+ *
+ * @param context
+ * @param currentMarker
+ */
+ IMogoMarker openMarker(Context context, IMogoMarker currentMarker);
+
+ /**
+ * 关闭气泡
+ *
+ * @param context
+ * @param currentMarker
+ */
+ void closeMarker(Context context, IMogoMarker currentMarker);
+
+ /**
+ * 绘制正在预警的道路事件的POI点
+ *
+ * @param context
+ * @param roadEventEntity
+ */
+ void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener);
+
+ /**
+ * 清除 道路事件 POI
+ */
+ void clearAlarmPOI();
+
+ /**
+ * 清除 所有的 POI
+ */
+ void clearALLPOI();
+
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XPolylineManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XPolylineManager.java
new file mode 100644
index 0000000000..237dd6d0f3
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XPolylineManager.java
@@ -0,0 +1,31 @@
+package com.mogo.module.v2x.manager;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.template.IProvider;
+import com.mogo.map.overlay.IMogoPolyline;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 9:49 PM
+ * desc : 当前车辆与道路事件的连接线
+ * version: 1.0
+ */
+public interface IMoGoV2XPolylineManager extends IProvider {
+ /**
+ * 绘制连接线,目标车,与当前车辆间连线
+ *
+ * @param context
+ * @param roadEventEntity
+ */
+ void drawablePolyline(Context context, V2XRoadEventEntity roadEventEntity);
+
+ /**
+ * 移除连接线
+ */
+ void clearLine();
+
+ IMogoPolyline getMogoPolyline();
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XStatusChangedListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XStatusChangedListener.java
new file mode 100644
index 0000000000..b200d52777
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XStatusChangedListener.java
@@ -0,0 +1,19 @@
+package com.mogo.module.v2x.manager;
+
+import com.alibaba.android.arouter.facade.template.IProvider;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 7:44 PM
+ * desc : 状态控制器监听
+ * version: 1.0
+ */
+public interface IMoGoV2XStatusChangedListener extends IProvider {
+
+ /**
+ * @param descriptor 状态类型
+ * @param isTrue true - v2x ui show
+ */
+ void onStatusChanged(V2XStatusDescriptor descriptor, boolean isTrue);
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XStatusManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XStatusManager.java
new file mode 100644
index 0000000000..ca47257765
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/IMoGoV2XStatusManager.java
@@ -0,0 +1,188 @@
+package com.mogo.module.v2x.manager;
+
+import com.alibaba.android.arouter.facade.template.IProvider;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 7:20 PM
+ * desc : V2X 状态管理
+ * version: 1.0
+ */
+public interface IMoGoV2XStatusManager extends IProvider {
+ /**
+ * 地图区域 V2X道路预警POI 是否在展示
+ */
+ boolean isRoadEventPOIShow();
+
+ /**
+ * 按钮区 V2X道路预警 是否在展示
+ */
+ boolean isRoadEventButtonShow();
+
+ /**
+ * 头部 V2X道路预警 UI 是否在展示
+ */
+ boolean isRoadEventWindowShow();
+
+ /**
+ * 头部 V2X的道路直播 UI 是否在展示
+ */
+ boolean isRoadLiveCarWindowShow();
+
+ /**
+ * 头部 他人车辆故障求助 UI 是否在展示
+ */
+ boolean isOtherSeekHelpWindowShow();
+
+ /**
+ * 地图区域 自身的道路求助按钮 是否在展示
+ */
+ boolean isMeSeekHelpButtonShow();
+
+ /**
+ * 地图区域 他人车辆故障求助POI 是否在展示
+ */
+ boolean isOtherSeekHelpPOIShow();
+
+ /**
+ * 前瞻需求
+ * 右侧2/3 V2X 场景动画 UI 是否在展示
+ */
+ boolean isV2XAnimationShow();
+
+ /**
+ * 前瞻需求
+ * 右侧2/3 左下角 模拟直播车机 UI 是否在展示
+ */
+ boolean isLeftLiveVideoShow();
+
+ /**
+ * 推送弹窗的状态
+ */
+ boolean isPushWindowShow();
+
+ /**
+ * 推送的 POI 状态
+ */
+ boolean isPushPOIShow();
+
+ /**
+ * 疲劳驾驶 状态
+ */
+ boolean isFatigueDrivingWindowShow();
+
+ /**
+ * 设置 V2X道路预警POI 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setRoadEventPOIShow(String tag, boolean show);
+
+ /**
+ * 设置 V2X道路预警 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setRoadEventButtonShow(String tag, boolean show);
+
+ /**
+ * 设置 右侧2/3 头部 V2X道路预警 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setRoadEventWindowShow(String tag, boolean show);
+
+ /**
+ * 设置 右侧2/3 头部 V2X的道路直播 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setRoadLiveCarWindowShow(String tag, boolean show);
+
+ /**
+ * 设置 他人车辆故障求助 UI 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setOtherSeekHelpWindowShow(String tag, boolean show);
+
+ /**
+ * 地图区域 自身的道路求助按钮 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setMeSeekHelpButtonShow(String tag, boolean show);
+
+ /**
+ * 地图区域 他人车辆故障求助POI 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setOtherSeekHelpPOIShow(String tag, boolean show);
+
+ /**
+ * 设置 右侧2/3 全屏 V2X 场景动画 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setV2XAnimationWindowShow(String tag, boolean show);
+
+ /**
+ * 设置 模拟直播车机 UI 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setLiveCarWindowShow(String tag, boolean show);
+
+ /**
+ * 推送弹窗的状态
+ *
+ * @param tag
+ * @param show
+ */
+ void setPushWindowShow(String tag, boolean show);
+
+ /**
+ * 地图区域 推送的 POI 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setPushPOIShow(String tag, boolean show);
+
+ /**
+ * 地图区域 疲劳驾驶 是否在展示
+ *
+ * @param tag
+ * @param show
+ */
+ void setFatigueDrivingWindowShow(String tag, boolean show);
+
+ /**
+ * 注册监听
+ *
+ * @param tag 业务类型
+ * @param descriptor 监听类型
+ * @param listener 监听回调
+ */
+ void registerStatusChangedListener(String tag, V2XStatusDescriptor descriptor, IMoGoV2XStatusChangedListener listener);
+
+ /**
+ * 注销
+ *
+ * @param tag 业务类型
+ * @param descriptor 注销类型
+ * @param listener 注销回调
+ */
+ void unregisterStatusChangedListener(String tag, V2XStatusDescriptor descriptor, IMoGoV2XStatusChangedListener listener);
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/V2XStatusDescriptor.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/V2XStatusDescriptor.java
new file mode 100644
index 0000000000..0cf7973e0a
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/V2XStatusDescriptor.java
@@ -0,0 +1,70 @@
+package com.mogo.module.v2x.manager;
+
+/**
+ * @author congtaowang
+ * @since 2020-01-04
+ *
+ * 状态描述
+ */
+public enum V2XStatusDescriptor {
+
+ /**
+ * 地图 V2X道路预警POI
+ */
+ RoadEventPOI_UI,
+
+ /**
+ * 按钮 V2X道路预警
+ */
+ RoadEventButton_UI,
+
+ /**
+ * 头部 V2X道路预警 UI
+ */
+ RoadEventWindow_UI,
+
+ /**
+ * 头部 V2X的道路直播 UI
+ */
+ RoadLiveCarWindow_UI,
+
+ /**
+ * 地图 他人车辆故障求助POI
+ */
+ OtherSeekHelpPOI_UI,
+
+ /**
+ * 头部 他人车辆故障求助 UI 是否在展示
+ */
+ OtherSeekHelpWindow_UI,
+
+ /**
+ * 头部 自身的道路求助按钮 UI 是否在展示
+ */
+ MeSeekHelpButton_UI,
+
+ /**
+ * 右侧2/3 V2X 场景动画 UI 是否在展示
+ */
+ V2XAnimationWindow_UI,
+
+ /**
+ * 右侧2/3 左下角 模拟直播车机 UI 是否在展示
+ */
+ LiveCarWindow_UI,
+
+ /**
+ * 推送的POI
+ */
+ PushWindowPOI_UI,
+
+ /**
+ * 推送的弹窗
+ */
+ PushWindow_UI,
+
+ /**
+ * 疲劳驾驶弹窗
+ */
+ FatigueDrivingWindow_UI,
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java
new file mode 100644
index 0000000000..bd14999026
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java
@@ -0,0 +1,576 @@
+package com.mogo.module.v2x.manager.impl;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.location.MogoLocation;
+import com.mogo.map.marker.IMogoMarker;
+import com.mogo.map.marker.IMogoMarkerClickListener;
+import com.mogo.map.marker.MogoMarkerOptions;
+import com.mogo.map.uicontroller.EnumMapUI;
+import com.mogo.module.common.entity.MarkerCardResult;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerLocation;
+import com.mogo.module.common.entity.MarkerNoveltyInfo;
+import com.mogo.module.common.entity.MarkerOnlineCar;
+import com.mogo.module.common.entity.MarkerShowEntity;
+import com.mogo.module.service.ServiceConst;
+import com.mogo.module.service.Utils;
+import com.mogo.module.service.marker.IMarkerView;
+import com.mogo.module.service.marker.MapMarkerAdapter;
+import com.mogo.module.service.utils.ViewUtils;
+import com.mogo.module.v2x.MoGoV2XServicePaths;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.v2x.listener.V2XMarkerClickListener;
+import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
+import com.mogo.module.v2x.marker.V2XMarkerAdapter;
+import com.mogo.module.v2x.utils.EventTypeUtils;
+import com.mogo.module.v2x.utils.MarkerUtils;
+import com.mogo.utils.logger.Logger;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
+import static com.mogo.module.v2x.V2XConst.V2X_EVENT_ALARM_POI;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 9:57 PM
+ * desc : V2X 涉及到的地图 POI 点的绘制
+ * version: 1.0
+ */
+@Route(path = MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER)
+public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
+ private static final String TAG = "MoGoV2XMarkerManager";
+
+ // 记录所有的:新鲜事儿的道路事件点、探路事件
+ private static CopyOnWriteArraySet mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>();
+ // 上次的道路事件的预警Marker
+ private static IMogoMarker mAlarmInfoMarker;
+
+ @Override
+ public void drawableLastAllPOI() {
+ //Logger.w(MODULE_NAME, "V2X---绘制上一次的POI,回调给Launcher底层逻辑让其进行绘制");
+ // 清除连接线
+ V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
+ clearAlarmPOI();
+ clearSpecialCarPOI();
+ // 锁车
+ V2XServiceManager.getMapUIController().recoverLockMode();
+ // 开启主Launcher刷新
+ V2XServiceManager.getIMogoRefreshStrategyController().restartAutoRefreshAtTime(0);
+ }
+
+ @Override
+ public CopyOnWriteArrayList getV2XRoadEventEntityList() {
+ CopyOnWriteArrayList roadEventEntities = new CopyOnWriteArrayList<>();
+ // 当前车辆数据
+ MogoLocation currentLocation = V2XServiceManager.getV2XStatusManager().getLocation();
+
+ if (currentLocation != null) {
+ // 重新计算距离
+ for (V2XRoadEventEntity v2XRoadEventEntity : mV2XRoadEventEntityArrayList) {
+ // 事件位置
+ MarkerLocation location = v2XRoadEventEntity.getLocation();
+ if (location != null) {
+ float calculateDistance = Utils.calculateLineDistance(
+ new MogoLatLng(location.getLat(), location.getLon()),
+ new MogoLatLng(currentLocation.getLatitude(), currentLocation.getLongitude())
+ );
+ v2XRoadEventEntity.setDistance(calculateDistance);
+ }
+ roadEventEntities.add(v2XRoadEventEntity);
+ }
+
+ // 按照与当前车辆距离排序
+ for (int i = 0; i < roadEventEntities.size(); i++) {
+ for (int j = i; j > 0; j--) {
+ if (roadEventEntities.get(j).getDistance() < roadEventEntities.get(j - 1).getDistance()) {
+ V2XRoadEventEntity v2XRoadEventEntity = roadEventEntities.get(j - 1);
+ roadEventEntities.set(j - 1, roadEventEntities.get(j));
+ roadEventEntities.set(j, v2XRoadEventEntity);
+ }
+ }
+ }
+ //输出日志查看结果
+// Log.w(TAG, "V2X===============================");
+// for (int i = 0; i < roadEventEntities.size(); i++) {
+// Log.w(TAG, "V2X===" +
+// "事件名称:" + roadEventEntities.get(i).getNoveltyInfo() +
+// "\t 事件距离:" + roadEventEntities.get(i).getDistance());
+// }
+ }
+
+ return roadEventEntities;
+ }
+
+ @Override
+ public void analysisV2XRoadEvent(MarkerCardResult markerCardResult) {
+ // 预警Window状态
+ boolean isShowEventWindow = V2XServiceManager.getMoGoV2XStatusManager().isRoadEventWindowShow();
+ // 预警按钮状态
+ boolean isShowEventButton = V2XServiceManager.getMoGoV2XStatusManager().isRoadEventButtonShow();
+ // 道路求助的window
+ boolean isOtherSeekHelpWindowShow = V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow();
+ try {
+ //当没有预警提示的时候重新绘制地图POI点
+ if (markerCardResult != null && !isShowEventWindow && !isShowEventButton && !isOtherSeekHelpWindowShow) {
+ // 清除上次的道路事件, 这里注意,道路事件的触发和这里是异步操作会触发异常
+ mV2XRoadEventEntityArrayList.clear();
+
+ // 获取探路以及新鲜事儿
+ List exploreWayList = markerCardResult.getExploreWay();
+
+ if (exploreWayList != null) {
+ for (MarkerExploreWay markerExploreWay : exploreWayList) {
+ // 因为目前探路卡片不支持直播,所以这里做了过滤 @李小鹏
+ if (!markerExploreWay.getCanLive()) {
+ if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
+ MarkerLocation markerLocation = markerExploreWay.getLocation();
+ // 记录道路事件
+ V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
+ v2XRoadEventEntity.setLocation(markerLocation);
+ // 探路目前只有上报拥堵
+ v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
+
+ v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
+ v2XRoadEventEntity.setExpireTime(20000);
+ mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void drawableV2XMarker(MarkerCardResult markerCardResult) {
+ // 预警Window状态
+ boolean isShowEventWindow = V2XServiceManager.getMoGoV2XStatusManager().isRoadEventWindowShow();
+ // 预警按钮状态
+ boolean isShowEventButton = V2XServiceManager.getMoGoV2XStatusManager().isRoadEventButtonShow();
+ // 道路求助的window
+ boolean isOtherSeekHelpWindowShow = V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow();
+ try {
+ //当没有预警提示的时候重新绘制地图POI点
+ if (!isShowEventWindow && !isShowEventButton && !isOtherSeekHelpWindowShow) {
+ // 清除上次的道路事件,TODO 这里注意,道路事件的触发和这里是异步操作会触发异常
+ //mV2XRoadEventEntityArrayList.clear();
+ // 清除原来的大而全的新鲜事儿
+ try {
+ clearALLPOI();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // 清除连接线
+ V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
+ if (markerCardResult != null) {
+ // 绘制新的地图气泡
+ List onlineCarList = markerCardResult.getOnlineCar();
+ List exploreWayList = markerCardResult.getExploreWay();
+ List noveltyInfoList = markerCardResult.getNoveltyInfo();
+
+ drawableOnlineCarPOI(onlineCarList, V2XMarkerClickListener.getInstance());
+ drawableExplorePOI(exploreWayList, V2XMarkerClickListener.getInstance());
+ drawableNoveltyPOI(noveltyInfoList, V2XMarkerClickListener.getInstance());
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void drawableOnlineCarPOI(List markerOnlineCars, IMogoMarkerClickListener clickListener) {
+ try {
+ if (markerOnlineCars != null) {
+ for (MarkerOnlineCar markerOnlineCar : markerOnlineCars) {
+ MarkerLocation markerLocation = markerOnlineCar.getLocation();
+
+ MarkerShowEntity markerShowEntity = new MarkerShowEntity();
+ markerShowEntity.setBindObj(markerOnlineCar);
+ markerShowEntity.setMarkerLocation(markerLocation);
+ markerShowEntity.setMarkerType(markerOnlineCar.getType());
+ markerShowEntity.setTextContent(markerOnlineCar.getUserInfo().getSafeLabel());
+ markerShowEntity.setIconUrl(markerOnlineCar.getUserInfo().getUserHead());
+
+ drawableMarker(V2XServiceManager.getContext(), markerShowEntity, clickListener);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearOnlineCarPOI() {
+ V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_CARD_TYPE_USER_DATA);
+ }
+
+ @Override
+ public void drawableSpecialCarPOI(Context context, V2XMarkerEntity v2XMarkerEntity, IMogoMarkerClickListener clickListener) {
+ try {
+ V2XServiceManager.getMapUIController().changeMapMode(EnumMapUI.NorthUP_2D);
+ V2XServiceManager.getMoGoV2XStatusManager().setOtherSeekHelpPOIShow(TAG, true);
+
+ // 绘制特殊车辆
+ if (v2XMarkerEntity == null) {
+ return;
+ }
+ MarkerLocation markerLocation = new MarkerLocation();
+ markerLocation.setLon(v2XMarkerEntity.getLon());
+ markerLocation.setLat(v2XMarkerEntity.getLat());
+
+ // 进行数据转换,用于Marker展示
+ V2XRoadEventEntity roadEventEntity = new V2XRoadEventEntity();
+ roadEventEntity.setPoiType(v2XMarkerEntity.getTargetId() + "");
+ roadEventEntity.setLocation(markerLocation);
+ roadEventEntity.setBindObj(v2XMarkerEntity);
+
+ // 重置告警信息
+ V2XServiceManager.getV2XStatusManager().setAlarmInfo(roadEventEntity);
+
+ // 清除原来的大而全的新鲜事儿
+ clearALLPOI();
+ if (roadEventEntity.getLocation() != null) {
+ // 道路事件,或者水波纹扩散效果
+ MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
+ .object(roadEventEntity)
+ .latitude(roadEventEntity.getLocation().getLat())
+ .longitude(roadEventEntity.getLocation().getLon());
+ optionsRipple.anchor(0.5f, 0.5f);
+
+ // 由于性能问题,D车机不使用事件扩散动画
+ optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
+ mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
+ // 当前Marker设置为最上面
+ mAlarmInfoMarker.setToTop();
+ // 绘制连接线
+ V2XServiceManager.getMoGoV2XPolylineManager().drawablePolyline(context, roadEventEntity);
+ // 缩放地图
+ MarkerUtils.zoomMap(
+ new MogoLatLng(roadEventEntity.getLocation().getLat(),
+ roadEventEntity.getLocation().getLon()
+ ), context);
+ } else {
+ Logger.e(MODULE_NAME, "Location 必须进行初始化!!!!!");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearSpecialCarPOI() {
+ boolean isOtherSeekHelpPOIShow = V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpPOIShow();
+ if (isOtherSeekHelpPOIShow) {
+ V2XServiceManager.getMoGoV2XStatusManager().setOtherSeekHelpPOIShow(TAG, false);
+ // 重置告警信息
+ V2XServiceManager.getV2XStatusManager().setAlarmInfo(null);
+ if (mAlarmInfoMarker != null) {
+ mAlarmInfoMarker.remove();
+ }
+ }
+ }
+
+ @Override
+ public void drawableLiveCarPOI(List markerOnlineCars, IMogoMarkerClickListener clickListener) {
+ try {
+ Logger.w(MODULE_NAME, "V2X===事件周边的直播车机:" + markerOnlineCars);
+ if (markerOnlineCars != null) {
+ for (MarkerOnlineCar markerOnlineCar : markerOnlineCars) {
+ // 设置车类型
+ markerOnlineCar.getUserInfo().setSafeLabelType(4);
+ markerOnlineCar.getCarInfo().setVehicleType(0);
+
+ MarkerLocation markerLocation = markerOnlineCar.getLocation();
+
+ MarkerShowEntity markerShowEntity = new MarkerShowEntity();
+ markerShowEntity.setBindObj(markerOnlineCar);
+ markerShowEntity.setMarkerLocation(markerLocation);
+ markerShowEntity.setMarkerType(V2XConst.V2X_MARKER_LIVE_CAR);
+ markerShowEntity.setTextContent(markerOnlineCar.getUserInfo().getSafeLabel());
+ markerShowEntity.setIconUrl(markerOnlineCar.getUserInfo().getUserHead());
+
+ drawableMarker(
+ V2XServiceManager.getContext(),
+ markerShowEntity,
+ clickListener);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearLiveCarPOI() {
+ V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_MARKER_LIVE_CAR);
+ }
+
+ @Override
+ public void drawableExplorePOI(List exploreWayList, IMogoMarkerClickListener clickListener) {
+ try {
+ if (exploreWayList != null) {
+ for (MarkerExploreWay markerExploreWay : exploreWayList) {
+ // 因为目前探路卡片不支持直播,所以这里做了过滤 @李小鹏
+ if (!markerExploreWay.getCanLive()) {
+ MarkerLocation markerLocation = markerExploreWay.getLocation();
+
+ MarkerShowEntity markerShowEntity = new MarkerShowEntity();
+ markerShowEntity.setBindObj(markerExploreWay);
+ markerShowEntity.setMarkerLocation(markerLocation);
+ markerShowEntity.setMarkerType(markerExploreWay.getType());
+ markerShowEntity.setTextContent(markerExploreWay.getAddr());
+
+ drawableMarker(
+ V2XServiceManager.getContext(),
+ markerShowEntity,
+ clickListener);
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearExplorePOI() {
+ V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_CARD_TYPE_ROAD_CONDITION);
+ }
+
+ @Override
+ public void drawableNoveltyPOI(List noveltyInfoList, IMogoMarkerClickListener clickListener) {
+ try {
+ if (noveltyInfoList != null) {
+ for (MarkerNoveltyInfo noveltyInfo : noveltyInfoList) {
+ MarkerLocation markerLocation = noveltyInfo.getLocation();
+
+ MarkerShowEntity markerShowEntity = new MarkerShowEntity();
+ markerShowEntity.setBindObj(noveltyInfo);
+ markerShowEntity.setMarkerLocation(markerLocation);
+ markerShowEntity.setMarkerType(noveltyInfo.getType());
+ markerShowEntity.setTextContent(noveltyInfo.getLocation().getAddress());
+
+ // 这里只绘制道路事件相关
+ switch (noveltyInfo.getPoiType()) {
+ case V2XPoiTypeEnum.TRAFFIC_CHECK:
+ case V2XPoiTypeEnum.ROAD_CLOSED:
+ case V2XPoiTypeEnum.FOURS_ROAD_WORK:
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ case V2XPoiTypeEnum.FOURS_PONDING:
+ case V2XPoiTypeEnum.FOURS_PARKING:
+ case V2XPoiTypeEnum.FOURS_ICE:
+ case V2XPoiTypeEnum.FOURS_FOG:
+ case V2XPoiTypeEnum.FOURS_ACCIDENT:
+ drawableMarker(
+ V2XServiceManager.getContext(),
+ markerShowEntity,
+ clickListener);
+ break;
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearNoveltyPOI() {
+ V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_CARD_TYPE_NOVELTY);
+ }
+
+ @Override
+ public void drawableMarker(Context context, MarkerShowEntity markerShowEntity, IMogoMarkerClickListener clickListener) {
+// Logger.i(MODULE_NAME, "绘制Marker====drawMapMarker:" + markerShowEntity);
+ try {
+ if (markerShowEntity.getMarkerLocation() != null) {
+ MogoMarkerOptions options = new MogoMarkerOptions()
+ .object(markerShowEntity)
+ .latitude(markerShowEntity.getMarkerLocation().getLat())
+ .longitude(markerShowEntity.getMarkerLocation().getLon());
+
+ // 这里对Marker做下持有者转换,与大而全的区分开,由于绘制的时候用到了低层能力所以不去修改markerShowEntity中的type
+ switch (markerShowEntity.getMarkerType()) {
+ case ServiceConst.CARD_TYPE_USER_DATA:
+ options.owner(V2XConst.V2X_CARD_TYPE_USER_DATA);
+ break;
+ case ServiceConst.CARD_TYPE_NOVELTY:
+ options.owner(V2XConst.V2X_CARD_TYPE_NOVELTY);
+ break;
+ case ServiceConst.CARD_TYPE_ROAD_CONDITION:
+ options.owner(V2XConst.V2X_CARD_TYPE_ROAD_CONDITION);
+ break;
+ case V2XConst.V2X_MARKER_SPECIAL_CAR:
+ options.owner(V2XConst.V2X_MARKER_SPECIAL_CAR);
+ break;
+ case V2XConst.V2X_MARKER_LIVE_CAR:
+ options.owner(V2XConst.V2X_MARKER_LIVE_CAR);
+ break;
+ default:
+ options.owner(markerShowEntity.getMarkerType());
+ break;
+ }
+
+ IMogoMarker marker;
+ Bitmap bitmap;
+ if (markerShowEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
+ || markerShowEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)
+ || markerShowEntity.getMarkerType().equals(V2XConst.V2X_MARKER_LIVE_CAR)
+ || markerShowEntity.getMarkerType().equals(V2XConst.V2X_MARKER_EXPRESS)
+ ) {
+ bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, markerShowEntity);
+ options.icon(bitmap);
+ marker = V2XServiceManager.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
+ } else {
+ IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(context, markerShowEntity, options);
+ bitmap = ViewUtils.fromView(iMarkerView.getView());
+ options.icon(bitmap);
+ marker = V2XServiceManager.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
+ iMarkerView.setMarker(marker);
+ }
+ //marker.setOnMarkerClickListener(clickListener);
+ } else {
+ Logger.e(MODULE_NAME, "Location 必须进行初始化!!!!!");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public IMogoMarker openMarker(Context context, IMogoMarker currentMarker) {
+ try {
+ if (currentMarker != null) {
+ Object object = currentMarker.getObject();
+ if (object != null) {
+ // 修改数据
+ MarkerShowEntity showEntity = (MarkerShowEntity) object;
+ showEntity.setChecked(true);
+
+ // 获取数据对应的View
+ IMarkerView markerView = MapMarkerAdapter.getMarkerView(context,
+ showEntity,
+ currentMarker.getMogoMarkerOptions());
+
+ Bitmap bitmap;
+ if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
+ || showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) {
+ bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity);
+ } else {
+ bitmap = ViewUtils.fromView(markerView.getView());
+ }
+
+ currentMarker.setIcon(bitmap);
+ currentMarker.setToTop();
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return currentMarker;
+ }
+
+ @Override
+ public void closeMarker(Context context, IMogoMarker currentMarker) {
+ try {
+ if (currentMarker != null) {
+ Object object = currentMarker.getObject();
+ if (object != null) {
+ MarkerShowEntity showEntity = (MarkerShowEntity) object;
+ showEntity.setChecked(false);
+ IMarkerView markerView = MapMarkerAdapter.getMarkerView(context,
+ showEntity,
+ currentMarker.getMogoMarkerOptions());
+
+ Bitmap bitmap;
+ if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
+ || showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) {
+ bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity);
+ } else {
+ bitmap = ViewUtils.fromView(markerView.getView());
+ }
+ currentMarker.setIcon(bitmap);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) {
+ try {
+ V2XServiceManager.getMapUIController().changeMapMode(EnumMapUI.NorthUP_2D);
+ V2XServiceManager.getMoGoV2XStatusManager().setRoadEventPOIShow(TAG, true);
+ //Logger.i(MODULE_NAME, "绘制道路事件====drawableAlarmPOI:");
+ // 清除原来的大而全的新鲜事儿
+ clearALLPOI();
+ if (roadEventEntity.getLocation() != null) {
+ // 道路事件,或者水波纹扩散效果
+ MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
+ .object(roadEventEntity)
+ .latitude(roadEventEntity.getLocation().getLat())
+ .longitude(roadEventEntity.getLocation().getLon());
+ optionsRipple.anchor(0.5f, 0.5f);
+
+ // 由于性能问题,D车机不使用事件扩散动画
+ optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
+
+ mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
+ // 当前Marker设置为最上面
+ mAlarmInfoMarker.setToTop();
+ // 绘制连接线
+ V2XServiceManager.getMoGoV2XPolylineManager().drawablePolyline(context, roadEventEntity);
+ // 缩放地图
+ MarkerUtils.zoomMap(
+ new MogoLatLng(roadEventEntity.getLocation().getLat(),
+ roadEventEntity.getLocation().getLon()
+ ), context);
+ } else {
+ Logger.e(MODULE_NAME, "Location 必须进行初始化!!!!!");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearAlarmPOI() {
+ boolean isRoadEventPOIShow = V2XServiceManager.getMoGoV2XStatusManager().isRoadEventPOIShow();
+ if (isRoadEventPOIShow) {
+ V2XServiceManager.getMoGoV2XStatusManager().setRoadEventPOIShow(TAG, false);
+ if (mAlarmInfoMarker != null) {
+ mAlarmInfoMarker.remove();
+ }
+ }
+ }
+
+ @Override
+ public void clearALLPOI() {
+ try {
+ V2XServiceManager.getMarkerManager().removeMarkers();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void init(Context context) {
+
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java
new file mode 100644
index 0000000000..2db8b216c6
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java
@@ -0,0 +1,105 @@
+package com.mogo.module.v2x.manager.impl;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.mogo.map.MogoLatLng;
+import com.mogo.map.overlay.IMogoPolyline;
+import com.mogo.map.overlay.MogoPolylineOptions;
+import com.mogo.module.v2x.MoGoV2XServicePaths;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 10:00 PM
+ * desc : 当前车辆与道路事件的连接线
+ * version: 1.0
+ */
+@Route(path = MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER)
+public class MoGoV2XPolylineManager implements IMoGoV2XPolylineManager {
+ private static final String TAG = "MoGoV2XPolylineManager";
+ private static IMogoPolyline mMogoPolyline;
+
+ @Override
+ public void drawablePolyline(Context context, V2XRoadEventEntity roadEventEntity) {
+ try {
+ if (mMogoPolyline != null) {
+ mMogoPolyline.remove();
+ }
+ if ((V2XServiceManager.getMoGoV2XStatusManager().isRoadEventPOIShow()
+ || V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpPOIShow())
+ && V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng() != null) {
+ // 连接线参数
+ MogoPolylineOptions options = new MogoPolylineOptions();
+
+ // 渐变色
+ List colors = new ArrayList<>();
+
+ switch (roadEventEntity.getPoiType()) {
+ case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST:
+ case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING:
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "":
+ colors.add(0xFFFA8C34);
+ colors.add(0xFFBD6D36);
+ colors.add(0xFFFA8C34);
+ break;
+ default:
+ colors.add(0xFFF95959);
+ colors.add(0xFF942B48);
+ colors.add(0xFFCB253A);
+ break;
+ }
+
+ // 线条粗细,渐变,渐变色值
+ options.width(10).useGradient(true).colorValues(colors);
+
+ // 当前车辆位置
+ MogoLatLng carLocation = V2XServiceManager.getNavi().getCarLocation();
+ if (carLocation != null) {
+ options.add(carLocation);
+ } else {
+ options.add(V2XServiceManager.getV2XStatusManager().getLocation());
+ }
+ // 目标车辆位置
+ options.add(V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng());
+
+ // 绘制线的对象
+ mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
+
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clearLine() {
+ if (mMogoPolyline != null) {
+ mMogoPolyline.remove();
+ mMogoPolyline = null;
+ V2XServiceManager.getV2XStatusManager().setAlarmInfo(null);
+ }
+ }
+
+ @Override
+ public void init(Context context) {
+
+ }
+
+ /**
+ * @return 绘制连接线的对象
+ */
+ @Override
+ public IMogoPolyline getMogoPolyline() {
+ return mMogoPolyline;
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XStatusManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XStatusManager.java
new file mode 100644
index 0000000000..e45906f085
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XStatusManager.java
@@ -0,0 +1,256 @@
+package com.mogo.module.v2x.manager.impl;
+
+import android.content.Context;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.mogo.module.v2x.MoGoV2XServicePaths;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.v2x.manager.IMoGoV2XStatusChangedListener;
+import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
+import com.mogo.module.v2x.manager.V2XStatusDescriptor;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/4/17 7:34 PM
+ * desc :
+ * version: 1.0
+ */
+@Route(path = MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER)
+public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
+ private static final String TAG = "MoGoV2XStatusManager";
+
+ /**
+ * 状态记录
+ */
+ private static final Map mStatus = new ConcurrentHashMap<>();
+
+ /**
+ * 回调集合
+ */
+ private static final Map> mListeners = new ConcurrentHashMap<>();
+
+ /**
+ * 状态类型修改记录
+ */
+ private static final Map mModifier = new ConcurrentHashMap<>();
+
+ // 查询状态存储情况
+ private boolean get_bool_val(V2XStatusDescriptor descriptor) {
+ Boolean val = mStatus.get(descriptor);
+ return val == null ? false : val;
+ }
+
+ @Override
+ public boolean isRoadEventPOIShow() {
+ return get_bool_val(V2XStatusDescriptor.RoadEventPOI_UI);
+ }
+
+ @Override
+ public boolean isRoadEventButtonShow() {
+ return get_bool_val(V2XStatusDescriptor.RoadEventButton_UI);
+ }
+
+ @Override
+ public boolean isRoadEventWindowShow() {
+ return get_bool_val(V2XStatusDescriptor.RoadEventWindow_UI);
+ }
+
+ @Override
+ public boolean isRoadLiveCarWindowShow() {
+ return get_bool_val(V2XStatusDescriptor.RoadLiveCarWindow_UI);
+ }
+
+ @Override
+ public boolean isOtherSeekHelpWindowShow() {
+ return get_bool_val(V2XStatusDescriptor.OtherSeekHelpWindow_UI);
+ }
+
+ @Override
+ public boolean isMeSeekHelpButtonShow() {
+ return get_bool_val(V2XStatusDescriptor.MeSeekHelpButton_UI);
+ }
+
+ @Override
+ public boolean isOtherSeekHelpPOIShow() {
+ return get_bool_val(V2XStatusDescriptor.OtherSeekHelpPOI_UI);
+ }
+
+ @Override
+ public boolean isV2XAnimationShow() {
+ return get_bool_val(V2XStatusDescriptor.V2XAnimationWindow_UI);
+ }
+
+ @Override
+ public boolean isLeftLiveVideoShow() {
+ return get_bool_val(V2XStatusDescriptor.LiveCarWindow_UI);
+ }
+
+ @Override
+ public boolean isPushWindowShow() {
+ return get_bool_val(V2XStatusDescriptor.PushWindow_UI);
+ }
+
+ @Override
+ public boolean isPushPOIShow() {
+ return get_bool_val(V2XStatusDescriptor.PushWindowPOI_UI);
+ }
+
+ @Override
+ public boolean isFatigueDrivingWindowShow() {
+ return get_bool_val(V2XStatusDescriptor.FatigueDrivingWindow_UI);
+ }
+
+ @Override
+ public void setRoadEventPOIShow(String tag, boolean show) {
+ V2XServiceManager.getMoGoStatusManager().setV2XUIShow(V2XConst.MODULE_NAME, show);
+ mStatus.put(V2XStatusDescriptor.RoadEventPOI_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.RoadEventPOI_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.RoadEventPOI_UI);
+ }
+
+ @Override
+ public void setRoadEventButtonShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.RoadEventButton_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.RoadEventButton_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.RoadEventButton_UI);
+ }
+
+ @Override
+ public void setRoadEventWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.RoadEventWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.RoadEventWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.RoadEventWindow_UI);
+ }
+
+ @Override
+ public void setRoadLiveCarWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.RoadLiveCarWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.RoadLiveCarWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.RoadLiveCarWindow_UI);
+ }
+
+ @Override
+ public void setOtherSeekHelpWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.OtherSeekHelpWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.OtherSeekHelpWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.OtherSeekHelpWindow_UI);
+ }
+
+ @Override
+ public void setMeSeekHelpButtonShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.MeSeekHelpButton_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.MeSeekHelpButton_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.MeSeekHelpButton_UI);
+ }
+
+ @Override
+ public void setOtherSeekHelpPOIShow(String tag, boolean show) {
+ V2XServiceManager.getMoGoStatusManager().setV2XUIShow(V2XConst.MODULE_NAME, show);
+ mStatus.put(V2XStatusDescriptor.OtherSeekHelpPOI_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.OtherSeekHelpPOI_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.OtherSeekHelpPOI_UI);
+ }
+
+ @Override
+ public void setV2XAnimationWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.V2XAnimationWindow_UI);
+ }
+
+ @Override
+ public void setLiveCarWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.LiveCarWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.LiveCarWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.LiveCarWindow_UI);
+ }
+
+
+ @Override
+ public void setPushWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.PushWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.PushWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.PushWindow_UI);
+ }
+
+ @Override
+ public void setPushPOIShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.PushWindowPOI_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.PushWindowPOI_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.PushWindowPOI_UI);
+ }
+
+ @Override
+ public void setFatigueDrivingWindowShow(String tag, boolean show) {
+ mStatus.put(V2XStatusDescriptor.FatigueDrivingWindow_UI, show);
+ invokeStatusChangedListener(V2XStatusDescriptor.FatigueDrivingWindow_UI, show);
+ recordStatusModifier(tag, V2XStatusDescriptor.FatigueDrivingWindow_UI);
+ }
+
+ @Override
+ public void registerStatusChangedListener(String tag, V2XStatusDescriptor descriptor, IMoGoV2XStatusChangedListener listener) {
+ if (listener == null || descriptor == null) {
+ return;
+ }
+ if (!mListeners.containsKey(descriptor)) {
+ mListeners.put(descriptor, new ArrayList<>());
+ }
+ if (mListeners.get(descriptor) == null) {
+ mListeners.put(descriptor, new ArrayList<>());
+ }
+ List listeners = mListeners.get(descriptor);
+ if (listeners != null) {
+ listeners.add(listener);
+ }
+ }
+
+ @Override
+ public void unregisterStatusChangedListener(String tag, V2XStatusDescriptor descriptor, IMoGoV2XStatusChangedListener listener) {
+ List listeners = mListeners.get(descriptor);
+ if (listeners != null) {
+ listeners.remove(listener);
+ }
+ }
+
+
+ /**
+ * 调用所有存储的监听
+ *
+ * @param descriptor
+ * @param status
+ */
+ private void invokeStatusChangedListener(V2XStatusDescriptor descriptor, boolean status) {
+ if (mListeners.containsKey(descriptor)) {
+ List listeners = mListeners.get(descriptor);
+ if (listeners != null) {
+ for (IMoGoV2XStatusChangedListener listener : listeners) {
+ if (listener != null) {
+ listener.onStatusChanged(descriptor, status);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * 记录状态
+ *
+ * @param tag
+ * @param descriptor
+ */
+ private void recordStatusModifier(String tag, V2XStatusDescriptor descriptor) {
+ mModifier.put(descriptor, tag);
+ }
+
+ @Override
+ public void init(Context context) {
+
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerAdapter.java
new file mode 100644
index 0000000000..4e17b03803
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerAdapter.java
@@ -0,0 +1,149 @@
+package com.mogo.module.v2x.marker;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+
+import com.mogo.module.common.entity.MarkerShowEntity;
+import com.mogo.module.common.entity.V2XPoiTypeEnum;
+import com.mogo.module.common.entity.V2XRoadEventEntity;
+import com.mogo.module.v2x.R;
+
+import java.util.ArrayList;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-1015:55
+ * desc : V2X 地图气泡
+ * version: 1.0
+ */
+public class V2XMarkerAdapter {
+
+ /**
+ * 返回道路事件
+ */
+ public static Bitmap getV2XRoadEventMarkerView(Context context, V2XRoadEventEntity alarmInfo) {
+ return new V2XMarkerRoadEventView(context, alarmInfo).getView();
+ }
+
+ /**
+ * 返回道路事件
+ */
+ public static Bitmap getV2XRoadEventMarkerView(Context context, V2XRoadEventEntity alarmInfo, int imageRes) {
+ return new V2XMarkerRoadEventView(context, alarmInfo).setBackground(imageRes).getView();
+ }
+
+ /**
+ * 返回道路事件静态的图,因为D车机性能不行,会卡顿
+ */
+ public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) {
+ Bitmap bitmap;
+ switch (alarmInfo.getPoiType()) {
+ case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST:
+ case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING:
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "":
+ bitmap = getV2XRoadEventMarkerView(
+ context,
+ alarmInfo,
+ R.drawable.v_to_x_warning_circle_orange_00009);
+ break;
+ default:
+ bitmap = getV2XRoadEventMarkerView(
+ context,
+ alarmInfo,
+ R.drawable.v_to_x_warning_circle_red_00009);
+ break;
+ }
+ return bitmap;
+ }
+
+ /**
+ * 返回道路事件gif序列图集合
+ */
+ public static ArrayList getV2XRoadEventViewGif(Context context, V2XRoadEventEntity alarmInfo) {
+ ArrayList bitmapArrayList;
+ switch (alarmInfo.getPoiType()) {
+ case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST:
+ case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING:
+ case V2XPoiTypeEnum.FOURS_BLOCK_UP:
+ case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "":
+ bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo);
+ break;
+ default:
+ bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo);
+ break;
+ }
+ return bitmapArrayList;
+ }
+
+ /**
+ * 返回红色扩散效果的序列
+ */
+ public static ArrayList getV2XRoadEventRedMarkerView(Context context, V2XRoadEventEntity alarmInfo) {
+ ArrayList icons = new ArrayList<>();
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00000));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00001));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00002));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00003));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00004));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00005));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00006));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00007));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00008));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00009));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00010));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00011));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00012));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00013));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00015));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00017));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00018));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00020));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_red_00023));
+ return icons;
+ }
+
+ /**
+ * 返回橘色色扩散效果的序列
+ */
+ public static ArrayList getV2XRoadEventOrangeMarkerView(Context context, V2XRoadEventEntity alarmInfo) {
+ ArrayList icons = new ArrayList<>();
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00000));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00001));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00002));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00003));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00004));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00005));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00006));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00007));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00008));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00009));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00010));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00011));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00012));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00013));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00015));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00017));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00018));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00019));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00020));
+ icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00023));
+ return icons;
+ }
+
+ /**
+ * 获取模拟点
+ *
+ * @param context 上下文
+ * @return MarkerView
+ */
+ public static Bitmap getV2XCarMarkerView(Context context, MarkerShowEntity showEntity) {
+ if (showEntity.isChecked()) {
+ return new V2XMarkerCarInfoView(context, showEntity).getView();
+ } else {
+ return new V2XMarkerCarView(context, showEntity).getView();
+ }
+ }
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerCarInfoView.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerCarInfoView.kt
new file mode 100644
index 0000000000..6ed65b7a18
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerCarInfoView.kt
@@ -0,0 +1,145 @@
+package com.mogo.module.v2x.marker
+
+import android.content.Context
+import android.graphics.Bitmap
+import android.text.TextUtils
+import android.view.LayoutInflater
+import android.view.View
+import androidx.constraintlayout.widget.ConstraintLayout
+import com.mogo.module.common.entity.MarkerOnlineCar
+import com.mogo.module.common.entity.MarkerShowEntity
+import com.mogo.module.service.utils.ViewUtils
+import com.mogo.module.v2x.R
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity
+import com.mogo.module.common.entity.V2XPoiTypeEnum
+import kotlinx.android.synthetic.main.view_marker_car.view.*
+import kotlinx.android.synthetic.main.view_marker_car_info.view.*
+import kotlinx.android.synthetic.main.view_marker_car_info.view.ivCar
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-0619:55
+ * desc : 绘制在线车辆,特殊车辆
+ * version: 1.0
+ */
+class V2XMarkerCarInfoView(context: Context, showEntity: MarkerShowEntity) :
+ ConstraintLayout(context) {
+
+ init {
+ initView(context, showEntity)
+ }
+
+ private fun initView(context: Context, showEntity: MarkerShowEntity) {
+ val bindObj: Any = showEntity.bindObj
+ if (bindObj is MarkerOnlineCar) {
+ //1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆
+ when (bindObj.userInfo.safeLabelType) {
+ // 可直播车机
+ 4 -> {
+ LayoutInflater.from(context)
+ .inflate(R.layout.view_marker_car, this)
+ ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio)
+ }
+ else -> {
+ LayoutInflater.from(context)
+ .inflate(R.layout.view_marker_car_info, this)
+ }
+ }
+ }
+ if (bindObj is V2XMarkerEntity) {
+ LayoutInflater.from(context)
+ .inflate(R.layout.view_marker_car, this)
+ }
+ updateUI(showEntity)
+ }
+
+ fun updateUI(showEntity: MarkerShowEntity) {
+ ivCar.rotation = showEntity.markerLocation.angle.toFloat()
+// ivCar.rotation = 90f
+
+ tvUserMarker.text = if (TextUtils.isEmpty(showEntity.textContent)) {
+ ""
+ } else {
+ showEntity.textContent
+ }
+
+ val bindObj: Any = showEntity.bindObj
+ if (bindObj is MarkerOnlineCar) {
+ tvMarkerContent.text =
+ if (bindObj.userInfo == null && TextUtils.isEmpty(bindObj.userInfo.userName)) {
+ "蘑菇车主"
+ } else {
+ bindObj.userInfo.userName
+ }
+
+ //车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆',
+ when (bindObj.carInfo.vehicleType) {
+ // 普通车
+ 0 -> {
+ clMarkerContent.visibility = View.VISIBLE
+ ivReverseTriangle.visibility = View.VISIBLE
+ ivCar.setImageResource(R.drawable.icon_car_gray)
+ }
+ // 警车
+ 1 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_police)
+ }
+ // 救护车
+ 2 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_ambulance)
+ }
+ // 道路救援车辆
+ 3 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ else -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_gray)
+ }
+ }
+ }
+ if (bindObj is V2XMarkerEntity) {
+ when (bindObj.targetId) {
+ 10001 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_gray)
+ }
+ 10002 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_ambulance)
+ }
+ 10003 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_police)
+ }
+ //失控车
+ 10004 -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ // 故障车
+ V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING -> {
+ clMarkerContent.visibility = View.GONE
+ ivReverseTriangle.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ }
+ }
+ }
+
+ fun getView(): Bitmap {
+ return ViewUtils.fromView(this)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerCarView.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerCarView.kt
new file mode 100644
index 0000000000..d283ff7692
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerCarView.kt
@@ -0,0 +1,115 @@
+package com.mogo.module.v2x.marker
+
+import android.content.Context
+import android.graphics.Bitmap
+import android.view.LayoutInflater
+import android.view.View
+import androidx.constraintlayout.widget.ConstraintLayout
+import com.mogo.module.common.entity.MarkerOnlineCar
+import com.mogo.module.common.entity.MarkerShowEntity
+import com.mogo.module.service.utils.ViewUtils
+import com.mogo.module.v2x.R
+import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity
+import com.mogo.module.common.entity.V2XPoiTypeEnum
+import kotlinx.android.synthetic.main.view_marker_car.view.*
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-0619:55
+ * desc : 绘制在线车辆,特殊车辆
+ * version: 1.0
+ */
+class V2XMarkerCarView(context: Context, showEntity: MarkerShowEntity) :
+ ConstraintLayout(context) {
+
+ init {
+ initView(context, showEntity)
+ }
+
+ private fun initView(context: Context, showEntity: MarkerShowEntity) {
+ LayoutInflater.from(context)
+ .inflate(R.layout.view_marker_car, this)
+ updateUI(showEntity)
+ }
+
+ fun updateUI(showEntity: MarkerShowEntity) {
+ ivCar.rotation = showEntity.markerLocation.angle.toFloat()
+
+ val bindObj: Any = showEntity.bindObj
+ if (bindObj is MarkerOnlineCar) {
+ //1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆
+ when (bindObj.userInfo.safeLabelType) {
+ 1 -> {
+ ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_blue)
+ }
+ 2 -> {
+ ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_green)
+ }
+ 3 -> {
+ ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_red)
+ }
+ 4 -> {
+ ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio)
+ }
+ }
+
+ //车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆',
+ when (bindObj.carInfo.vehicleType) {
+ // 普通车
+ 0 -> {
+ ivMarkerTip.visibility = View.VISIBLE
+ ivCar.setImageResource(R.drawable.icon_car_gray)
+ }
+ // 警车
+ 1 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_police)
+ }
+ // 救护车
+ 2 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_ambulance)
+ }
+ // 道路救援车辆
+ 3 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ else -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_gray)
+ }
+ }
+ }
+ if (bindObj is V2XMarkerEntity) {
+ when (bindObj.targetId) {
+ 10001 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_gray)
+ }
+ 10002 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_ambulance)
+ }
+ 10003 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.icon_car_police)
+ }
+ 10004 -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ // 故障车
+ V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING -> {
+ ivMarkerTip.visibility = View.GONE
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ }
+ }
+ }
+
+ fun getView(): Bitmap {
+ return ViewUtils.fromView(this)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt
new file mode 100644
index 0000000000..3059bcd6a7
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/marker/V2XMarkerRoadEventView.kt
@@ -0,0 +1,126 @@
+package com.mogo.module.v2x.marker
+
+
+import android.content.Context
+import android.graphics.Bitmap
+import android.view.LayoutInflater
+import android.view.View
+import androidx.constraintlayout.widget.ConstraintLayout
+import com.mogo.module.service.utils.ViewUtils
+import com.mogo.module.v2x.R
+import com.mogo.module.common.entity.V2XPoiTypeEnum
+import com.mogo.module.common.entity.V2XRoadEventEntity
+import kotlinx.android.synthetic.main.view_marker_event_car.view.*
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020-01-0619:55
+ * desc :
+ * 3、道路事件
+ * 2.18 演示 :驾驶模式中地图展示“拥堵“、“施工”;
+ * (ADAS模式下还包含 原有的拥堵、交通检查、封路事件)
+ * version: 1.0
+ */
+class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
+ ConstraintLayout(context) {
+ val TAG = "V2XMarkerRoadEventView"
+
+ init {
+ initView(context, alarmInfo)
+ }
+
+ fun initView(context: Context, alarmInfo: V2XRoadEventEntity) {
+ if (alarmInfo.poiType == V2XPoiTypeEnum.ALERT_FRONT_CAR ||
+ alarmInfo.poiType == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString()
+ ) {
+ LayoutInflater.from(context)
+ .inflate(R.layout.view_marker_event_car, this)
+ } else {
+ LayoutInflater.from(context)
+ .inflate(R.layout.view_marker_event_road, this)
+ }
+ updateIcon(alarmInfo)
+ }
+
+ /**
+ * @see V2XPoiTypeEnum
+ */
+ private fun updateIcon(alarmInfo: V2XRoadEventEntity) {
+ //Logger.d(MODULE_NAME, alarmInfo.toString())
+ // 道路施工、积水、路面结冰、浓雾、事故、拥堵
+ when (alarmInfo.poiType) {
+ //交通检查
+ V2XPoiTypeEnum.TRAFFIC_CHECK -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_2)
+ }
+ //封路
+ V2XPoiTypeEnum.ROAD_CLOSED -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_16)
+ }
+ //施工
+ V2XPoiTypeEnum.FOURS_ROAD_WORK -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_11)
+ }
+ //拥堵
+ V2XPoiTypeEnum.FOURS_BLOCK_UP -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_5)
+ }
+ //积水
+ V2XPoiTypeEnum.FOURS_PONDING -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_6)
+ }
+ //浓雾
+ V2XPoiTypeEnum.FOURS_FOG -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_9)
+ }
+ //结冰
+ V2XPoiTypeEnum.FOURS_ICE -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_8)
+ }
+ //事故
+ V2XPoiTypeEnum.FOURS_ACCIDENT -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_7)
+ }
+ //红绿灯数据
+ V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_3)
+ }
+ //红绿灯数据
+ V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_3)
+ }
+ //前方静止or慢速车辆报警
+ V2XPoiTypeEnum.ALERT_FRONT_CAR -> {
+ ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
+ }
+ // 故障车辆
+ V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString() -> {
+ ivCar.setImageResource(R.drawable.icon_car_red)
+ ivCarTop.visibility = View.VISIBLE
+ }
+ // 取快递
+ V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_express)
+ ivBg.visibility = View.GONE
+ }
+ // 顺风车
+ V2XPoiTypeEnum.ALERT_TRAFFIC_TAXI -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_taxi)
+ ivBg.visibility = View.GONE
+ }
+ }
+ }
+
+ /**
+ * 背景
+ */
+ fun setBackground(imageRes: Int): V2XMarkerRoadEventView {
+ ivBg.setImageResource(imageRes)
+ return this
+ }
+
+ fun getView(): Bitmap {
+ return ViewUtils.fromView(this)
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/HttpConstant.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/HttpConstant.kt
new file mode 100644
index 0000000000..dcc0b492d6
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/HttpConstant.kt
@@ -0,0 +1,23 @@
+package com.mogo.module.v2x.network
+
+import com.mogo.commons.debug.DebugConfig
+
+class HttpConstant {
+
+ companion object {
+ const val HOST_DEV = "http://dzt-test.zhidaohulian.com"
+ const val HOST_TEST = "http://dzt-test.zhidaohulian.com"
+ const val HOST_DEMO = "http://dzt-show.zhidaohulian.com"
+ const val HOST_PRODUCT = "https://dzt.zhidaohulian.com"
+
+ fun getNetHost(): String {
+ return when (DebugConfig.getNetMode()) {
+ DebugConfig.NET_MODE_DEV -> HOST_DEV
+ DebugConfig.NET_MODE_QA -> HOST_TEST
+ DebugConfig.NET_MODE_DEMO -> HOST_DEMO
+ else -> HOST_PRODUCT
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java
new file mode 100644
index 0000000000..40e84f3b7d
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java
@@ -0,0 +1,111 @@
+package com.mogo.module.v2x.network;
+
+import com.mogo.commons.data.BaseData;
+import com.mogo.module.common.entity.MarkerCardResult;
+import com.mogo.module.common.entity.MarkerResponse;
+import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
+import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes;
+import com.mogo.module.v2x.entity.net.V2XLiveCarRes;
+import com.mogo.module.v2x.entity.net.V2XLivePushVoRes;
+import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
+import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
+
+import java.util.Map;
+
+import io.reactivex.Observable;
+import okhttp3.RequestBody;
+import retrofit2.http.Body;
+import retrofit2.http.FieldMap;
+import retrofit2.http.FormUrlEncoded;
+import retrofit2.http.GET;
+import retrofit2.http.Headers;
+import retrofit2.http.POST;
+
+/**
+ * @author congtaowang
+ * @since 2020-01-03
+ *
+ * 接口描述
+ */
+public interface V2XApiService {
+ /**
+ * 直播心跳
+ */
+ @FormUrlEncoded
+ @POST("/dataService/integratedServices/app/push/no/heartbeat/v1")
+ Observable refreshHeartBeat(@FieldMap Map liveBroadcast);
+
+ /**
+ * 刷新地图气泡点
+ */
+ @FormUrlEncoded
+ @POST("/yycp-launcherSnapshot/launcherSnapshot/querySnapshotAsync")
+ Observable querySnapshotAsync(@FieldMap Map parameters);
+
+ /**
+ * 直播点赞
+ */
+ @FormUrlEncoded
+ @POST("/yycp-geo-fence-carService/restrictedRules/car/liveBroadcastPraise")
+ Observable giveLikeLiveVideo(@FieldMap Map parameters);
+
+ /**
+ * 同过SN获取用户信息
+ */
+ @Headers({"Content-Type:application/json", "Accept:application/json"})
+ @POST("/yycp-realtimeLocations/realTimeLocationServer/queryUserInfoBySn")
+ Observable queryUserInfoBySn(@Body RequestBody jsonStr);
+
+ /**
+ * 车辆故障求助查询
+ *
+ * @param param
+ * @return
+ */
+ @FormUrlEncoded
+ @POST("/yycp-realtimeLocations/vehicleTypeManage/car/queryVehicleType/v1")
+ Observable queryHelpSignal(@FieldMap Map param);
+
+ /**
+ * 车辆故障求助查询
+ *
+ * @param param
+ * @return
+ */
+ @FormUrlEncoded
+ @POST("/yycp-realtimeLocations/vehicleTypeManage/car/updateVehicleType/v1")
+ Observable sendHelpSignal(@FieldMap Map param);
+
+ /**
+ * 根据经纬度查询附近可直播车机直播信息
+ */
+ @FormUrlEncoded
+ @POST("/yycp-realtimeLocations/realTimeLocationServer/car/queryNearbyVehicleLiveByLocation/v1")
+ Observable queryNearbyVehicleLiveByLocation(@FieldMap Map parameters);
+
+ /**
+ * 推流与停止推流接口
+ */
+ @FormUrlEncoded
+ @POST("/dataService/integratedServices/app/push/no/livePush/v1")
+ Observable livePush(@FieldMap Map parameters);
+
+ /**
+ * TODO 查询演示车用户信息
+ */
+ @GET("/yycp-launcherSnapshot/mock/getMockUserInfos")
+ Observable getMockUserInfos();
+
+ /**
+ * 根据名称获取策略详情
+ */
+ @GET("/yycp-strategyPush/push/strategy/item?name=TIRE_DRIVING")
+ Observable getStrategyPush();
+
+ /**
+ * 违章地段查询接口
+ */
+ @FormUrlEncoded
+ @POST("/yycp-launcherSnapshot/launcherSnapshot/queryIllegalPark")
+ Observable queryIllegalPark(@FieldMap Map parameters);
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshCallback.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshCallback.java
new file mode 100644
index 0000000000..f17d3d6672
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshCallback.java
@@ -0,0 +1,14 @@
+package com.mogo.module.v2x.network;
+
+/**
+ * @author congtaowang
+ * @since 2020-01-03
+ *
+ * 刷新回调
+ */
+public interface V2XRefreshCallback {
+
+ void onSuccess(T result);
+
+ void onFail(String msg);
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java
new file mode 100644
index 0000000000..a6b34d8c29
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java
@@ -0,0 +1,476 @@
+package com.mogo.module.v2x.network;
+
+import android.content.Context;
+import android.text.TextUtils;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.commons.data.BaseData;
+import com.mogo.commons.network.ParamsProvider;
+import com.mogo.commons.network.SubscribeImpl;
+import com.mogo.commons.network.Utils;
+import com.mogo.map.MogoLatLng;
+import com.mogo.module.common.entity.MarkerResponse;
+import com.mogo.module.service.ServiceConst;
+import com.mogo.module.service.network.RefreshBody;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes;
+import com.mogo.module.v2x.entity.net.V2XLiveCarBroadcastReq;
+import com.mogo.module.v2x.entity.net.V2XLiveCarRes;
+import com.mogo.module.v2x.entity.net.V2XLivePushVoRes;
+import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
+import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
+import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.service.network.IMogoNetwork;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.RequestOptions;
+import com.mogo.utils.network.utils.GsonUtil;
+
+import java.util.HashMap;
+import java.util.Map;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+import okhttp3.RequestBody;
+
+
+/**
+ * 数据接口API
+ *
+ * @author donghongyu
+ * @since 2020-01-03
+ */
+public class V2XRefreshModel {
+
+ private Context mContext;
+ private V2XApiService mV2XApiService;
+ private static V2XRefreshModel mV2XRefreshModel;
+
+ private V2XRefreshModel() {
+ }
+
+ public synchronized static V2XRefreshModel getInstance(Context context) {
+ if (mV2XRefreshModel == null) {
+ synchronized (V2XRefreshModel.class) {
+ if (mV2XRefreshModel == null) {
+ mV2XRefreshModel = new V2XRefreshModel();
+ mV2XRefreshModel.init(context);
+ }
+ }
+ }
+ return mV2XRefreshModel;
+ }
+
+ private void init(Context context) {
+ this.mContext = context;
+ IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(context);
+ this.mV2XApiService = network.create(V2XApiService.class, HttpConstant.Companion.getNetHost());
+ }
+
+ /**
+ * 刷新地图点数据
+ */
+ public void querySnapshotAsync(MogoLatLng latLng, int radius, int limit) {
+ if (mV2XApiService != null) {
+ final Map query = new ParamsProvider.Builder(mContext).build();
+ final RefreshBody refreshBody = new RefreshBody();
+ refreshBody.limit = limit;
+ refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lon);
+ refreshBody.radius = radius;
+ refreshBody.dataType.add(ServiceConst.CARD_TYPE_ROAD_CONDITION);
+ refreshBody.viewPush = true;
+ query.put("data", GsonUtil.jsonFromObject(refreshBody));
+ mV2XApiService.querySnapshotAsync(query)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(BaseData o) {
+ super.onSuccess(o);
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ }
+ });
+ }
+ }
+
+ /**
+ * 触发刷新直播心跳
+ *
+ * @param sn 目标车机SN
+ * @param videoChannel 直播的频道
+ * @param callback 回调
+ */
+ public void refreshHeartBeat(String sn, String videoChannel, final V2XRefreshCallback callback) {
+ if (mV2XApiService != null) {
+ Map liveBroadcast = new HashMap<>();
+ liveBroadcast.put("sn", sn);
+ liveBroadcast.put("data", GsonUtil.getGson().toJson(new V2XLiveCarBroadcastReq(sn, videoChannel)));
+
+ mV2XApiService.refreshHeartBeat(liveBroadcast)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(BaseData o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+
+ /**
+ * 直播点赞👍
+ *
+ * @param callback 回调
+ */
+ public void giveLikeLiveVideo(final V2XRefreshCallback callback, String snStr) {
+ if (mV2XApiService != null) {
+ Logger.d(V2XConst.MODULE_NAME, "点赞车机:" + snStr);
+ final Map query = new ParamsProvider.Builder(mContext).build();
+ query.put("data", "{\"sn\":" + snStr + "}");
+ mV2XApiService.giveLikeLiveVideo(query)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(BaseData o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * 获取用户信息
+ *
+ * @param sn 目标车机SN
+ */
+ public void queryUserInfoBySn(String sn, final V2XRefreshCallback callback) {
+ if (mV2XApiService != null) {
+ RequestBody body = RequestBody.create(
+ okhttp3.MediaType.parse("application/json; charset=utf-8"),
+ "{\"sn\":\"" + sn + "\"}");
+
+ mV2XApiService.queryUserInfoBySn(body)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(V2XUserInfoRes o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * 根据经纬度查询附近可直播车机直播信息
+ *
+ * @param callback 回调
+ */
+ public void queryNearbyVehicleLiveByLocation(
+ V2XRefreshCallback callback, double lon, double lat) {
+ if (mV2XApiService != null) {
+ final Map query = new ParamsProvider.Builder(mContext).build();
+
+ StringBuffer dataStr = new StringBuffer();
+ dataStr.append("{");
+ dataStr.append("\"lon\":");
+ dataStr.append(lon);
+ dataStr.append(",");
+ dataStr.append("\"lat\":");
+ dataStr.append(lat);
+ dataStr.append(",");
+ dataStr.append("\"radius\":");
+ dataStr.append(0.5);
+ dataStr.append(",");
+ dataStr.append("\"size\":");
+ dataStr.append(5);
+ dataStr.append("}");
+
+ query.put("data", dataStr.toString());
+ mV2XApiService.queryNearbyVehicleLiveByLocation(query)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(V2XLiveCarRes o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * 推流与停止推流接口
+ *
+ * @param callback 回调
+ */
+ public void livePush(V2XRefreshCallback callback, String sn, int playType) {
+ if (mV2XApiService != null) {
+ final Map query = new ParamsProvider.Builder(mContext).build();
+ query.put("data", "{" +
+ "\"eventId\": \"yycp\"," +
+ "\"sn\": \"" + sn + "\"," +
+ "\"type\": \"" + playType + "\"," +
+ "\"videoChannel\": \"C_1\"" +
+ "}");
+ mV2XApiService.livePush(query)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(V2XLivePushVoRes o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * 取消求助
+ *
+ * @param callback
+ */
+ public void cancelHelpSignal(V2XRefreshCallback callback) {
+ if (mV2XApiService != null) {
+ final Map map = new ParamsProvider.Builder(mContext).build();
+ String json = new StringBuilder()
+ .append("{")
+ .append("\"sn\":").append(Utils.getSn())
+ .append(",")
+ .append("\"vehicleType\":")
+ .append(0)
+ .append("}").toString();
+ map.put("data", json);
+ mV2XApiService.sendHelpSignal(map).subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(BaseData o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+
+ }
+ }
+
+ /**
+ * 查询当前车辆故障求助状态
+ *
+ * @param callback
+ */
+ public void getHelpSignal(V2XRefreshCallback callback) {
+ if (mV2XApiService != null) {
+ final Map map = new ParamsProvider.Builder(mContext).build();
+ map.put("sn", Utils.getSn());
+ mV2XApiService.queryHelpSignal(map).subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(V2XSeekHelpRes o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+
+ }
+ }
+
+ /**
+ * TODO 演示需求
+ *
+ * @param callback
+ */
+ public void getMockUserInfos(V2XRefreshCallback callback) {
+ if (mV2XApiService != null) {
+ mV2XApiService.getMockUserInfos().subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(V2XDemoUserInfoRes o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * 根据名称获取策略详情
+ */
+ public void getStrategyPush(V2XRefreshCallback callback) {
+ if (mV2XApiService != null) {
+ mV2XApiService.getStrategyPush().subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(V2XStrategyPushRes o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * 违章地段查询接口
+ */
+ public void queryIllegalPark(V2XRefreshCallback callback, double lon, double lat) {
+ if (mV2XApiService != null) {
+ final Map map = new ParamsProvider.Builder(mContext).build();
+ String json = "{\"location\":{\"lat\":" + lat + ",\"lon\":" + lon + "},\"radius\":50}";
+// String json = "{\"location\":{\"lat\":39.968139,\"lon\":116.380476},\"radius\":1000}";
+ map.put("data", json);
+ mV2XApiService.queryIllegalPark(map).subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) {
+ @Override
+ public void onSuccess(MarkerResponse o) {
+ super.onSuccess(o);
+ if (callback != null) {
+ callback.onSuccess(o);
+ }
+ }
+
+ @Override
+ public void onError(String message, int code) {
+ super.onError(message, code);
+ if (callback != null) {
+ if (TextUtils.isEmpty(message)) {
+ message = "网络错误,请稍后重试";
+ }
+ callback.onFail(message);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java
new file mode 100644
index 0000000000..dc04c9cab3
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java
@@ -0,0 +1,32 @@
+package com.mogo.module.v2x.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
+import com.mogo.utils.logger.Logger;
+import com.mogo.utils.network.utils.GsonUtil;
+
+/**
+ * 场景广播接收,道路预警、后台下发、违章停车、故障求助、疲劳驾驶
+ *
+ * @author donghongyu
+ */
+public class SceneBroadcastReceiver extends BroadcastReceiver {
+
+ private static final String TAG = V2XConst.MODULE_NAME + "_SceneBroadcastReceiver";
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ try {
+ V2XMessageEntity v2XMessageEntity = (V2XMessageEntity) intent.getSerializableExtra("V2XMessageEntity");
+ Logger.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
+ V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/IV2XScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/IV2XScenario.java
new file mode 100644
index 0000000000..89e4de77fc
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/IV2XScenario.java
@@ -0,0 +1,71 @@
+package com.mogo.module.v2x.scenario;
+
+import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
+import com.mogo.module.common.entity.V2XMessageEntity;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/5/15 4:13 PM
+ * desc : V2X安全驾驶场景接口
+ * version: 1.0
+ */
+public interface IV2XScenario {
+
+ /**
+ * 展示场景
+ */
+ void show();
+
+ /**
+ * 关闭场景
+ */
+ void close();
+
+ /**
+ * 展示Window
+ */
+ void showWindow();
+
+ /**
+ * 关闭Window
+ */
+ void closeWindow();
+
+ /**
+ * 展示按钮
+ */
+ void showButton();
+
+ /**
+ * 关闭按钮
+ */
+ void closeButton();
+
+ /**
+ * 绘制POI
+ */
+ void drawPOI();
+
+ /**
+ * 清除POI
+ */
+ void clearPOI();
+
+ /**
+ * 是否是相同的场景,如果是说明重复的场景,需要根据场景进行不同的处理
+ *
+ * @param v2XMessageEntity 要比较的场景
+ * @return true-相同的场景,false-不同场景
+ */
+ boolean isSameScenario(V2XMessageEntity v2XMessageEntity);
+
+ /**
+ * 调用小智语音播放TTS
+ *
+ * @param msg 消息
+ * @param callBack 播放回调
+ */
+ void speakTTSVoice(String msg, IMogoVoiceCmdCallBack callBack);
+
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/IV2XScenarioManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/IV2XScenarioManager.java
new file mode 100644
index 0000000000..2a061a4fca
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/IV2XScenarioManager.java
@@ -0,0 +1,14 @@
+package com.mogo.module.v2x.scenario;
+
+import com.mogo.module.common.entity.V2XMessageEntity;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/5/15 3:47 PM
+ * desc : V2X安全驾驶场景管理
+ * version: 1.0
+ */
+public interface IV2XScenarioManager {
+ void handlerMessage(V2XMessageEntity v2XMessageEntity);
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/AbsV2XScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/AbsV2XScenario.java
new file mode 100644
index 0000000000..f6c3fe4523
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/AbsV2XScenario.java
@@ -0,0 +1,89 @@
+package com.mogo.module.v2x.scenario.impl;
+
+import android.text.TextUtils;
+
+import androidx.annotation.Nullable;
+
+import com.mogo.commons.voice.AIAssist;
+import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
+import com.mogo.commons.voice.VoicePreemptType;
+import com.mogo.module.v2x.V2XConst;
+import com.mogo.module.v2x.V2XServiceManager;
+import com.mogo.module.common.entity.V2XMessageEntity;
+import com.mogo.module.v2x.scenario.IV2XScenario;
+import com.mogo.module.v2x.scenario.view.IV2XButton;
+import com.mogo.module.v2x.scenario.view.IV2XMarker;
+import com.mogo.module.v2x.scenario.view.IV2XWindow;
+import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
+import com.mogo.module.v2x.utils.V2XUtils;
+import com.mogo.utils.logger.Logger;
+
+/**
+ * author : donghongyu
+ * e-mail : 1358506549@qq.com
+ * date : 2020/5/15 5:01 PM
+ * desc :
+ * version: 1.0
+ */
+public abstract class AbsV2XScenario implements IV2XScenario {
+ protected String TAG = "AbsV2XScenario";
+ protected IV2XWindow mV2XWindow;
+ protected IV2XButton mV2XButton;
+ protected IV2XMarker mV2XMarker;
+ protected IMoGoV2XStatusManager mV2XStatusManager;
+ protected V2XMessageEntity mV2XMessageEntity;
+
+ protected AbsV2XScenario() {
+ this.mV2XStatusManager = V2XServiceManager.getMoGoV2XStatusManager();
+ }
+
+ public abstract void init(@Nullable V2XMessageEntity v2XMessageEntity);
+
+ @Override
+ public void close() {
+ closeButton();
+ closeWindow();
+ clearPOI();
+ }
+
+ @Override
+ public void speakTTSVoice(@Nullable String msg, IMogoVoiceCmdCallBack callBack) {
+ if (!TextUtils.isEmpty(msg)) {
+ Logger.w(V2XConst.MODULE_NAME, "调用TTS播放语音:" + msg);
+ AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice(msg, VoicePreemptType.PREEMPT_TYPE_IMMEADIATELY, callBack);
+ }
+ }
+
+ public IV2XWindow getV2XWindow() {
+ return mV2XWindow;
+ }
+
+ public void setV2XWindow(@Nullable IV2XWindow mV2XWindow) {
+ this.mV2XWindow = mV2XWindow;
+ }
+
+ public void setV2XButton(@Nullable IV2XButton mV2XButton) {
+ this.mV2XButton = mV2XButton;
+ }
+
+ public void setV2XMarker(@Nullable IV2XMarker mV2XMarker) {
+ this.mV2XMarker = mV2XMarker;
+ }
+
+ public void setV2XMessageEntity(@Nullable V2XMessageEntity