diff --git a/app/build.gradle b/app/build.gradle index afb298b173..c68cd58ebf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,11 +61,13 @@ dependencies { implementation rootProject.ext.dependencies.moduledemo implementation rootProject.ext.dependencies.moduledemo2 implementation rootProject.ext.dependencies.modulecommon + implementation rootProject.ext.dependencies.moduletanlu } else { implementation project(':modules:mogo-module-main') implementation project(':foudations:mogo-commons') implementation project(':modules:mogo-module-common') implementation project(':demo:demo-module-map') implementation project(':demo:demo-module-map2') + implementation project(':demo:mogo-module-tanlu') } } diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 2754e27346..ae53ae6294 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -8,6 +8,7 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.demo.module.map.DemoConstants; import com.mogo.demo.module.map2.Demo2Constants; import com.mogo.module.common.MogoModulePaths; +import com.mogo.tanlu.TanluConstants; /** * @author congtaowang @@ -20,13 +21,14 @@ public class MogoApplication extends AbsMogoApplication { @Override public void onCreate() { super.onCreate(); + MogoModulePaths.addModule( DemoConstants.TAG ); + MogoModulePaths.addModule( Demo2Constants.TAG ); + MogoModulePaths.addModule( TanluConstants.TAG ); } @Override protected void attachBaseContext( Context base ) { super.attachBaseContext( base ); MultiDex.install( base ); - MogoModulePaths.addModule( DemoConstants.TAG ); - MogoModulePaths.addModule( Demo2Constants.TAG ); } } diff --git a/config.gradle b/config.gradle index 8c53bc3057..bd3882e0ed 100644 --- a/config.gradle +++ b/config.gradle @@ -11,83 +11,93 @@ ext { dependencies = [ // androidx - androidxappcompat : "androidx.appcompat:appcompat:1.0.2", - androidxconstraintlayout: "androidx.constraintlayout:constraintlayout:1.1.3", - androidxmultidex : "androidx.multidex:multidex:2.0.1", - androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0", - androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0", + androidxappcompat : "androidx.appcompat:appcompat:1.0.2", + androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3", + androidxmultidex : "androidx.multidex:multidex:2.0.1", + androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0", + androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0", // 测试 - junit : "junit:junit:4.12", - androidxjunit : "androidx.test.ext:junit:1.1.0", - androidxespressocore : "androidx.test.espresso:espresso-core:3.1.1", + junit : "junit:junit:4.12", + androidxjunit : "androidx.test.ext:junit:1.1.0", + androidxespressocore : "androidx.test.espresso:espresso-core:3.1.1", // 地图 - amapnavi3dmap : "com.amap.api:navi-3dmap:latest.integration", - amapsearch : "com.amap.api:search:latest.integration", - amaplocation : "com.amap.api:location:latest.integration", + amapnavi3dmap : "com.amap.api:navi-3dmap:latest.integration", + amapsearch : "com.amap.api:search:latest.integration", + amaplocation : "com.amap.api:location:latest.integration", // json 转换 - gson : "com.google.code.gson:gson:2.8.4", + gson : "com.google.code.gson:gson:2.8.4", // 内存泄漏检测 - debugleakcanary : "com.squareup.leakcanary:leakcanary-android:1.6.1", - releaseleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1", - testleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1", + debugleakcanary : "com.squareup.leakcanary:leakcanary-android:1.6.1", + releaseleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1", + testleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1", //rxJava - rxjava : "io.reactivex.rxjava2:rxjava:2.2.2", - rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.0", + rxjava : "io.reactivex.rxjava2:rxjava:2.2.2", + rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.0", // arouter - arouter : "com.alibaba:arouter-api:1.5.0", - aroutercompiler : "com.alibaba:arouter-compiler:1.2.2", + arouter : "com.alibaba:arouter-api:1.5.0", + aroutercompiler : "com.alibaba:arouter-compiler:1.2.2", // glide - glide : 'com.github.bumptech.glide:glide:4.8.0', - glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0', - glideanno : 'com.github.bumptech.glide:annotations:4.8.0', - glidecompiler : 'com.github.bumptech.glide:compiler:4.8.0', - supportannos : "com.android.support:support-annotations:28.0.0", + glide : 'com.github.bumptech.glide:glide:4.8.0', + glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0', + glideanno : 'com.github.bumptech.glide:annotations:4.8.0', + glidecompiler : 'com.github.bumptech.glide:compiler:4.8.0', + supportannos : "com.android.support:support-annotations:28.0.0", // fresco - fresco : 'com.facebook.fresco:fresco:1.1.0', + fresco : 'com.facebook.fresco:fresco:1.1.0', // 公司服务 - 语音 - aiassist : "com.zhidaoauto.common:service:1.0.4", + aiassist : "com.zhidaoauto.common:service:1.0.4", // 公司服务 - 埋点 - analytics : "com.elegant.analytics:analytics:1.1.19", + analytics : "com.elegant.analytics:analytics:1.1.19", // retrofit - retrofit : "com.squareup.retrofit2:retrofit:2.3.0", - retrofitadapter : "com.squareup.retrofit2:adapter-rxjava:2.1.0", - retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.3.0", - retrofitconverterscalars: "com.squareup.retrofit2:converter-scalars:2.1.0", + retrofit : "com.squareup.retrofit2:retrofit:2.3.0", + retrofitadapter : "com.squareup.retrofit2:adapter-rxjava:2.1.0", + retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.3.0", + retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0", - // leakcanary - leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.5.4', - leakcanarynoop : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4', + // leakcanary + leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.5.4', + leakcanarynoop : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4', - // add for room - room : "android.arch.persistence.room:runtime:1.1.1", - roomAnnotationProcessor : 'android.arch.persistence.room:compiler:1.1.1', + // add for room + room : "android.arch.persistence.room:runtime:1.1.1", + roomAnnotationProcessor : 'android.arch.persistence.room:compiler:1.1.1', - // rxjava2 with room - roomRxjava : "android.arch.persistence.room:rxjava2:1.1.1", + // 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', + 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', + material : 'com.google.android.material:material:1.0.0', // modules - moduledemo : "com.mogo.module:module-demo:${DEMO_MODULE_MAP_VERSION}", - moduledemo2 : "com.mogo.module:module-demo2:${DEMO_MODULE_MAP2_VERSION}", - mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}", - mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}", - mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}", - mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}", - mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}", - modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}", - modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}", - modulemap : "com.mogo.module:module-map:${MOGO_MODULE_MAP_VERSION}", - mogoservice : "com.mogo.service:mogo-service:${MOGO_SERVICE_VERSION}", - mogoserviceapi : "com.mogo.service:mogo-service-api:${MOGO_SERVICE_API_VERSION}", - moduleapps : "com.mogo.module:module-apps:${MOGO_MODULE_APPS_VERSION}", + moduledemo : "com.mogo.module:module-demo:${DEMO_MODULE_MAP_VERSION}", + moduledemo2 : "com.mogo.module:module-demo2:${DEMO_MODULE_MAP2_VERSION}", + moduletanlu : "com.mogo.module:module-tanlu:${MOGO_MODULE_TANLU_VERSION}", + mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}", + mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}", + mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}", + mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}", + mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}", + modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}", + modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}", + modulemap : "com.mogo.module:module-map:${MOGO_MODULE_MAP_VERSION}", + mogoservice : "com.mogo.service:mogo-service:${MOGO_SERVICE_VERSION}", + mogoserviceapi : "com.mogo.service:mogo-service-api:${MOGO_SERVICE_API_VERSION}", + moduleapps : "com.mogo.module:module-apps:${MOGO_MODULE_APPS_VERSION}", + mogoconnection : "com.mogo.connection:mogo-connection:${MOGO_CONNECTION_VERSION}", + + // 长链 + socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.0', + socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23', + socketsdkprotobufjava : 'com.google.protobuf:protobuf-java:3.5.1', + + // + jetbrainsannotationsjava5: "org.jetbrains:annotations-java5:15.0", ] } \ No newline at end of file diff --git a/demo/demo-module-map2/src/main/java/com/mogo/demo/module/map2/Demo2CardViewFragment.java b/demo/demo-module-map2/src/main/java/com/mogo/demo/module/map2/Demo2CardViewFragment.java index 86c45f2a78..2245d10c56 100644 --- a/demo/demo-module-map2/src/main/java/com/mogo/demo/module/map2/Demo2CardViewFragment.java +++ b/demo/demo-module-map2/src/main/java/com/mogo/demo/module/map2/Demo2CardViewFragment.java @@ -12,6 +12,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; @@ -27,6 +28,10 @@ import com.mogo.map.search.geo.MogoPoiItem; import com.mogo.map.search.poisearch.IMogoPoiSearchListener; import com.mogo.map.search.poisearch.MogoPoiResult; import com.mogo.map.uicontroller.EnumMapUI; +import com.mogo.service.MogoServicePaths; +import com.mogo.service.connection.IMogoOnMessageListener; +import com.mogo.service.connection.IMogoSocketManager; +import com.mogo.service.connection.MsgBody; import com.mogo.service.module.IMogoModuleLifecycle; import com.mogo.utils.TipToast; import com.mogo.utils.logger.Logger; @@ -66,6 +71,8 @@ public class Demo2CardViewFragment extends MvpFragment< IView, Presenter< IView private Demo2InfoWindowAdapter mDemoInfoWindowAdapter; private MogoLocation mLocation; + private IMogoSocketManager mMogoSocketManager; + private int position = -1; @Override @@ -244,6 +251,19 @@ public class Demo2CardViewFragment extends MvpFragment< IView, Presenter< IView Logger.d( TAG, "demo模块定位,定位间隔4s" ); } } ); + + mMogoSocketManager = ( IMogoSocketManager ) ARouter.getInstance().build( MogoServicePaths.PATH_SOCKET_MANAGER ).navigation(); + mMogoSocketManager.registerOnMessageListener( 123, new IMogoOnMessageListener() { + @Override + public Class target() { + return null; + } + + @Override + public void onMsgReceived( Object obj ) { + + } + } ); } @Override diff --git a/demo/demo-module-map2/src/main/res/layout/demo2_module_card_view.xml b/demo/demo-module-map2/src/main/res/layout/demo2_module_card_view.xml index 31f325ab23..cefe9ca1db 100644 --- a/demo/demo-module-map2/src/main/res/layout/demo2_module_card_view.xml +++ b/demo/demo-module-map2/src/main/res/layout/demo2_module_card_view.xml @@ -36,6 +36,12 @@ android:layout_height="wrap_content" android:text="清空覆盖物" /> +