diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 3a0dd65790..9915406839 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -35,6 +35,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 58a8fa2665..82dd3abb51 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -217,10 +217,16 @@ dependencies {
releaseImplementation rootProject.ext.dependencies.gpssimulatornoop
implementation rootProject.ext.dependencies.modulemedia
implementation rootProject.ext.dependencies.moduleservice
+ // 事件面板分渠道引用
d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop
d8xxImplementation rootProject.ext.dependencies.moduleventpanel
e8xxImplementation rootProject.ext.dependencies.moduleventpanel
f8xxImplementation rootProject.ext.dependencies.moduleventpanel
+ // 左侧面板分渠道引用
+ d82xImplementation rootProject.ext.dependencies.moduleleftpanel
+ d8xxImplementation rootProject.ext.dependencies.moduleleftpanel
+ e8xxImplementation rootProject.ext.dependencies.moduleleftpanel
+ f8xxImplementation rootProject.ext.dependencies.moduleleftpanel
} else {
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
// launcherImplementation project(':modules:mogo-module-main')
@@ -234,10 +240,16 @@ dependencies {
releaseImplementation project(':modules:mogo-module-gps-simulator-noop')
implementation project(':modules:mogo-module-media')
implementation project(':modules:mogo-module-service')
+ // 事件面板分渠道引用
d82xImplementation project(':modules:mogo-module-event-panel-noop')
d8xxImplementation project(':modules:mogo-module-event-panel')
e8xxImplementation project(':modules:mogo-module-event-panel')
f8xxImplementation project(':modules:mogo-module-event-panel')
+ // 左侧面板分渠道引用
+ d82xImplementation project(':modules:mogo-module-left-panel')
+ d8xxImplementation project(':modules:mogo-module-left-panel')
+ e8xxImplementation project(':modules:mogo-module-left-panel')
+ f8xxImplementation project(':modules:mogo-module-left-panel')
}
}
diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java
index af4f5f520c..d3a7f941e2 100644
--- a/app/src/main/java/com/mogo/launcher/MogoApplication.java
+++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java
@@ -25,6 +25,7 @@ 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
@@ -63,6 +64,8 @@ public class MogoApplication extends AbsMogoApplication {
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 ) );
diff --git a/config.gradle b/config.gradle
index eb29712af3..2eb1d3c69a 100644
--- a/config.gradle
+++ b/config.gradle
@@ -162,6 +162,8 @@ ext {
//事件面板
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}"
+ 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}"
]
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 59d156cf1e..9ce9d478ee 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -58,6 +58,8 @@ MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.11
MOGO_MODULE_OBU_VERSION = 1.2.1.10-SNAPSHOT
+MOGO_MODULE_LEFT_PANEL_VERSION = 1.2.1.10-SNAPSHOT
+
## 工程外部模块
# 探路
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..b8428afdfb
--- /dev/null
+++ b/modules/mogo-module-left-panel/build.gradle
@@ -0,0 +1,58 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-kapt'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+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..e69de29bb2
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..481bb43481
--- /dev/null
+++ b/modules/mogo-module-left-panel/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/androidTest/java/com/zhidao/mogo/module/left/panel/ExampleInstrumentedTest.kt b/modules/mogo-module-left-panel/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/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/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..89230db8d3
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/fragment/SimpleSpeedFragment.kt
@@ -0,0 +1,28 @@
+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
+ */
+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.text = speed.toString()
+ }
+}
\ 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..880efe5fa5
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/java/com/zhidao/mogo/module/left/panel/presenter/SimpleSpeedPresenter.kt
@@ -0,0 +1,31 @@
+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.map.location.IMogoLocationListener
+import com.mogo.map.location.MogoLocation
+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
+import java.lang.Thread.sleep
+import kotlin.concurrent.thread
+
+/**
+ * 临时左侧车速逻辑的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.toInt())
+ }
+ }
+ }
+}
\ No newline at end of file
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..29b83f1787
--- /dev/null
+++ b/modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-left-panel/src/test/java/com/zhidao/mogo/module/left/panel/ExampleUnitTest.kt b/modules/mogo-module-left-panel/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/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-main/build.gradle b/modules/mogo-module-main/build.gradle
index 2e2982d770..e06cc617ba 100644
--- a/modules/mogo-module-main/build.gradle
+++ b/modules/mogo-module-main/build.gradle
@@ -53,7 +53,6 @@ dependencies {
api rootProject.ext.dependencies.mogoconnection
api rootProject.ext.dependencies.moduleextensions
api rootProject.ext.dependencies.mogomoduleback
-// implementation rootProject.ext.dependencies.moduleventpanel
} else {
api project(":foudations:mogo-utils")
api project(":foudations:mogo-commons")
@@ -66,7 +65,6 @@ dependencies {
api project(':foudations:mogo-connection')
api project(':modules:mogo-module-extensions')
api project(':modules:mogo-module-back')
-// implementation project(':modules:mogo-module-event-panel')
}
}
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 a5835ac748..5ec6d71509 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
@@ -61,6 +61,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected View mEntrance;
protected FrameLayout mFloatingLayout;
protected FrameLayout mCoverUpLayout;
+ protected FrameLayout mLeftPanelLayout;
protected View mLeftShadowFrame;
private boolean mIsHomeKeyDown = false;
@@ -80,6 +81,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
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 -> {
@@ -183,6 +185,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// 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
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 a7f9306503..c594af9c33 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
@@ -65,4 +65,10 @@ public interface MogoModulesHandler {
* @param containerId
*/
void loadEventPanelModule(int containerId);
+
+ /**
+ * 加载左侧面板
+ * @param containerId
+ */
+ void loadLeftPanelModule(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 ca7c8ef3b9..7bc36e79b4 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
@@ -139,6 +139,14 @@ public class MogoModulesManager implements MogoModulesHandler {
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 loadBaseModule() {
List< MogoModule > baseModules = MogoModulePaths.getBaseModules();
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 9b210921e4..033fdc6160 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
@@ -34,6 +34,12 @@
android:layout_height="match_parent"
android:padding="@dimen/module_main_apps_fragment_container_padding" />
+
+
+