增加比亚迪module
This commit is contained in:
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -27,6 +27,8 @@
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-apps" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-authorize" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-back" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-byd" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-byd-noop" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-common" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-event-panel" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-event-panel-noop" />
|
||||
|
||||
@@ -102,6 +102,8 @@ android {
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// e系列,采用Launcher方案
|
||||
e8xx {
|
||||
@@ -109,6 +111,8 @@ android {
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// 同上
|
||||
em4 {
|
||||
@@ -116,6 +120,8 @@ android {
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// e系列-2+32,对标D系列2+32,采用独立app的形式
|
||||
em3 {
|
||||
@@ -123,6 +129,8 @@ android {
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// e系列-1+16,对标D系列1+16,采用独立app形式
|
||||
em1 {
|
||||
@@ -130,6 +138,8 @@ android {
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// d系列
|
||||
d8xx {
|
||||
@@ -137,6 +147,8 @@ android {
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// d系列 1+16 版本
|
||||
d82x{
|
||||
@@ -144,6 +156,17 @@ android {
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
}
|
||||
// 比亚迪
|
||||
byd{
|
||||
dimension "product"
|
||||
// 不使用语音
|
||||
buildConfigField 'int', 'AIType','0'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,其他车机,比亚迪定为1
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
|
||||
}
|
||||
qa {
|
||||
dimension "env"
|
||||
@@ -245,6 +268,7 @@ dependencies {
|
||||
// 事件面板分渠道引用
|
||||
d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
em1Implementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
bydImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
d8xxImplementation rootProject.ext.dependencies.moduleventpanel
|
||||
em4Implementation rootProject.ext.dependencies.moduleventpanel
|
||||
e8xxImplementation rootProject.ext.dependencies.moduleventpanel
|
||||
@@ -253,12 +277,23 @@ dependencies {
|
||||
// 左侧面板分渠道引用
|
||||
d82xImplementation rootProject.ext.dependencies.moduleleftpanel
|
||||
em1Implementation rootProject.ext.dependencies.moduleleftpanel
|
||||
bydImplementation rootProject.ext.dependencies.moduleleftpanel
|
||||
d8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop
|
||||
em4Implementation rootProject.ext.dependencies.moduleleftpanelnoop
|
||||
e8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop
|
||||
e8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop
|
||||
f8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop
|
||||
em3Implementation rootProject.ext.dependencies.moduleleftpanelnoop
|
||||
// 比亚迪模块引用
|
||||
bydImplementation rootProject.ext.dependencies.modulebyd
|
||||
d82xImplementation rootProject.ext.dependencies.modulebydnoop
|
||||
em1Implementation rootProject.ext.dependencies.modulebydnoop
|
||||
d8xxImplementation rootProject.ext.dependencies.modulebydnoop
|
||||
em4Implementation rootProject.ext.dependencies.modulebydnoop
|
||||
e8xxImplementation rootProject.ext.dependencies.modulebydnoop
|
||||
e8xxImplementation rootProject.ext.dependencies.modulebydnoop
|
||||
f8xxImplementation rootProject.ext.dependencies.modulebydnoop
|
||||
em3Implementation rootProject.ext.dependencies.modulebydnoop
|
||||
} else {
|
||||
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
|
||||
// launcherImplementation project(':modules:mogo-module-main')
|
||||
@@ -275,6 +310,7 @@ dependencies {
|
||||
// 事件面板分渠道引用
|
||||
d82xImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
em1Implementation project(':modules:mogo-module-event-panel-noop')
|
||||
bydImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
d8xxImplementation project(':modules:mogo-module-event-panel')
|
||||
em4Implementation project(':modules:mogo-module-event-panel')
|
||||
e8xxImplementation project(':modules:mogo-module-event-panel')
|
||||
@@ -283,11 +319,22 @@ dependencies {
|
||||
// 左侧面板分渠道引用
|
||||
d82xImplementation project(':modules:mogo-module-left-panel')
|
||||
em1Implementation project(':modules:mogo-module-left-panel')
|
||||
bydImplementation project(':modules:mogo-module-left-panel')
|
||||
d8xxImplementation project(':modules:mogo-module-left-panel-noop')
|
||||
em4Implementation project(':modules:mogo-module-left-panel-noop')
|
||||
e8xxImplementation project(':modules:mogo-module-left-panel-noop')
|
||||
f8xxImplementation project(':modules:mogo-module-left-panel-noop')
|
||||
em3Implementation project(':modules:mogo-module-left-panel-noop')
|
||||
// 比亚迪模块引用
|
||||
bydImplementation project(':modules:mogo-module-byd')
|
||||
d82xImplementation project(':modules:mogo-module-byd-noop')
|
||||
em1Implementation project(':modules:mogo-module-byd-noop')
|
||||
d8xxImplementation project(':modules:mogo-module-byd-noop')
|
||||
em4Implementation project(':modules:mogo-module-byd-noop')
|
||||
e8xxImplementation project(':modules:mogo-module-byd-noop')
|
||||
e8xxImplementation project(':modules:mogo-module-byd-noop')
|
||||
f8xxImplementation project(':modules:mogo-module-byd-noop')
|
||||
em3Implementation project(':modules:mogo-module-byd-noop')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
DebugConfig.setUseCustomNavi(BuildConfig.USE_CUSTOM_NAVI);
|
||||
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
|
||||
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
|
||||
DebugConfig.setCarMachineType(BuildConfig.CAR_MACHINE_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -169,6 +169,10 @@ ext {
|
||||
// 左侧面板
|
||||
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}"
|
||||
moduleleftpanelnoop : "com.mogo.module:module-left-panel-noop:${MOGO_MODULE_LEFT_PANEL_VERSION}",
|
||||
// 比亚迪
|
||||
modulebyd : "com.mogo.module:module-byd:${MOGO_MODULE_BYD_VERSION}",
|
||||
// 比亚迪空实现
|
||||
modulebydnoop : "com.mogo.module:module-byd-noop:${MOGO_MODULE_BYD_NOOP_VERSION}"
|
||||
]
|
||||
}
|
||||
@@ -55,6 +55,11 @@ public class DebugConfig {
|
||||
|
||||
private static int sNetMode = NET_MODE_RELEASE;
|
||||
|
||||
/**
|
||||
* 不使用语音助手
|
||||
*/
|
||||
public static final int AI_TYPE_NOOP = 0;
|
||||
|
||||
/**
|
||||
* 语音使用同行者
|
||||
*/
|
||||
@@ -66,6 +71,17 @@ 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;
|
||||
/**
|
||||
* 获取网络环境类型
|
||||
*
|
||||
@@ -118,7 +134,7 @@ 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 );
|
||||
@@ -126,12 +142,28 @@ public class DebugConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用哪个语音助手 {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
* 使用哪个语音助手 {@link #AI_TYPE_NOOP} {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
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运行
|
||||
*/
|
||||
|
||||
1
modules/mogo-module-byd-noop/.gitignore
vendored
Normal file
1
modules/mogo-module-byd-noop/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
58
modules/mogo-module-byd-noop/build.gradle
Normal file
58
modules/mogo-module-byd-noop/build.gradle
Normal file
@@ -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()
|
||||
0
modules/mogo-module-byd-noop/consumer-rules.pro
Normal file
0
modules/mogo-module-byd-noop/consumer-rules.pro
Normal file
3
modules/mogo-module-byd-noop/gradle.properties
Normal file
3
modules/mogo-module-byd-noop/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-byd-noop
|
||||
VERSION_CODE=1
|
||||
21
modules/mogo-module-byd-noop/proguard-rules.pro
vendored
Normal file
21
modules/mogo-module-byd-noop/proguard-rules.pro
vendored
Normal file
@@ -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
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.byd">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
object BydConst {
|
||||
const val MODULE_NAME = "MODULE_BYD"
|
||||
const val PATH_NAME = "/carmachine/byd"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
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.byd.BydConst.MODULE_NAME
|
||||
import com.zhidao.mogo.module.byd.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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
1
modules/mogo-module-byd/.gitignore
vendored
Normal file
1
modules/mogo-module-byd/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
58
modules/mogo-module-byd/build.gradle
Normal file
58
modules/mogo-module-byd/build.gradle
Normal file
@@ -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()
|
||||
0
modules/mogo-module-byd/consumer-rules.pro
Normal file
0
modules/mogo-module-byd/consumer-rules.pro
Normal file
3
modules/mogo-module-byd/gradle.properties
Normal file
3
modules/mogo-module-byd/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-byd
|
||||
VERSION_CODE=1
|
||||
21
modules/mogo-module-byd/proguard-rules.pro
vendored
Normal file
21
modules/mogo-module-byd/proguard-rules.pro
vendored
Normal file
@@ -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
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
5
modules/mogo-module-byd/src/main/AndroidManifest.xml
Normal file
5
modules/mogo-module-byd/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.byd">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
object BydConst {
|
||||
const val MODULE_NAME = "MODULE_BYD"
|
||||
const val PATH_NAME = "/carmachine/byd"
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
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.byd.BydConst.MODULE_NAME
|
||||
import com.zhidao.mogo.module.byd.BydConst.PATH_NAME
|
||||
import com.zhidao.mogo.module.byd.fragment.BydSplashFragment
|
||||
|
||||
/**
|
||||
* 比亚迪车机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, "比亚迪模块初始化===")
|
||||
}
|
||||
|
||||
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 BydSplashFragment()
|
||||
}
|
||||
|
||||
override fun getModuleName(): String {
|
||||
return MODULE_NAME
|
||||
}
|
||||
|
||||
override fun getAppName(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun getCardLifecycle(): IMogoModuleLifecycle? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zhidao.mogo.module.byd.fragment
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.zhidao.mogo.module.byd.R
|
||||
import com.zhidao.mogo.module.byd.presenter.BydSplashPresenter
|
||||
import kotlinx.android.synthetic.main.fragment_byd_splash.*
|
||||
|
||||
class BydSplashFragment :MvpFragment<BydSplashFragment,BydSplashPresenter>(){
|
||||
override fun getLayoutId(): Int = R.layout.fragment_byd_splash
|
||||
|
||||
override fun initViews() {
|
||||
tvByd.setOnClickListener {
|
||||
activity!!.supportFragmentManager.beginTransaction().remove(this).commit()
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): BydSplashPresenter = BydSplashPresenter(this)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.zhidao.mogo.module.byd.presenter
|
||||
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.zhidao.mogo.module.byd.fragment.BydSplashFragment
|
||||
|
||||
class BydSplashPresenter(view: BydSplashFragment) : Presenter<BydSplashFragment>(view) {
|
||||
}
|
||||
BIN
modules/mogo-module-byd/src/main/res/drawable-xhdpi/binli.jpg
Normal file
BIN
modules/mogo-module-byd/src/main/res/drawable-xhdpi/binli.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fff">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvByd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:drawableTop="@drawable/binli"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center"
|
||||
android:text="比亚迪"
|
||||
android:textSize="40sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zhidao.mogo.module.byd
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -124,6 +124,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() );
|
||||
@@ -204,6 +205,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
// mCardsContainer.setAdapter( mCardModulesAdapter );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadSplash() {
|
||||
MogoModulesManager.getInstance().loadBydModule(R.id.module_main_id_splash_container);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MainPresenter createPresenter() {
|
||||
|
||||
@@ -32,4 +32,9 @@ public interface MainView extends IView {
|
||||
* @return
|
||||
*/
|
||||
IMogoServiceApis getApis();
|
||||
|
||||
/**
|
||||
* 加载闪屏页
|
||||
*/
|
||||
void loadSplash();
|
||||
}
|
||||
|
||||
@@ -71,4 +71,10 @@ public interface MogoModulesHandler {
|
||||
* @param containerId
|
||||
*/
|
||||
void loadLeftPanelModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载比亚迪模块
|
||||
* @param containerId
|
||||
*/
|
||||
void loadBydModule(int containerId);
|
||||
}
|
||||
|
||||
@@ -147,6 +147,14 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
addFragment( provider, containerId );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadBydModule(int containerId) {
|
||||
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_BYD)
|
||||
.navigation( getContext() );
|
||||
addFragment( provider, containerId );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadBaseModule() {
|
||||
List< MogoModule > baseModules = MogoModulePaths.getBaseModules();
|
||||
|
||||
@@ -9,23 +9,23 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_map_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_map_left_shadow_frame"
|
||||
android:layout_width="@dimen/module_main_map_left_shadow_frame_width"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/module_main_dw_left_frame_bkg"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- 时间、天气、消息 与entrance合到了一起,减少一个view -->
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/module_main_id_header_fragment_container"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/module_ext_height"-->
|
||||
<!-- android:layout_marginLeft="@dimen/module_main_header_fragment_container_marginLeft"-->
|
||||
<!-- android:layout_marginTop="@dimen/module_main_header_fragment_container_marginTop" />-->
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/module_main_id_header_fragment_container"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/module_ext_height"-->
|
||||
<!-- android:layout_marginLeft="@dimen/module_main_header_fragment_container_marginLeft"-->
|
||||
<!-- android:layout_marginTop="@dimen/module_main_header_fragment_container_marginTop" />-->
|
||||
|
||||
<!-- 左边按钮 -->
|
||||
<FrameLayout
|
||||
@@ -36,23 +36,24 @@
|
||||
|
||||
<!-- 左侧浮层,布局位置目前只考虑了1+16独立app情况 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_left_panel_fragment_container"
|
||||
android:layout_width="@dimen/module_main_id_left_panel_fragment_container_width"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/module_main_id_left_panel_fragment_container" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--快捷操作浮层-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_entrance_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_event_panel_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding" />
|
||||
|
||||
<!-- 浮层-->
|
||||
<FrameLayout
|
||||
@@ -73,5 +74,10 @@
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_splash_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
@@ -202,4 +202,10 @@ public class MogoServicePaths {
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_LEFT_PANEL = "/left/panel";
|
||||
|
||||
/**
|
||||
* 比亚迪模块
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_BYD = "/carmachine/byd";
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
include ':modules:mogo-module-byd-noop'
|
||||
include ':modules:mogo-module-byd'
|
||||
include ':modules:mogo-module-left-panel-noop'
|
||||
include ':modules:mogo-module-left-panel'
|
||||
include ':modules:mogo-module-event-panel-noop'
|
||||
|
||||
@@ -31,4 +31,6 @@
|
||||
./gradlew :modules:mogo-module-event-panel-noop:clean :modules:mogo-module-event-panel-noop:uploadArchives
|
||||
./gradlew :modules:mogo-module-left-panel:clean :modules:mogo-module-left-panel:uploadArchives
|
||||
./gradlew :modules:mogo-module-left-panel-noop:clean :modules:mogo-module-left-panel-noop:uploadArchives
|
||||
./gradlew :modules:mogo-module-byd:clean :modules:mogo-module-byd:uploadArchives
|
||||
./gradlew :modules:mogo-module-byd-noop:clean :modules:mogo-module-byd-noop:uploadArchives
|
||||
|
||||
|
||||
Reference in New Issue
Block a user