Merge branch 'dev' into demo/shunyi_v2v_merge
# Conflicts: # app/src/main/java/com/mogo/launcher/MogoApplication.java # config.gradle # foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml # modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml # modules/mogo-module-extensions/src/main/res/values/dimens.xml # modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java # modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help.xml # modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml # modules/mogo-module-v2x/src/main/res/values/dimens.xml # services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java # services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java # upload.sh
5
.idea/gradle.xml
generated
@@ -73,6 +73,11 @@
|
|||||||
<option value="$PROJECT_DIR$/test/crashreport" />
|
<option value="$PROJECT_DIR$/test/crashreport" />
|
||||||
<option value="$PROJECT_DIR$/test/crashreport-bugly" />
|
<option value="$PROJECT_DIR$/test/crashreport-bugly" />
|
||||||
<option value="$PROJECT_DIR$/test/crashreport-noop" />
|
<option value="$PROJECT_DIR$/test/crashreport-noop" />
|
||||||
|
<option value="$PROJECT_DIR$/tts" />
|
||||||
|
<option value="$PROJECT_DIR$/tts/tts-base" />
|
||||||
|
<option value="$PROJECT_DIR$/tts/tts-di" />
|
||||||
|
<option value="$PROJECT_DIR$/tts/tts-noop" />
|
||||||
|
<option value="$PROJECT_DIR$/tts/tts-zhi" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ android {
|
|||||||
// 是否作为 launcher 运行
|
// 是否作为 launcher 运行
|
||||||
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
|
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
|
||||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||||
|
// 是否支持目的地导航策略
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'true'
|
||||||
|
|
||||||
}
|
}
|
||||||
// launcher app
|
// launcher app
|
||||||
launcher {
|
launcher {
|
||||||
@@ -96,13 +99,13 @@ android {
|
|||||||
// 是否作为 launcher 运行
|
// 是否作为 launcher 运行
|
||||||
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
|
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
|
||||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||||
|
// 是否支持目的地导航策略
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'false'
|
||||||
}
|
}
|
||||||
// f系列-分体机全系列,未细分
|
// f系列-分体机全系列,未细分
|
||||||
f8xx {
|
f8xx {
|
||||||
applicationId rootProject.ext.android.fLauncherApplicationId
|
applicationId rootProject.ext.android.fLauncherApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用思必驰语音
|
|
||||||
buildConfigField 'int', 'AIType', '2'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -110,17 +113,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
|
||||||
}
|
}
|
||||||
// f系列-分体机
|
// f系列-分体机
|
||||||
f80x {
|
f80x {
|
||||||
applicationId rootProject.ext.android.fLauncherApplicationId
|
applicationId rootProject.ext.android.fLauncherApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用思必驰语音
|
|
||||||
buildConfigField 'int', 'AIType', '2'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -128,17 +131,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
|
||||||
}
|
}
|
||||||
// e系列,采用Launcher方案
|
// e系列,采用Launcher方案
|
||||||
e8xx {
|
e8xx {
|
||||||
applicationId rootProject.ext.android.launcherApplicationId
|
applicationId rootProject.ext.android.launcherApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用思必驰语音
|
|
||||||
buildConfigField 'int', 'AIType', '2'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -146,17 +149,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
|
||||||
}
|
}
|
||||||
// 同上
|
// 同上
|
||||||
em4 {
|
em4 {
|
||||||
applicationId rootProject.ext.android.launcherApplicationId
|
applicationId rootProject.ext.android.launcherApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用思必驰语音
|
|
||||||
buildConfigField 'int', 'AIType', '2'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -164,17 +167,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
|
||||||
}
|
}
|
||||||
// e系列-2+32,对标D系列2+32,采用独立app的形式
|
// e系列-2+32,对标D系列2+32,采用独立app的形式
|
||||||
em3 {
|
em3 {
|
||||||
applicationId rootProject.ext.android.independentApplicationId
|
applicationId rootProject.ext.android.independentApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用思必驰语音
|
|
||||||
buildConfigField 'int', 'AIType', '2'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -182,17 +185,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
|
||||||
}
|
}
|
||||||
// e系列-1+16,对标D系列1+16,采用独立app形式
|
// e系列-1+16,对标D系列1+16,采用独立app形式
|
||||||
em1 {
|
em1 {
|
||||||
applicationId rootProject.ext.android.independentApplicationId
|
applicationId rootProject.ext.android.independentApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用思必驰语音
|
|
||||||
buildConfigField 'int', 'AIType', '2'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -200,17 +203,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
|
||||||
}
|
}
|
||||||
// d系列
|
// d系列
|
||||||
d8xx {
|
d8xx {
|
||||||
applicationId rootProject.ext.android.independentApplicationId
|
applicationId rootProject.ext.android.independentApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用同行者语音
|
|
||||||
buildConfigField 'int', 'AIType', '1'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -218,17 +221,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
|
||||||
}
|
}
|
||||||
// d系列 2 + 32
|
// d系列 2 + 32
|
||||||
d80x {
|
d80x {
|
||||||
applicationId rootProject.ext.android.independentApplicationId
|
applicationId rootProject.ext.android.independentApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用同行者语音
|
|
||||||
buildConfigField 'int', 'AIType', '1'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -236,17 +239,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
|
||||||
}
|
}
|
||||||
// d系列 1+16 版本
|
// d系列 1+16 版本
|
||||||
d82x {
|
d82x {
|
||||||
applicationId rootProject.ext.android.independentApplicationId
|
applicationId rootProject.ext.android.independentApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 使用同行者语音
|
|
||||||
buildConfigField 'int', 'AIType', '1'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||||
@@ -254,17 +257,17 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
|
||||||
}
|
}
|
||||||
// 比亚迪
|
// 比亚迪
|
||||||
bydauto {
|
bydauto {
|
||||||
applicationId rootProject.ext.android.bydautoIndependentApplicationId
|
applicationId rootProject.ext.android.bydautoIndependentApplicationId
|
||||||
dimension "product"
|
dimension "product"
|
||||||
// 不使用语音
|
|
||||||
buildConfigField 'int', 'AIType', '0'
|
|
||||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||||
// 车机类型,主要用于区分自研车机还是别人家的车机,其他车机,比亚迪定为1
|
// 车机类型,主要用于区分自研车机还是别人家的车机,其他车机,比亚迪定为1
|
||||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
|
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
|
||||||
@@ -272,10 +275,12 @@ android {
|
|||||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.bydautoIndependentApiValue]
|
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.bydautoIndependentApiValue]
|
||||||
// 是否使用高德sdk自定义导航
|
// 是否使用高德sdk自定义导航
|
||||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
|
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
|
||||||
// 是否加载引导模块
|
|
||||||
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
|
|
||||||
// 是否支持换肤
|
// 是否支持换肤
|
||||||
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false'
|
||||||
|
// 是否支持查询导航目的地车友
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'false'
|
||||||
|
// 是否支持桌面卡片刷新
|
||||||
|
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
|
||||||
}
|
}
|
||||||
// 演示地点-顺义
|
// 演示地点-顺义
|
||||||
shunyi{
|
shunyi{
|
||||||
@@ -387,6 +392,7 @@ dependencies {
|
|||||||
apply from: "./functions/skin.gradle"
|
apply from: "./functions/skin.gradle"
|
||||||
apply from: "./functions/crashreport.gradle"
|
apply from: "./functions/crashreport.gradle"
|
||||||
apply from: "./functions/widgets.gradle"
|
apply from: "./functions/widgets.gradle"
|
||||||
|
apply from: "./functions/tts.gradle"
|
||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
project.dependencies {
|
project.dependencies {
|
||||||
|
|
||||||
if (Boolean.valueOf(RELEASE)) {
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
bydautoImplementation rootProject.ext.dependencies.skinsupportnoop
|
bydautoImplementation rootProject.ext.dependencies.skinsupportnoop
|
||||||
d8xxImplementation rootProject.ext.dependencies.skinsupportnoop
|
|
||||||
d82xImplementation rootProject.ext.dependencies.skinsupportnoop
|
|
||||||
em1Implementation rootProject.ext.dependencies.skinsupportnoop
|
|
||||||
d80xImplementation rootProject.ext.dependencies.skinsupportnoop
|
|
||||||
em3Implementation rootProject.ext.dependencies.skinsupportnoop
|
|
||||||
|
|
||||||
|
d82xImplementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
|
em1Implementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
|
em3Implementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
|
d8xxImplementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
|
d80xImplementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
f8xxImplementation rootProject.ext.dependencies.skinsupportimpl
|
f8xxImplementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
f80xImplementation rootProject.ext.dependencies.skinsupportimpl
|
f80xImplementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
em4Implementation rootProject.ext.dependencies.skinsupportimpl
|
em4Implementation rootProject.ext.dependencies.skinsupportimpl
|
||||||
@@ -17,19 +16,21 @@ project.dependencies {
|
|||||||
f80xImplementation rootProject.ext.dependencies.skinsupportlight
|
f80xImplementation rootProject.ext.dependencies.skinsupportlight
|
||||||
em4Implementation rootProject.ext.dependencies.skinsupportlight
|
em4Implementation rootProject.ext.dependencies.skinsupportlight
|
||||||
e8xxImplementation rootProject.ext.dependencies.skinsupportlight
|
e8xxImplementation rootProject.ext.dependencies.skinsupportlight
|
||||||
// d8xxImplementation rootProject.ext.dependencies.skinsupportlight
|
d8xxImplementation rootProject.ext.dependencies.skinsupportlight
|
||||||
// d82xImplementation rootProject.ext.dependencies.skinsupportlight
|
d80xImplementation rootProject.ext.dependencies.skinsupportlight
|
||||||
// em1Implementation rootProject.ext.dependencies.skinsupportlight
|
em3Implementation rootProject.ext.dependencies.skinsupportlight
|
||||||
// d80xImplementation rootProject.ext.dependencies.skinsupportlight
|
d82xImplementation rootProject.ext.dependencies.skinsupportlight
|
||||||
// em3Implementation rootProject.ext.dependencies.skinsupportlight
|
em1Implementation rootProject.ext.dependencies.skinsupportlight
|
||||||
} else {
|
} else {
|
||||||
bydautoImplementation project(':skin:mogo-skin-support-noop')
|
|
||||||
d8xxImplementation project(':skin:mogo-skin-support-noop')
|
|
||||||
d82xImplementation project(':skin:mogo-skin-support-noop')
|
|
||||||
em1Implementation project(':skin:mogo-skin-support-noop')
|
|
||||||
d80xImplementation project(':skin:mogo-skin-support-noop')
|
|
||||||
em3Implementation project(':skin:mogo-skin-support-noop')
|
|
||||||
|
|
||||||
|
|
||||||
|
bydautoImplementation project(':skin:mogo-skin-support-noop')
|
||||||
|
|
||||||
|
d82xImplementation project(':skin:mogo-skin-support-impl')
|
||||||
|
em1Implementation project(':skin:mogo-skin-support-impl')
|
||||||
|
em3Implementation project(':skin:mogo-skin-support-impl')
|
||||||
|
d8xxImplementation project(':skin:mogo-skin-support-impl')
|
||||||
|
d80xImplementation project(':skin:mogo-skin-support-impl')
|
||||||
f8xxImplementation project(':skin:mogo-skin-support-impl')
|
f8xxImplementation project(':skin:mogo-skin-support-impl')
|
||||||
f80xImplementation project(':skin:mogo-skin-support-impl')
|
f80xImplementation project(':skin:mogo-skin-support-impl')
|
||||||
em4Implementation project(':skin:mogo-skin-support-impl')
|
em4Implementation project(':skin:mogo-skin-support-impl')
|
||||||
@@ -39,10 +40,10 @@ project.dependencies {
|
|||||||
f80xImplementation project(':skin:mogo-skin-light')
|
f80xImplementation project(':skin:mogo-skin-light')
|
||||||
em4Implementation project(':skin:mogo-skin-light')
|
em4Implementation project(':skin:mogo-skin-light')
|
||||||
e8xxImplementation project(':skin:mogo-skin-light')
|
e8xxImplementation project(':skin:mogo-skin-light')
|
||||||
// d8xxImplementation project(':skin:mogo-skin-light')
|
d8xxImplementation project(':skin:mogo-skin-light')
|
||||||
// d82xImplementation project(':skin:mogo-skin-light')
|
d80xImplementation project(':skin:mogo-skin-light')
|
||||||
// em1Implementation project(':skin:mogo-skin-light')
|
d82xImplementation project(':skin:mogo-skin-light')
|
||||||
// d80xImplementation project(':skin:mogo-skin-light')
|
em1Implementation project(':skin:mogo-skin-light')
|
||||||
// em3Implementation project(':skin:mogo-skin-light')
|
em3Implementation project(':skin:mogo-skin-light')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
25
app/functions/tts.gradle
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
project.dependencies {
|
||||||
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
|
bydautoImplementation rootProject.ext.dependencies.ttsdi
|
||||||
|
d82xImplementation rootProject.ext.dependencies.ttszhi
|
||||||
|
em1Implementation rootProject.ext.dependencies.ttszhi
|
||||||
|
em3Implementation rootProject.ext.dependencies.ttszhi
|
||||||
|
d8xxImplementation rootProject.ext.dependencies.ttszhi
|
||||||
|
d80xImplementation rootProject.ext.dependencies.ttszhi
|
||||||
|
f8xxImplementation rootProject.ext.dependencies.ttszhi
|
||||||
|
f80xImplementation rootProject.ext.dependencies.ttszhi
|
||||||
|
em4Implementation rootProject.ext.dependencies.ttszhi
|
||||||
|
e8xxImplementation rootProject.ext.dependencies.ttszhi
|
||||||
|
} else {
|
||||||
|
bydautoImplementation project(':tts:tts-di')
|
||||||
|
d82xImplementation project(':tts:tts-zhi')
|
||||||
|
em1Implementation project(':tts:tts-zhi')
|
||||||
|
em3Implementation project(':tts:tts-zhi')
|
||||||
|
d8xxImplementation project(':tts:tts-zhi')
|
||||||
|
d80xImplementation project(':tts:tts-zhi')
|
||||||
|
f8xxImplementation project(':tts:tts-zhi')
|
||||||
|
f80xImplementation project(':tts:tts-zhi')
|
||||||
|
em4Implementation project(':tts:tts-zhi')
|
||||||
|
e8xxImplementation project(':tts:tts-zhi')
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
project.dependencies {
|
project.dependencies {
|
||||||
if (Boolean.valueOf(RELEASE)) {
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
independentImplementation rootProject.ext.dependencies.mogomodulewidgets
|
independentImplementation rootProject.ext.dependencies.mogomodulewidgets
|
||||||
|
implementation rootProject.ext.dependencies.mogomodulewidgets
|
||||||
} else {
|
} else {
|
||||||
independentImplementation project(':modules:mogo-module-widgets')
|
independentImplementation project(':modules:mogo-module-widgets')
|
||||||
|
implementation project(':modules:mogo-module-widgets')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
|
||||||
def independent = ["em3", "em1", "d80x", "d82x", "bydauto"]
|
def independent = []
|
||||||
def launcher = ["f80x", "em4", "e8xx"]
|
def launcher = ["f80x"]
|
||||||
|
|
||||||
it.getTasks().iterator().forEachRemaining {
|
it.getTasks().iterator().forEachRemaining {
|
||||||
def task = it
|
def task = it
|
||||||
|
|||||||
@@ -3,5 +3,4 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:sharedUserId="android.uid.system"
|
android:sharedUserId="android.uid.system"
|
||||||
package="com.mogo.launcher">
|
package="com.mogo.launcher">
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -14,6 +14,7 @@ import com.mogo.commons.network.Utils;
|
|||||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||||
import com.mogo.module.back.BackToLauncherConst;
|
import com.mogo.module.back.BackToLauncherConst;
|
||||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||||
|
import com.mogo.module.common.MogoApisHandler;
|
||||||
import com.mogo.module.common.MogoModule;
|
import com.mogo.module.common.MogoModule;
|
||||||
import com.mogo.module.common.MogoModulePaths;
|
import com.mogo.module.common.MogoModulePaths;
|
||||||
import com.mogo.module.main.service.MogoMainService;
|
import com.mogo.module.main.service.MogoMainService;
|
||||||
@@ -30,7 +31,6 @@ import com.mogo.test.crashreport.ITestCrashReportProvider;
|
|||||||
import com.mogo.utils.UiThreadHandler;
|
import com.mogo.utils.UiThreadHandler;
|
||||||
import com.mogo.utils.logger.LogLevel;
|
import com.mogo.utils.logger.LogLevel;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
|
||||||
import com.squareup.leakcanary.LeakCanary;
|
import com.squareup.leakcanary.LeakCanary;
|
||||||
import com.zhidao.boot.persistent.lib.PersistentManager;
|
import com.zhidao.boot.persistent.lib.PersistentManager;
|
||||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
|
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
|
||||||
@@ -64,19 +64,15 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
crashSystem.setDebug( BuildConfig.DEBUG );
|
crashSystem.setDebug( BuildConfig.DEBUG );
|
||||||
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
|
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
|
||||||
|
|
||||||
if ( DebugConfig.isLoadGuideModule() ) {
|
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
|
||||||
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
|
|
||||||
}else{
|
|
||||||
SharedPrefsMgr.getInstance(this).putBoolean(DebugConfig.getSpGuide(),true);
|
|
||||||
}
|
|
||||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||||
|
|
||||||
if ( DebugConfig.isLauncher() ) {
|
if ( DebugConfig.isLauncher() ) {
|
||||||
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
|
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
|
||||||
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
|
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
|
||||||
} else {
|
} else {
|
||||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
|
|
||||||
}
|
}
|
||||||
|
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
|
||||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
|
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
|
||||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||||
}
|
}
|
||||||
@@ -91,7 +87,6 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
|
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
|
||||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare" ) );
|
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare" ) );
|
||||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
|
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
|
||||||
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
|
|
||||||
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
|
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
|
||||||
// 碰撞报警模块
|
// 碰撞报警模块
|
||||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING,
|
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING,
|
||||||
@@ -123,7 +118,6 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
}
|
}
|
||||||
DebugConfig.setNetMode( BuildConfig.NET_ENV );
|
DebugConfig.setNetMode( BuildConfig.NET_ENV );
|
||||||
DebugConfig.setDebug( BuildConfig.DEBUG );
|
DebugConfig.setDebug( BuildConfig.DEBUG );
|
||||||
DebugConfig.setAIType( BuildConfig.AIType );
|
|
||||||
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
|
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
|
||||||
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
|
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
|
||||||
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
|
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
|
||||||
@@ -134,8 +128,10 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
|
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
|
||||||
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
|
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
|
||||||
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
|
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
|
||||||
DebugConfig.setLoadGuideModule( BuildConfig.LOAD_GUIDE_MODULE );
|
|
||||||
DebugConfig.setSkinSupported( BuildConfig.IS_SKIN_SUPPORTED );
|
DebugConfig.setSkinSupported( BuildConfig.IS_SKIN_SUPPORTED );
|
||||||
|
DebugConfig.setSupportedSearchDestinationOnlineCarList( BuildConfig.IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST );
|
||||||
|
DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush( BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH );
|
||||||
|
DebugConfig.setSupportLauncherCardRefreshStrategy( BuildConfig.IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY );
|
||||||
DebugConfig.setObuType(BuildConfig.OBU_TYPE);
|
DebugConfig.setObuType(BuildConfig.OBU_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +143,7 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
final IMogoServiceApis apis = MogoApisHandler.getInstance().getApis();
|
||||||
prepareBaseService( apis, 2_000L );
|
prepareBaseService( apis, 2_000L );
|
||||||
// installSkinManager( this, apis );
|
// installSkinManager( this, apis );
|
||||||
}
|
}
|
||||||
|
|||||||
259
config.gradle
@@ -19,196 +19,199 @@ targetSdkVersion : 22,
|
|||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
// androidx
|
// androidx
|
||||||
androidxappcompat : "androidx.appcompat:appcompat:1.1.0",
|
androidxappcompat : "androidx.appcompat:appcompat:1.1.0",
|
||||||
androidxccorektx : "androidx.core:core-ktx:1.3.0",
|
androidxccorektx : "androidx.core:core-ktx:1.3.0",
|
||||||
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3",
|
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3",
|
||||||
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
|
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
|
||||||
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
|
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
|
||||||
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
|
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
|
||||||
androidxcardview : "androidx.cardview:cardview:1.0.0",
|
androidxcardview : "androidx.cardview:cardview:1.0.0",
|
||||||
localbroadcastmanager : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
|
localbroadcastmanager : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
|
||||||
// flexbox
|
// flexbox
|
||||||
flexbox : 'com.google.android:flexbox:2.0.1',
|
flexbox : 'com.google.android:flexbox:2.0.1',
|
||||||
// 测试
|
// 测试
|
||||||
junit : "junit:junit:4.12",
|
junit : "junit:junit:4.12",
|
||||||
androidxjunit : "androidx.test.ext:junit:1.1.0",
|
androidxjunit : "androidx.test.ext:junit:1.1.0",
|
||||||
androidxespressocore : "androidx.test.espresso:espresso-core:3.1.1",
|
androidxespressocore : "androidx.test.espresso:espresso-core:3.1.1",
|
||||||
// 地图
|
// 地图
|
||||||
amapnavi3dmap : "com.amap.api:navi-3dmap:7.2.0_3dmap7.2.0",
|
amapnavi3dmap : "com.amap.api:navi-3dmap:7.2.0_3dmap7.2.0",
|
||||||
amapsearch : "com.amap.api:search:7.1.0",
|
amapsearch : "com.amap.api:search:7.1.0",
|
||||||
amaplocation : "com.amap.api:location:4.9.0",
|
amaplocation : "com.amap.api:location:4.9.0",
|
||||||
// json 转换
|
// 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",
|
debugleakcanary : "com.squareup.leakcanary:leakcanary-android:1.6.1",
|
||||||
releaseleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op: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",
|
testleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1",
|
||||||
//rxJava
|
//rxJava
|
||||||
rxjava : "io.reactivex.rxjava2:rxjava:2.2.2",
|
rxjava : "io.reactivex.rxjava2:rxjava:2.2.2",
|
||||||
rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.0",
|
rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.0",
|
||||||
// arouter
|
// arouter
|
||||||
arouter : "com.alibaba:arouter-api:1.5.0",
|
arouter : "com.alibaba:arouter-api:1.5.0",
|
||||||
aroutercompiler : "com.alibaba:arouter-compiler:1.2.2",
|
aroutercompiler : "com.alibaba:arouter-compiler:1.2.2",
|
||||||
// glide
|
// glide
|
||||||
glide : 'com.github.bumptech.glide:glide:4.8.0',
|
glide : 'com.github.bumptech.glide:glide:4.8.0',
|
||||||
glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0',
|
glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0',
|
||||||
glideanno : 'com.github.bumptech.glide:annotations:4.8.0',
|
glideanno : 'com.github.bumptech.glide:annotations:4.8.0',
|
||||||
glidecompiler : 'com.github.bumptech.glide:compiler:4.8.0',
|
glidecompiler : 'com.github.bumptech.glide:compiler:4.8.0',
|
||||||
supportannos : "com.android.support:support-annotations:28.0.0",
|
supportannos : "com.android.support:support-annotations:28.0.0",
|
||||||
// fresco
|
// 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.10",
|
aiassist : "com.zhidaoauto.common:service:1.0.8.4",
|
||||||
// 语音替换方案 暂时只用TTS 解决焦点问题
|
// 语音替换方案 暂时只用TTS 解决焦点问题
|
||||||
aiassistReplace : "com.zhidao.mogoVoicesdk:voice:1.0.5",
|
aiassistReplace : "com.zhidao.mogoVoicesdk:voice:1.0.5",
|
||||||
// 公司服务 - 埋点
|
// 公司服务 - 埋点
|
||||||
analytics : "com.elegant.analytics:analytics:1.1.19",
|
analytics : "com.elegant.analytics:analytics:1.1.19",
|
||||||
|
|
||||||
retrofit : "com.squareup.retrofit2:retrofit:2.6.0",
|
retrofit : "com.squareup.retrofit2:retrofit:2.6.0",
|
||||||
retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.0",
|
retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.0",
|
||||||
retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.6.0",
|
retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.6.0",
|
||||||
retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0",
|
retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0",
|
||||||
|
|
||||||
|
|
||||||
// leakcanary
|
// leakcanary
|
||||||
leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.5.4',
|
leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.5.4',
|
||||||
leakcanarynoop : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4',
|
leakcanarynoop : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4',
|
||||||
|
|
||||||
// add for room
|
// add for room
|
||||||
room : "android.arch.persistence.room:runtime:1.1.1",
|
room : "android.arch.persistence.room:runtime:1.1.1",
|
||||||
roomAnnotationProcessor : 'android.arch.persistence.room:compiler:1.1.1',
|
roomAnnotationProcessor : 'android.arch.persistence.room:compiler:1.1.1',
|
||||||
|
|
||||||
// rxjava2 with room
|
// rxjava2 with room
|
||||||
roomRxjava : "android.arch.persistence.room:rxjava2:1.1.1",
|
roomRxjava : "android.arch.persistence.room:rxjava2:1.1.1",
|
||||||
|
|
||||||
// material
|
// material
|
||||||
material : 'com.google.android.material:material:1.1.0',
|
material : 'com.google.android.material:material:1.1.0',
|
||||||
|
|
||||||
indicator : 'com.github.zhpanvip:viewpagerindicator:1.0.4',
|
indicator : 'com.github.zhpanvip:viewpagerindicator:1.0.4',
|
||||||
|
|
||||||
// modules
|
// modules
|
||||||
moduletanlu : "com.mogo.module:module-tanlu:${MOGO_MODULE_TANLU_VERSION}",
|
moduletanlu : "com.mogo.module:module-tanlu:${MOGO_MODULE_TANLU_VERSION}",
|
||||||
moduletanluapi : "com.mogo.module:module-tanlu-api:${MOGO_TANLU_API_VERSION}",
|
moduletanluapi : "com.mogo.module:module-tanlu-api:${MOGO_TANLU_API_VERSION}",
|
||||||
moduleshare : "com.mogo.module:module-share:${MOGO_MODULE_SHARE_VERSION}",
|
moduleshare : "com.mogo.module:module-share:${MOGO_MODULE_SHARE_VERSION}",
|
||||||
mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}",
|
mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}",
|
||||||
mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}",
|
mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}",
|
||||||
mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}",
|
mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}",
|
||||||
mapautomap : "com.mogo.map:map-autonavi:${MAP_AUTONAVI_VERSION}",
|
mapautomap : "com.mogo.map:map-autonavi:${MAP_AUTONAVI_VERSION}",
|
||||||
mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}",
|
mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}",
|
||||||
mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}",
|
mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}",
|
||||||
modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}",
|
modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}",
|
||||||
modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}",
|
modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}",
|
||||||
modulemainlauncher : "com.mogo.module:module-main-launcher:${MOGO_MODULE_MAIN_LAUNCHER_VERSION}",
|
modulemainlauncher : "com.mogo.module:module-main-launcher:${MOGO_MODULE_MAIN_LAUNCHER_VERSION}",
|
||||||
modulemainindependent : "com.mogo.module:module-main-independent:${MOGO_MODULE_MAIN_INDEPENDENT_VERSION}",
|
modulemainindependent : "com.mogo.module:module-main-independent:${MOGO_MODULE_MAIN_INDEPENDENT_VERSION}",
|
||||||
modulemap : "com.mogo.module:module-map:${MOGO_MODULE_MAP_VERSION}",
|
modulemap : "com.mogo.module:module-map:${MOGO_MODULE_MAP_VERSION}",
|
||||||
moduleservice : "com.mogo.module:module-service:${MOGO_MODULE_SERVICE_VERSION}",
|
moduleservice : "com.mogo.module:module-service:${MOGO_MODULE_SERVICE_VERSION}",
|
||||||
mogoservice : "com.mogo.service:mogo-service:${MOGO_SERVICE_VERSION}",
|
mogoservice : "com.mogo.service:mogo-service:${MOGO_SERVICE_VERSION}",
|
||||||
mogoserviceapi : "com.mogo.service:mogo-service-api:${MOGO_SERVICE_API_VERSION}",
|
mogoserviceapi : "com.mogo.service:mogo-service-api:${MOGO_SERVICE_API_VERSION}",
|
||||||
moduleapps : "com.mogo.module:module-apps:${MOGO_MODULE_APPS_VERSION}",
|
moduleapps : "com.mogo.module:module-apps:${MOGO_MODULE_APPS_VERSION}",
|
||||||
mogoconnection : "com.mogo.connection:mogo-connection:${MOGO_CONNECTION_VERSION}",
|
mogoconnection : "com.mogo.connection:mogo-connection:${MOGO_CONNECTION_VERSION}",
|
||||||
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
|
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
|
||||||
carcall : "com.mogo.module.carchatting:module-carchatting:${CARCHATTING_VERSION}",
|
carcall : "com.mogo.module.carchatting:module-carchatting:${CARCHATTING_VERSION}",
|
||||||
carcallprovider : "com.mogo.module.carchatting:module-carchatting-provider:${CARCHATTINGPROVIDER_VERSION}",
|
carcallprovider : "com.mogo.module.carchatting:module-carchatting-provider:${CARCHATTINGPROVIDER_VERSION}",
|
||||||
guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
|
guideshow : "com.mogo.module:module-guide:${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
|
// V2X
|
||||||
moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}",
|
moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}",
|
||||||
modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}",
|
modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}",
|
||||||
modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}",
|
modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}",
|
||||||
// push
|
// push
|
||||||
modulepush : "com.mogo.module:module-push:${MOGO_MODULE_PUSH_VERSION}",
|
modulepush : "com.mogo.module:module-push:${MOGO_MODULE_PUSH_VERSION}",
|
||||||
modulepushbase : "com.mogo.module:module-push-base:${MOGO_MODULE_PUSH_BASE_VERSION}",
|
modulepushbase : "com.mogo.module:module-push-base:${MOGO_MODULE_PUSH_BASE_VERSION}",
|
||||||
modulepushnoop : "com.mogo.module:module-push-noop:${MOGO_MODULE_PUSH_NOOP_VERSION}",
|
modulepushnoop : "com.mogo.module:module-push-noop:${MOGO_MODULE_PUSH_NOOP_VERSION}",
|
||||||
//运营位卡片
|
|
||||||
moduleadcard : "com.mogo.module:module-adcard:${MOGO_MODULE_AD_CARD_VERSION}",
|
|
||||||
//统一返回键
|
//统一返回键
|
||||||
mogomoduleback : "com.mogo.module:module-back:${MOGO_MODULE_BACK_VERSION}",
|
mogomoduleback : "com.mogo.module:module-back:${MOGO_MODULE_BACK_VERSION}",
|
||||||
mogomoduleauth : "com.mogo.module:module-authorize:${MOGO_MODULE_AUTHORIZE_VERSION}",
|
mogomoduleauth : "com.mogo.module:module-authorize:${MOGO_MODULE_AUTHORIZE_VERSION}",
|
||||||
mogomoduleguide : "com.mogo.module:module-guide:${MOGO_MODULE_GUIDE_VERSION}",
|
mogomoduleguide : "com.mogo.module:module-guide:${MOGO_MODULE_GUIDE_VERSION}",
|
||||||
// 长链
|
// 长链
|
||||||
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.4',
|
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.4',
|
||||||
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
|
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
|
||||||
socketsdkprotobufjava : 'com.google.protobuf:protobuf-java:3.5.1',
|
socketsdkprotobufjava : 'com.google.protobuf:protobuf-java:3.5.1',
|
||||||
// OBU
|
// OBU
|
||||||
moduleobu : "com.mogo.module:module-obu:${MOGO_MODULE_OBU_VERSION}",
|
moduleobu : "com.mogo.module:module-obu:${MOGO_MODULE_OBU_VERSION}",
|
||||||
|
|
||||||
//
|
//
|
||||||
jetbrainsannotationsjava5: "org.jetbrains:annotations-java5:15.0",
|
jetbrainsannotationsjava5 : "org.jetbrains:annotations-java5:15.0",
|
||||||
|
|
||||||
// 统一登录
|
// 统一登录
|
||||||
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.11",
|
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.14",
|
||||||
// crash
|
// crash
|
||||||
crashSdk : "com.zhidaoauto.crash.log:library:1.0.5",
|
crashSdk : "com.zhidaoauto.crash.log:library:1.0.5",
|
||||||
kotlinstdlibjdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}",
|
kotlinstdlibjdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}",
|
||||||
|
|
||||||
//探路
|
//探路
|
||||||
videoarmv7 : "com.shuyu:gsyVideoPlayer-armv7a:7.1.2",
|
videoarmv7 : "com.shuyu:gsyVideoPlayer-armv7a:7.1.2",
|
||||||
videoarm64 : "com.shuyu:gsyVideoPlayer-arm64:7.1.2",
|
videoarm64 : "com.shuyu:gsyVideoPlayer-arm64:7.1.2",
|
||||||
videojava : "com.shuyu:gsyVideoPlayer-java:7.1.2",
|
videojava : "com.shuyu:gsyVideoPlayer-java:7.1.2",
|
||||||
eventbus : "org.greenrobot:eventbus:3.1.1",
|
eventbus : "org.greenrobot:eventbus:3.1.1",
|
||||||
videoprocessor : "com.zhidao.video:video-processor:1.0.2.1",
|
videoprocessor : "com.zhidao.video:video-processor:1.0.2.1",
|
||||||
|
|
||||||
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1",
|
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1",
|
||||||
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1",
|
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1",
|
||||||
|
|
||||||
aspectj : "org.aspectj:aspectjrt:1.8.9",
|
aspectj : "org.aspectj:aspectjrt:1.8.9",
|
||||||
|
|
||||||
// gps 模拟
|
// gps 模拟
|
||||||
gpssimulator : "com.mogo.module:module-gps-simulator:${MOGO_MODULE_GPS_SIMULATOR_VERSION}",
|
gpssimulator : "com.mogo.module:module-gps-simulator:${MOGO_MODULE_GPS_SIMULATOR_VERSION}",
|
||||||
gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
|
gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
|
||||||
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
|
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
|
||||||
|
|
||||||
adasapi : "com.zhidao.autopilot.support:adas:1.0.1",
|
adasapi : "com.zhidao.autopilot.support:adas:1.0.3",
|
||||||
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5",
|
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5",
|
||||||
|
|
||||||
// 个人中心的SDK
|
// 个人中心的SDK
|
||||||
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
|
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
|
||||||
tanluupload : "com.mogo.module:module-tanlu-upload:${TANLULIB_VERSION}",
|
tanluupload : "com.mogo.module:module-tanlu-upload:${TANLULIB_VERSION}",
|
||||||
|
|
||||||
// obu sdk
|
// obu sdk
|
||||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||||
//事件面板
|
|
||||||
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}",
|
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}",
|
||||||
// 闪屏页
|
// 闪屏页
|
||||||
modulesplash : "com.mogo.module:module-splash:${MOGO_MODULE_SPLASH_VERSION}",
|
modulesplash : "com.mogo.module:module-splash:${MOGO_MODULE_SPLASH_VERSION}",
|
||||||
// 基础服务实现
|
// 基础服务实现
|
||||||
mogobaseservicesdk : "com.mogo.base:services-sdk:${MOGO_BASE_SERVICES_SDK_VERSION}",
|
mogobaseservicesdk : "com.mogo.base:services-sdk:${MOGO_BASE_SERVICES_SDK_VERSION}",
|
||||||
mogobaseserviceapk : "com.mogo.base:services-apk:${MOGO_BASE_SERVICES_APK_VERSION}",
|
mogobaseserviceapk : "com.mogo.base:services-apk:${MOGO_BASE_SERVICES_APK_VERSION}",
|
||||||
// loglib
|
// loglib
|
||||||
mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}",
|
mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}",
|
||||||
// monitor
|
// monitor
|
||||||
mogomonitor : "com.mogo.module:module-monitor:${MOGO_MODULE_MONITOR_VERSION}",
|
mogomonitor : "com.mogo.module:module-monitor:${MOGO_MODULE_MONITOR_VERSION}",
|
||||||
|
|
||||||
// google
|
// google
|
||||||
googlezxing : "com.google.zxing:core:3.3.3",
|
googlezxing : "com.google.zxing:core:3.3.3",
|
||||||
litezxing : "com.google.zxing:litezxing:1.0.29.8",
|
litezxing : "com.google.zxing:litezxing:1.0.29.8",
|
||||||
|
|
||||||
// android - room
|
// android - room
|
||||||
androidxroomruntime : "androidx.room:room-runtime:2.2.3",
|
androidxroomruntime : "androidx.room:room-runtime:2.2.3",
|
||||||
androidxroomcompiler : "androidx.room:room-compiler:2.2.3",
|
androidxroomcompiler : "androidx.room:room-compiler:2.2.3",
|
||||||
androidxroomktx : "androidx.room:room-ktx:2.2.3",
|
androidxroomktx : "androidx.room:room-ktx:2.2.3",
|
||||||
|
|
||||||
//
|
//
|
||||||
mogomodulewidgets : "com.mogo.module:module-widgets:${MOGO_MODULE_WIDGETS_VERSION}",
|
mogomodulewidgets : "com.mogo.module:module-widgets:${MOGO_MODULE_WIDGETS_VERSION}",
|
||||||
|
|
||||||
kotlingradleplugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}",
|
kotlingradleplugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}",
|
||||||
|
|
||||||
skinsupport : "com.mogo.skin:skin-support:${MOGO_SKIN_SUPPORT_VERSION}",
|
skinsupport : "com.mogo.skin:skin-support:${MOGO_SKIN_SUPPORT_VERSION}",
|
||||||
skinsupportimpl : "com.mogo.skin:skin-support-impl:${MOGO_SKIN_SUPPORT_IMPL_VERSION}",
|
skinsupportimpl : "com.mogo.skin:skin-support-impl:${MOGO_SKIN_SUPPORT_IMPL_VERSION}",
|
||||||
skinsupportnoop : "com.mogo.skin:skin-support-noop:${MOGO_SKIN_SUPPORT_NOOP_VERSION}",
|
skinsupportnoop : "com.mogo.skin:skin-support-noop:${MOGO_SKIN_SUPPORT_NOOP_VERSION}",
|
||||||
skinsupportlight : "com.mogo.skin:skin-light:${MOGO_SKIN_LIGHT_VERSION}",
|
skinsupportlight : "com.mogo.skin:skin-light:${MOGO_SKIN_LIGHT_VERSION}",
|
||||||
|
|
||||||
crashreport : "com.mogo.test:crashreport:${CRASHREPORT_VERSION}",
|
crashreport : "com.mogo.test:crashreport:${CRASHREPORT_VERSION}",
|
||||||
crashreportbugly : "com.mogo.test:crashreport-bugly:${CRASHREPORT_BUGLY_VERSION}",
|
crashreportbugly : "com.mogo.test:crashreport-bugly:${CRASHREPORT_BUGLY_VERSION}",
|
||||||
crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_VERSION}",
|
crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_VERSION}",
|
||||||
|
|
||||||
|
|
||||||
|
skinsupportbase : "com.mogo.skin:skin-support-base:${SKIN_SUPPORT_VERSION}",
|
||||||
|
skinsupportappcompat : "com.mogo.skin:skin-support-appcompat:${SKIN_SUPPORT_APPCOMPAT_VERSION}",
|
||||||
|
skinsupportcardview : "com.mogo.skin:skin-support-cardview:${SKIN_SUPPORT_CARDVIEW_VERSION}",
|
||||||
|
skinsupportconstraintlayout: "com.mogo.skin:skin-support-constraint-layout:${SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION}",
|
||||||
|
skinsupportdesign : "com.mogo.skin:skin-support-design:${SKIN_SUPPORT_DESIGN_VERSION}",
|
||||||
|
|
||||||
|
ttsbase : "com.mogo.tts:tts-base:${TTS_BASE_VERSION}",
|
||||||
|
ttsdi : "com.mogo.tts:tts-di:${TTS_DI_VERSION}",
|
||||||
|
ttszhi : "com.mogo.tts:tts-zhi:${TTS_ZHI_VERSION}",
|
||||||
|
ttsnoop : "com.mogo.tts:tts-noop:${TTS_NOOP_VERSION}",
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ import com.mogo.service.passport.IMogoPassportManager;
|
|||||||
import com.mogo.service.passport.IMogoTicketCallback;
|
import com.mogo.service.passport.IMogoTicketCallback;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
import com.zhidao.account.sdk.AccountClientManager;
|
import com.zhidao.account.sdk.AccountClientManager;
|
||||||
|
import com.zhidao.account.sdk.BusinessType;
|
||||||
import com.zhidao.account.sdk.Environment;
|
import com.zhidao.account.sdk.Environment;
|
||||||
import com.zhidao.account.sdk.callback.TicketInfoCallback;
|
import com.zhidao.account.sdk.callback.TicketInfoCallback;
|
||||||
import com.zhidao.account.sdk.network.NetEnvironManager;
|
import com.zhidao.account.sdk.network.NetEnvironManager;
|
||||||
@@ -70,16 +71,12 @@ class PassportManager implements IMogoPassportManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void getTicket( TicketInfoCallback callback ) {
|
private static void getTicket( TicketInfoCallback callback ) {
|
||||||
if ( DebugConfig.isLauncher() ) {
|
AccountClientManager.getTicket( callback );
|
||||||
AccountClientManager.getTicket( callback );
|
|
||||||
} else {
|
|
||||||
AccountClientManager.getAppTicket( callback );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init( Context context ) {
|
public void init( Context context ) {
|
||||||
AccountClientManager.init( context.getApplicationContext(), getNetEnvironment(), NetEnvironManager.OS_2C, "os2.0-launcher" );
|
AccountClientManager.init( context.getApplicationContext(), getNetEnvironment(), BusinessType.toc_login, "os2.0-launcher" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Environment getNetEnvironment() {
|
private Environment getNetEnvironment() {
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
api rootProject.ext.dependencies.aiassist
|
|
||||||
api rootProject.ext.dependencies.aiassistReplace
|
|
||||||
api rootProject.ext.dependencies.androidxappcompat
|
api rootProject.ext.dependencies.androidxappcompat
|
||||||
api rootProject.ext.dependencies.analytics
|
api rootProject.ext.dependencies.analytics
|
||||||
implementation rootProject.ext.dependencies.arouter
|
implementation rootProject.ext.dependencies.arouter
|
||||||
@@ -46,9 +44,11 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.accountsdk
|
implementation rootProject.ext.dependencies.accountsdk
|
||||||
if (Boolean.valueOf(RELEASE)) {
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
implementation rootProject.ext.dependencies.mogoutils
|
implementation rootProject.ext.dependencies.mogoutils
|
||||||
|
api rootProject.ext.dependencies.ttsbase
|
||||||
implementation rootProject.ext.dependencies.skinsupport
|
implementation rootProject.ext.dependencies.skinsupport
|
||||||
} else {
|
} else {
|
||||||
implementation project(":foudations:mogo-utils")
|
implementation project(":foudations:mogo-utils")
|
||||||
|
api project(":tts:tts-base")
|
||||||
implementation project(":skin:mogo-skin-support")
|
implementation project(":skin:mogo-skin-support")
|
||||||
}
|
}
|
||||||
api 'org.greenrobot:eventbus:3.1.1'
|
api 'org.greenrobot:eventbus:3.1.1'
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.mogo.commons.context;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
public class ContextHolderUtil {
|
||||||
|
|
||||||
|
private static Context mContext;
|
||||||
|
|
||||||
|
public static void holdContext(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void releaseContext() {
|
||||||
|
mContext = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Context getContext(){
|
||||||
|
return mContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -141,23 +141,6 @@ public class DebugConfig {
|
|||||||
DebugConfig.sUseCustomNavi = sUseCustomNavi;
|
DebugConfig.sUseCustomNavi = sUseCustomNavi;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置使用哪个语音助手
|
|
||||||
*
|
|
||||||
* @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);
|
|
||||||
sAIType = aiType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用哪个语音助手 {@link #AI_TYPE_NOOP} {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
|
||||||
*/
|
|
||||||
public static int getAIType() {
|
|
||||||
return sAIType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置当前车机类型
|
* 设置当前车机类型
|
||||||
*
|
*
|
||||||
@@ -287,6 +270,45 @@ public class DebugConfig {
|
|||||||
return isSkinSupported;
|
return isSkinSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持支持查询导航目的地车友信息
|
||||||
|
*/
|
||||||
|
private static boolean isSupportedSearchDestinationOnlineCarList = false;
|
||||||
|
|
||||||
|
public static void setSupportedSearchDestinationOnlineCarList( boolean isSupportedSearchDestinationOnlineCarList ) {
|
||||||
|
DebugConfig.isSupportedSearchDestinationOnlineCarList = isSupportedSearchDestinationOnlineCarList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isSupportedSearchDestinationOnlineCarList() {
|
||||||
|
return isSupportedSearchDestinationOnlineCarList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持目的地导航推送策略
|
||||||
|
*/
|
||||||
|
private static boolean isScheduleCalculateNotHomeCompanyDistanceForPush = false;
|
||||||
|
|
||||||
|
public static void setScheduleCalculateNotHomeCompanyDistanceForPush( boolean isScheduleCalculateNotHomeCompanyDistanceForPush ) {
|
||||||
|
DebugConfig.isScheduleCalculateNotHomeCompanyDistanceForPush = isScheduleCalculateNotHomeCompanyDistanceForPush;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isIsScheduleCalculateNotHomeCompanyDistanceForPush() {
|
||||||
|
return isScheduleCalculateNotHomeCompanyDistanceForPush;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持刷新桌面卡片
|
||||||
|
*/
|
||||||
|
private static boolean isSupportLauncherCardRefreshStrategy = false;
|
||||||
|
|
||||||
|
public static void setSupportLauncherCardRefreshStrategy( boolean isSupportLauncherCardRefreshStrategy ) {
|
||||||
|
DebugConfig.isSupportLauncherCardRefreshStrategy = isSupportLauncherCardRefreshStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isIsSupportLauncherCardRefreshStrategy() {
|
||||||
|
return isSupportLauncherCardRefreshStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
private static int obuType = OBU_TYPE_HUALI;
|
private static int obuType = OBU_TYPE_HUALI;
|
||||||
|
|
||||||
public static int getObuType() {
|
public static int getObuType() {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import com.mogo.utils.DeviceIdUtils;
|
|||||||
import com.mogo.utils.WindowUtils;
|
import com.mogo.utils.WindowUtils;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
import com.mogo.utils.network.utils.GsonUtil;
|
import com.mogo.utils.network.utils.GsonUtil;
|
||||||
import com.zhidao.auto.platform.util.DeviceUtil;
|
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
@@ -37,7 +36,7 @@ public class ParamsUtil {
|
|||||||
params.put( ServerParam.NET_TYPE, CommonUtils.getNetworkType( AbsMogoApplication.getApp() ) );
|
params.put( ServerParam.NET_TYPE, CommonUtils.getNetworkType( AbsMogoApplication.getApp() ) );
|
||||||
params.put( ServerParam.CELL_ID, Utils.getCellId( AbsMogoApplication.getApp() ) );
|
params.put( ServerParam.CELL_ID, Utils.getCellId( AbsMogoApplication.getApp() ) );
|
||||||
|
|
||||||
params.put( ServerParam.DISPLAY_ID, DeviceUtil.getSystemVersion() );
|
// params.put( ServerParam.DISPLAY_ID, DeviceUtil.getSystemVersion() );
|
||||||
params.put( ServerParam.SN, Utils.getSn() );
|
params.put( ServerParam.SN, Utils.getSn() );
|
||||||
params.put( ServerParam.TICKET, SpStorage.getTicket() );
|
params.put( ServerParam.TICKET, SpStorage.getTicket() );
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,12 @@ public class SpStorage {
|
|||||||
public static void setTicket( String ticket ) {
|
public static void setTicket( String ticket ) {
|
||||||
SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).putString( "ticket", ticket );
|
SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).putString( "ticket", ticket );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getNavigationTarget(){
|
||||||
|
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "naviTarget" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setNavigationTarget( String naviTarget ) {
|
||||||
|
SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).putString( "naviTarget", naviTarget );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
package com.mogo.commons.voice;
|
package com.mogo.commons.voice;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.tts.base.IMogoTTS;
|
||||||
import com.zhidao.auto.platform.voice.VoiceClient;
|
import com.mogo.tts.base.MogoTTSConstants;
|
||||||
import com.zhidao.voicesdk.MogoVoiceManager;
|
import com.mogo.tts.base.PreemptType;
|
||||||
import com.zhidao.voicesdk.MogoVoiceManagerImpl;
|
|
||||||
import com.zhidao.voicesdk.callback.OnConnStatusListener;
|
|
||||||
import com.zhidao.voicesdk.callback.OnTtsListener;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author congtaowang
|
* @author congtaowang
|
||||||
@@ -27,14 +13,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
* <p>
|
* <p>
|
||||||
* 语音助手通信助手
|
* 语音助手通信助手
|
||||||
*/
|
*/
|
||||||
public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
public class AIAssist {
|
||||||
|
|
||||||
private static final String TAG = "AIAssist";
|
|
||||||
private static volatile AIAssist sInstance;
|
private static volatile AIAssist sInstance;
|
||||||
private String mLastQAndASpeakText;
|
|
||||||
|
|
||||||
private boolean mHasFlush = false;
|
private IMogoTTS mTTS;
|
||||||
private boolean mInitReady = false;
|
|
||||||
|
|
||||||
public static AIAssist getInstance( Context context ) {
|
public static AIAssist getInstance( Context context ) {
|
||||||
if ( sInstance == null ) {
|
if ( sInstance == null ) {
|
||||||
@@ -48,61 +31,15 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void release() {
|
public synchronized void release() {
|
||||||
Logger.d( TAG, "release" );
|
if ( mTTS != null ) {
|
||||||
if ( mCmdMap != null && !mCmdMap.isEmpty() && mVoiceClient != null ) {
|
mTTS.release();
|
||||||
for ( String cmd : mCmdMap.keySet() ) {
|
|
||||||
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mQAndAMap.clear();
|
|
||||||
mVoiceClient.release();
|
|
||||||
mSpeakVoiceMap.clear();
|
|
||||||
mCacheUnWakeupCommands.clear();
|
|
||||||
sInstance = null;
|
sInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final VoiceClient mVoiceClient;
|
|
||||||
private MogoVoiceManager mogoVoiceManager;
|
|
||||||
// 免唤醒指令
|
|
||||||
private Map< String, List< IMogoVoiceCmdCallBack > > mCmdMap = new HashMap<>();
|
|
||||||
// 问答指令
|
|
||||||
private Map< String, IMogoVoiceCmdCallBack > mQAndAMap = new HashMap<>();
|
|
||||||
// 单独的语音播放
|
|
||||||
private Map< String, IMogoVoiceCmdCallBack > mSpeakVoiceMap = new HashMap<>();
|
|
||||||
|
|
||||||
private Map< String, String[] > mCacheUnWakeupCommands = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
private AIAssist( Context context ) {
|
private AIAssist( Context context ) {
|
||||||
// private constructor
|
mTTS = ( IMogoTTS ) ARouter.getInstance().build( MogoTTSConstants.API_PATH ).navigation( context.getApplicationContext() );
|
||||||
mVoiceClient = new VoiceClient( context.getApplicationContext() );
|
|
||||||
mVoiceClient.setCallBack( this );
|
|
||||||
initFlushStatus( context );
|
|
||||||
initSpeech( context );
|
|
||||||
Logger.w( TAG, "voice is ready = %s", mHasFlush );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initFlushStatus( Context context ) {
|
|
||||||
if ( !mHasFlush ) {
|
|
||||||
mHasFlush = isVoiceServiceReady( context );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化
|
|
||||||
*/
|
|
||||||
private void initSpeech( Context context ) {
|
|
||||||
mogoVoiceManager = MogoVoiceManagerImpl.getInstance();
|
|
||||||
mogoVoiceManager.init( context, new OnConnStatusListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
mInitReady = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed() {
|
|
||||||
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,83 +48,10 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean hasFlush() {
|
public boolean hasFlush() {
|
||||||
return mHasFlush;
|
if ( mTTS != null ) {
|
||||||
}
|
return mTTS.hasFlush();
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCmdSelected( String cmd ) {
|
|
||||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Logger.d( TAG, "received command: %s", cmd );
|
|
||||||
|
|
||||||
Iterator< IMogoVoiceCmdCallBack > iterator = null;
|
|
||||||
try {
|
|
||||||
List< IMogoVoiceCmdCallBack > cmdCallBacks = mCmdMap.get( cmd );
|
|
||||||
iterator = new ArrayList<>( cmdCallBacks ).iterator();
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
while ( iterator != null && iterator.hasNext() ) {
|
|
||||||
IMogoVoiceCmdCallBack callBack = iterator.next();
|
|
||||||
if ( callBack != null ) {
|
|
||||||
callBack.onCmdSelected( cmd );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCmdAction( String speakText ) {
|
|
||||||
if ( !TextUtils.isEmpty( mLastQAndASpeakText ) ) {
|
|
||||||
IMogoVoiceCmdCallBack cmdCallBack = mQAndAMap.remove( mLastQAndASpeakText );
|
|
||||||
if ( cmdCallBack != null ) {
|
|
||||||
cmdCallBack.onCmdAction( speakText );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCmdCancel( String speakText ) {
|
|
||||||
if ( !TextUtils.isEmpty( mLastQAndASpeakText ) ) {
|
|
||||||
IMogoVoiceCmdCallBack cmdCallBack = mQAndAMap.remove( mLastQAndASpeakText );
|
|
||||||
if ( cmdCallBack != null ) {
|
|
||||||
cmdCallBack.onCmdCancel( speakText );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSpeakEnd( String speakText ) {
|
|
||||||
if ( mQAndAMap.containsKey( speakText ) ) {
|
|
||||||
mLastQAndASpeakText = speakText;
|
|
||||||
IMogoVoiceCmdCallBack cmdCallBack = mQAndAMap.get( speakText );
|
|
||||||
if ( cmdCallBack != null ) {
|
|
||||||
cmdCallBack.onSpeakEnd( speakText );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IMogoVoiceCmdCallBack callBack = mSpeakVoiceMap.remove( speakText );
|
|
||||||
if ( callBack != null ) {
|
|
||||||
callBack.onSpeakEnd( speakText );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSpeakSelectTimeOut( String speakText ) {
|
|
||||||
if ( mQAndAMap.containsKey( speakText ) ) {
|
|
||||||
if ( TextUtils.equals( speakText, mLastQAndASpeakText ) ) {
|
|
||||||
mLastQAndASpeakText = null;
|
|
||||||
}
|
|
||||||
IMogoVoiceCmdCallBack cmdCallBack = mQAndAMap.remove( speakText );
|
|
||||||
if ( cmdCallBack != null ) {
|
|
||||||
cmdCallBack.onSpeakSelectTimeOut( speakText );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IMogoVoiceCmdCallBack callBack = mSpeakVoiceMap.remove( speakText );
|
|
||||||
if ( callBack != null ) {
|
|
||||||
callBack.onSpeakSelectTimeOut( speakText );
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -196,13 +60,8 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
public void speakTTSVoice( String text, IMogoVoiceCmdCallBack callBack ) {
|
public void speakTTSVoice( String text, IMogoVoiceCmdCallBack callBack ) {
|
||||||
try {
|
if ( mTTS != null ) {
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
mTTS.speakTTSVoice( text, callBack );
|
||||||
if ( mHasFlush ) {
|
|
||||||
mSpeakVoiceMap.put( text, callBack );
|
|
||||||
mVoiceClient.speakDefault( text );
|
|
||||||
}
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,12 +71,8 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
public void speakTTSVoice( String text ) {
|
public void speakTTSVoice( String text ) {
|
||||||
try {
|
if ( mTTS != null ) {
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
mTTS.speakTTSVoice( text );
|
||||||
if ( mHasFlush ) {
|
|
||||||
mVoiceClient.speakDefault( text );
|
|
||||||
}
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,13 +83,25 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param type 播报策略
|
* @param type 播报策略
|
||||||
*/
|
*/
|
||||||
public void speakTTSVoice( String text, VoicePreemptType type, IMogoVoiceCmdCallBack callBack ) {
|
public void speakTTSVoice( String text, VoicePreemptType type, IMogoVoiceCmdCallBack callBack ) {
|
||||||
try {
|
if ( mTTS != null ) {
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
PreemptType preemptType = PreemptType.PREEMPT_TYPE_NONE;
|
||||||
if ( mHasFlush ) {
|
if ( type != null ) {
|
||||||
mSpeakVoiceMap.put( text, callBack );
|
switch ( type ) {
|
||||||
mVoiceClient.speakTypeText( text, type.getPreemptType() );
|
case PREEMPT_TYPE_FLUSH:
|
||||||
|
preemptType = PreemptType.PREEMPT_TYPE_FLUSH;
|
||||||
|
break;
|
||||||
|
case PREEMPT_TYPE_NEXT:
|
||||||
|
preemptType = PreemptType.PREEMPT_TYPE_NEXT;
|
||||||
|
break;
|
||||||
|
case PREEMPT_TYPE_IMMEADIATELY:
|
||||||
|
preemptType = PreemptType.PREEMPT_TYPE_IMMEDIATELY;
|
||||||
|
break;
|
||||||
|
case PREEMPT_TYPE_IMMEADIATELY_WITHOUT_CANCLE:
|
||||||
|
preemptType = PreemptType.PREEMPT_TYPE_IMMEDIATELY_WITHOUT_CANCEL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch ( Exception e ) {
|
mTTS.speakTTSVoice( text, preemptType, callBack );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,10 +111,8 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param tts 播报内容
|
* @param tts 播报内容
|
||||||
*/
|
*/
|
||||||
public void speakQAndACmd( String tts, IMogoVoiceCmdCallBack callBack ) {
|
public void speakQAndACmd( String tts, IMogoVoiceCmdCallBack callBack ) {
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
if ( mTTS != null ) {
|
||||||
if ( mHasFlush ) {
|
mTTS.speakQAndACmd( tts, callBack );
|
||||||
mQAndAMap.put( tts, callBack );
|
|
||||||
mVoiceClient.speakTtsAndRegistCmd( tts );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,10 +124,8 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param cancelCmds 取消命令唤醒词
|
* @param cancelCmds 取消命令唤醒词
|
||||||
*/
|
*/
|
||||||
public void speakQAndACmd( String tts, String[] okCmds, String[] cancelCmds, IMogoVoiceCmdCallBack callBack ) {
|
public void speakQAndACmd( String tts, String[] okCmds, String[] cancelCmds, IMogoVoiceCmdCallBack callBack ) {
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
if ( mTTS != null ) {
|
||||||
if ( mHasFlush ) {
|
mTTS.speakQAndACmd( tts, okCmds, cancelCmds, callBack );
|
||||||
mQAndAMap.put( tts, callBack );
|
|
||||||
mVoiceClient.speakTtsAndRegistCmd( tts, okCmds, cancelCmds );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,47 +137,9 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param callBack
|
* @param callBack
|
||||||
*/
|
*/
|
||||||
public void registerUnWakeupCommand( String cmd, String[] cmdWords, IMogoVoiceCmdCallBack callBack ) {
|
public void registerUnWakeupCommand( String cmd, String[] cmdWords, IMogoVoiceCmdCallBack callBack ) {
|
||||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
if ( mTTS != null ) {
|
||||||
mCmdMap.put( cmd, new ArrayList<>() );
|
mTTS.registerUnWakeupCommand( cmd, cmdWords, callBack );
|
||||||
}
|
}
|
||||||
mCmdMap.get( cmd ).add( callBack );
|
|
||||||
|
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
|
||||||
if ( mHasFlush ) {
|
|
||||||
mVoiceClient.registerCustomWakeupCmd( cmd, cmdWords );
|
|
||||||
mCacheUnWakeupCommands.remove( cmd );
|
|
||||||
}
|
|
||||||
Logger.i( TAG, "cache un wakeup command2. %s", cmd );
|
|
||||||
mCacheUnWakeupCommands.put( cmd, cmdWords );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册免唤醒命令
|
|
||||||
*
|
|
||||||
* @param cmd
|
|
||||||
* @param cmdWords
|
|
||||||
*/
|
|
||||||
public void registerUnWakeupCommand( String cmd, String[] cmdWords ) {
|
|
||||||
initFlushStatus( AbsMogoApplication.getApp() );
|
|
||||||
if ( mHasFlush ) {
|
|
||||||
mVoiceClient.registerCustomWakeupCmd( cmd, cmdWords );
|
|
||||||
mCacheUnWakeupCommands.remove( cmd );
|
|
||||||
}
|
|
||||||
Logger.i( TAG, "cache un wakeup command. %s", cmd );
|
|
||||||
mCacheUnWakeupCommands.put( cmd, cmdWords );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册免唤醒命令回调
|
|
||||||
*
|
|
||||||
* @param cmd
|
|
||||||
* @param callBack
|
|
||||||
*/
|
|
||||||
public synchronized void registerUnWakeupCommandCallback( String cmd, IMogoVoiceCmdCallBack callBack ) {
|
|
||||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
|
||||||
mCmdMap.put( cmd, new ArrayList<>() );
|
|
||||||
}
|
|
||||||
mCmdMap.get( cmd ).add( callBack );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -323,9 +148,9 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param cmd
|
* @param cmd
|
||||||
*/
|
*/
|
||||||
public synchronized void unregisterUnWakeupCommand( String cmd ) {
|
public synchronized void unregisterUnWakeupCommand( String cmd ) {
|
||||||
mCmdMap.remove( cmd );
|
if ( mTTS != null ) {
|
||||||
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
|
mTTS.unregisterUnWakeupCommand( cmd );
|
||||||
mCacheUnWakeupCommands.remove( cmd );
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -334,20 +159,12 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param cmd
|
* @param cmd
|
||||||
*/
|
*/
|
||||||
public synchronized void unregisterUnWakeupCommand( String cmd, IMogoVoiceCmdCallBack callBack ) {
|
public synchronized void unregisterUnWakeupCommand( String cmd, IMogoVoiceCmdCallBack callBack ) {
|
||||||
if ( mCmdMap.containsKey( cmd ) ) {
|
if ( mTTS != null ) {
|
||||||
List< IMogoVoiceCmdCallBack > callBacks = mCmdMap.get( cmd );
|
mTTS.unregisterUnWakeupCommand( cmd, callBack );
|
||||||
if ( callBacks != null ) {
|
|
||||||
callBacks.remove( callBack );
|
|
||||||
}
|
|
||||||
if ( callBacks.isEmpty() ) {
|
|
||||||
mCmdMap.remove( cmd );
|
|
||||||
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
|
|
||||||
mCacheUnWakeupCommands.remove( cmd );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startAssistant( Context context ) {
|
public void startAssistant( Context context ) {
|
||||||
startAssistant( context, 1 );
|
startAssistant( context, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,160 +172,49 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
|||||||
* @param context
|
* @param context
|
||||||
* @param status window_start_cancel 0 - 结束, 1 - 显示, 2 - 未激活调试进入
|
* @param status window_start_cancel 0 - 结束, 1 - 显示, 2 - 未激活调试进入
|
||||||
*/
|
*/
|
||||||
public static void startAssistant( Context context, int status ) {
|
public void startAssistant( Context context, int status ) {
|
||||||
final Intent intent = new Intent();
|
if ( mTTS != null ) {
|
||||||
intent.setFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
|
mTTS.startAIAssist( context, status );
|
||||||
intent.setAction( "pvetec.intent.action.txz.switch" );
|
}
|
||||||
intent.putExtra( "window_start_cancel", status );
|
|
||||||
intent.putExtra( "extra_switch_type", "window_start_cancel" );
|
|
||||||
Logger.d( TAG, "status = %d", status );
|
|
||||||
context.sendBroadcast( intent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void flush() {
|
public synchronized void flush() {
|
||||||
if ( mCacheUnWakeupCommands.isEmpty() ) {
|
if ( mTTS != null ) {
|
||||||
return;
|
mTTS.flush();
|
||||||
}
|
}
|
||||||
mHasFlush = true;
|
|
||||||
Logger.d( TAG, "flush cache voice command when voice service ready." );
|
|
||||||
final Map< String, String[] > tmp = new HashMap<>( mCacheUnWakeupCommands );
|
|
||||||
for ( String cmd : tmp.keySet() ) {
|
|
||||||
registerUnWakeupCommand( cmd, tmp.get( cmd ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isVoiceServiceReady( Context context ) {
|
|
||||||
if ( isProcessRunning( context, getPackageUid( context, "com.zhidao.speech" ) )
|
|
||||||
&& isProcessRunning( context, getPackageUid( context, "com.zhidao.speech.adapter" ) ) ) {
|
|
||||||
return true;
|
|
||||||
} else if (isProcessRunning(context, getPackageUid(context, "com.txznet.txz")) && isProcessRunning(context, getPackageUid(context, "com.txznet.adapter"))) {
|
|
||||||
Logger.d(TAG, "txz is voiceServiceReady");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// private boolean isRunningTaskExist( Context context, String processName ) {
|
|
||||||
//// ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
|
||||||
//// List< ActivityManager.RunningAppProcessInfo > processList = am.getRunningAppProcesses();
|
|
||||||
//// for ( ActivityManager.RunningAppProcessInfo info : processList ) {
|
|
||||||
//// if ( info.processName.equals( processName ) ) {
|
|
||||||
//// return true;
|
|
||||||
//// }
|
|
||||||
//// }
|
|
||||||
//// return false;
|
|
||||||
//// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 方法描述:判断某一应用是否正在运行
|
|
||||||
* Created by cafeting on 2017/2/4.
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param packageName 应用的包名
|
|
||||||
* @return true 表示正在运行,false 表示没有运行
|
|
||||||
*/
|
|
||||||
public static boolean isAppRunning( Context context, String packageName ) {
|
|
||||||
ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
|
||||||
List< ActivityManager.RunningTaskInfo > list = am.getRunningTasks( 100 );
|
|
||||||
if ( list.size() <= 0 ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for ( ActivityManager.RunningTaskInfo info : list ) {
|
|
||||||
if ( info.baseActivity.getPackageName().equals( packageName ) ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//获取已安装应用的 uid,-1 表示未安装此应用或程序异常
|
|
||||||
public static int getPackageUid( Context context, String packageName ) {
|
|
||||||
try {
|
|
||||||
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo( packageName, 0 );
|
|
||||||
if ( applicationInfo != null ) {
|
|
||||||
return applicationInfo.uid;
|
|
||||||
}
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断某一 uid 的程序是否有正在运行的进程,即是否存活
|
|
||||||
* Created by cafeting on 2017/2/4.
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param uid 已安装应用的 uid
|
|
||||||
* @return true 表示正在运行,false 表示没有运行
|
|
||||||
*/
|
|
||||||
public static boolean isProcessRunning( Context context, int uid ) {
|
|
||||||
ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
|
||||||
List< ActivityManager.RunningServiceInfo > runningServiceInfos = am.getRunningServices( 200 );
|
|
||||||
if ( runningServiceInfos.size() > 0 ) {
|
|
||||||
for ( ActivityManager.RunningServiceInfo appProcess : runningServiceInfos ) {
|
|
||||||
if ( uid == appProcess.uid ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void speakTTSAndDuck( String text ) {
|
public void speakTTSAndDuck( String text ) {
|
||||||
speakTTSAndDuck( text, null );
|
if ( mTTS != null ) {
|
||||||
|
mTTS.speakTTSAndDuck( text );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void speakTTSAndDuck( String text, IMogoVoiceCmdCallBack callBack ) {
|
public void speakTTSAndDuck( String text, IMogoVoiceCmdCallBack callBack ) {
|
||||||
try {
|
if ( mTTS != null ) {
|
||||||
if ( mInitReady ) {
|
mTTS.speakTTSAndDuck( text, callBack );
|
||||||
mSpeakVoiceMap.put( text, callBack );
|
|
||||||
mogoVoiceManager.toSpeak( text, -3, this );
|
|
||||||
}
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutUp( String ttsId, String text ) {
|
public void shutUp( String ttsId, String text ) {
|
||||||
try {
|
if ( mTTS != null ) {
|
||||||
mSpeakVoiceMap.remove( text );
|
mTTS.shutUp( ttsId, text );
|
||||||
mogoVoiceManager.shutUp( ttsId );
|
}
|
||||||
} catch ( Exception e ) {
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打断上一条正在播报的语音内容,仅在Speech上生效,TXZ为空实现
|
||||||
|
* 语音SDK生效版本从1.0.8.4版本起
|
||||||
|
*/
|
||||||
|
public void breakOffSpeak() {
|
||||||
|
if ( mTTS != null ) {
|
||||||
|
mTTS.breakOffSpeak();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearTTSCallback( String text ) {
|
public void clearTTSCallback( String text ) {
|
||||||
try {
|
if ( mTTS != null ) {
|
||||||
mSpeakVoiceMap.remove( text );
|
mTTS.clearTTSCallback( text );
|
||||||
} catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTtsStart( String ttsId, String text ) {
|
|
||||||
IMogoVoiceCmdCallBack callBack = mSpeakVoiceMap.get( text );
|
|
||||||
if ( callBack != null ) {
|
|
||||||
callBack.onTTSStart( ttsId, text );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTtsFinish( String ttsId, String text ) {
|
|
||||||
IMogoVoiceCmdCallBack callBack = mSpeakVoiceMap.remove( text );
|
|
||||||
if ( callBack != null ) {
|
|
||||||
callBack.onTTSEnd( ttsId, text );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTtsError( String ttsId, String text ) {
|
|
||||||
IMogoVoiceCmdCallBack callBack = mSpeakVoiceMap.remove( text );
|
|
||||||
if ( callBack != null ) {
|
|
||||||
callBack.onTTSError( ttsId, text );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +1,7 @@
|
|||||||
package com.mogo.commons.voice;
|
package com.mogo.commons.voice;
|
||||||
|
|
||||||
public interface IMogoVoiceCmdCallBack {
|
import com.mogo.tts.base.IMogoTTSCallback;
|
||||||
|
|
||||||
/**
|
public interface IMogoVoiceCmdCallBack extends IMogoTTSCallback {
|
||||||
* 新SDK接口
|
|
||||||
*
|
|
||||||
* @param ttsId
|
|
||||||
* @param tts
|
|
||||||
*/
|
|
||||||
default void onTTSStart( String ttsId, String tts ) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新SDK接口
|
|
||||||
*
|
|
||||||
* @param ttsId
|
|
||||||
* @param tts
|
|
||||||
*/
|
|
||||||
default void onTTSEnd( String ttsId, String tts ) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新SDK接口
|
|
||||||
*
|
|
||||||
* @param ttsId
|
|
||||||
* @param tts
|
|
||||||
*/
|
|
||||||
default void onTTSError( String ttsId, String tts ) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 免唤醒命令响应回调
|
|
||||||
*
|
|
||||||
* @param cmd
|
|
||||||
*/
|
|
||||||
default void onCmdSelected( String cmd ){}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语音播报临时免唤醒“确定”命令
|
|
||||||
*
|
|
||||||
* @param speakText 播报内容
|
|
||||||
*/
|
|
||||||
default void onCmdAction( String speakText ){}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语音播报临时免唤醒“取消”命令
|
|
||||||
*
|
|
||||||
* @param speakText 播报内容
|
|
||||||
*/
|
|
||||||
default void onCmdCancel( String speakText ){}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语音播报完毕
|
|
||||||
*
|
|
||||||
* @param speakText 播报内容
|
|
||||||
*/
|
|
||||||
default void onSpeakEnd( String speakText ){}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语音播报完临时命令选择超时
|
|
||||||
*
|
|
||||||
* @param speakText 播报内容
|
|
||||||
*/
|
|
||||||
default void onSpeakSelectTimeOut( String speakText ){}
|
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,9 @@
|
|||||||
package com.mogo.commons.voice;
|
package com.mogo.commons.voice;
|
||||||
|
|
||||||
import com.zhidao.auto.platform.voice.VoiceClient;
|
|
||||||
|
|
||||||
public enum VoicePreemptType {
|
public enum VoicePreemptType {
|
||||||
|
PREEMPT_TYPE_NONE, //不打断
|
||||||
|
PREEMPT_TYPE_IMMEADIATELY, //立即打断,取消当前的tts插队播放
|
||||||
PREEMPT_TYPE_NONE( VoiceClient.PreemptType.PREEMPT_TYPE_NONE ), //不打断
|
PREEMPT_TYPE_NEXT, //下一个插入,不取消当前的tts,插队下一个播放
|
||||||
PREEMPT_TYPE_IMMEADIATELY( VoiceClient.PreemptType.PREEMPT_TYPE_IMMEADIATELY ), //立即打断,取消当前的tts插队播放
|
PREEMPT_TYPE_FLUSH, //清空队列
|
||||||
PREEMPT_TYPE_NEXT( VoiceClient.PreemptType.PREEMPT_TYPE_NEXT ), //下一个插入,不取消当前的tts,插队下一个播放
|
PREEMPT_TYPE_IMMEADIATELY_WITHOUT_CANCLE; //立即打断,不取消当前tts
|
||||||
PREEMPT_TYPE_FLUSH( VoiceClient.PreemptType.PREEMPT_TYPE_FLUSH ), //清空队列
|
|
||||||
PREEMPT_TYPE_IMMEADIATELY_WITHOUT_CANCLE( VoiceClient.PreemptType.PREEMPT_TYPE_IMMEADIATELY_WITHOUT_CANCLE ); //立即打断,不取消当前tts
|
|
||||||
|
|
||||||
public VoiceClient.PreemptType preemptType;
|
|
||||||
|
|
||||||
VoicePreemptType( VoiceClient.PreemptType preemptType ) {
|
|
||||||
this.preemptType = preemptType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VoiceClient.PreemptType getPreemptType() {
|
|
||||||
return preemptType;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -87,4 +87,38 @@ public class AppUtils {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取已安装应用的 uid,-1 表示未安装此应用或程序异常
|
||||||
|
public static int getPackageUid( Context context, String packageName ) {
|
||||||
|
try {
|
||||||
|
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo( packageName, 0 );
|
||||||
|
if ( applicationInfo != null ) {
|
||||||
|
return applicationInfo.uid;
|
||||||
|
}
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断某一 uid 的程序是否有正在运行的进程,即是否存活
|
||||||
|
* Created by cafeting on 2017/2/4.
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param uid 已安装应用的 uid
|
||||||
|
* @return true 表示正在运行,false 表示没有运行
|
||||||
|
*/
|
||||||
|
public static boolean isProcessRunning( Context context, int uid ) {
|
||||||
|
ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
||||||
|
List< ActivityManager.RunningServiceInfo > runningServiceInfos = am.getRunningServices( 200 );
|
||||||
|
if ( runningServiceInfos.size() > 0 ) {
|
||||||
|
for ( ActivityManager.RunningServiceInfo appProcess : runningServiceInfos ) {
|
||||||
|
if ( uid == appProcess.uid ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,94 +29,88 @@ PASSWORD=xintai2018
|
|||||||
RELEASE=false
|
RELEASE=false
|
||||||
# 模块版本
|
# 模块版本
|
||||||
## 工程内模块
|
## 工程内模块
|
||||||
MOGO_COMMONS_VERSION=1.2.1.22
|
MOGO_COMMONS_VERSION=2.0.2
|
||||||
MOGO_UTILS_VERSION=1.2.1.22
|
MOGO_UTILS_VERSION=2.0.0
|
||||||
MAP_AMAP_VERSION=1.2.1.22
|
MAP_AMAP_VERSION=2.0.0
|
||||||
MAP_AUTONAVI_VERSION=1.2.1.22
|
MAP_AUTONAVI_VERSION=2.0.0
|
||||||
MOGO_MAP_VERSION=1.2.1.22
|
MOGO_MAP_VERSION=2.0.0
|
||||||
MOGO_MAP_API_VERSION=1.2.1.22
|
MOGO_MAP_API_VERSION=2.0.0
|
||||||
MOGO_SERVICE_VERSION=1.2.1.22
|
MOGO_SERVICE_VERSION=2.0.0
|
||||||
MOGO_SERVICE_API_VERSION=1.2.1.22
|
MOGO_SERVICE_API_VERSION=2.0.2
|
||||||
MOGO_CONNECTION_VERSION=1.2.1.22
|
MOGO_CONNECTION_VERSION=2.0.0
|
||||||
MOGO_MODULE_APPS_VERSION=1.2.1.22
|
MOGO_MODULE_APPS_VERSION=2.0.0
|
||||||
MOGO_MODULE_NAVI_VERSION=1.2.1.22
|
MOGO_MODULE_NAVI_VERSION=2.0.0
|
||||||
MOGO_MODULE_SHARE_VERSION=1.2.1.22
|
MOGO_MODULE_SHARE_VERSION=2.0.0
|
||||||
MOGO_MODULE_COMMON_VERSION=1.2.1.22
|
MOGO_MODULE_COMMON_VERSION=2.0.0
|
||||||
MOGO_MODULE_MAIN_VERSION=1.2.1.22
|
MOGO_MODULE_MAIN_VERSION=2.0.0
|
||||||
MOGO_MODULE_MAP_VERSION=1.2.1.22
|
MOGO_MODULE_MAP_VERSION=2.0.0
|
||||||
MOGO_MODULE_SERVICE_VERSION=1.2.1.22
|
MOGO_MODULE_SERVICE_VERSION=2.0.0
|
||||||
MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.22
|
MOGO_MODULE_EXTENSIONS_VERSION=2.0.0
|
||||||
MOGO_MODULE_SEARCH_VERSION=1.2.1.22
|
MOGO_MODULE_SEARCH_VERSION=2.0.0
|
||||||
MOGO_MODULE_BACK_VERSION=1.2.1.22
|
MOGO_MODULE_BACK_VERSION=2.0.0
|
||||||
MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.22
|
MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.0
|
||||||
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.22
|
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.0
|
||||||
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.22
|
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.0
|
||||||
MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.22
|
MOGO_MODULE_AUTHORIZE_VERSION=2.0.0
|
||||||
MOGO_MODULE_GUIDE_VERSION=1.2.1.22
|
MOGO_MODULE_GUIDE_VERSION=2.0.0
|
||||||
MOGO_MODULE_MEDIA_VERSION=1.2.1.22
|
MOGO_MODULE_MEDIA_VERSION=2.0.0
|
||||||
MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.22
|
MOGO_MODULE_MAIN_LAUNCHER_VERSION = 2.0.0
|
||||||
MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.22
|
MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 2.0.0
|
||||||
MOGO_MODULE_V2X_VERSION=1.2.1.22
|
MOGO_MODULE_V2X_VERSION=2.0.0
|
||||||
# 基础服务实现:passport、socket、location
|
# 基础服务实现:passport、socket、location
|
||||||
MOGO_BASE_SERVICES_APK_VERSION = 1.2.1.22
|
MOGO_BASE_SERVICES_APK_VERSION = 2.0.0
|
||||||
MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
|
MOGO_BASE_SERVICES_SDK_VERSION = 2.0.0
|
||||||
|
|
||||||
## 工程外部模块
|
## 工程外部模块
|
||||||
# 探路
|
# 探路
|
||||||
MOGO_MODULE_TANLU_VERSION=1.3.1.24
|
MOGO_MODULE_TANLU_VERSION=2.0.0
|
||||||
# 车聊聊
|
|
||||||
CARCHATTING_VERSION=1.6.5
|
|
||||||
# 车聊聊接口
|
|
||||||
CARCHATTINGPROVIDER_VERSION=1.3.4
|
|
||||||
# 视频引导
|
# 视频引导
|
||||||
MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT
|
MOGO_MODULE_GUIDESHOW_VERSION=2.0.0
|
||||||
## 视频引导接口
|
|
||||||
|
|
||||||
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
|
|
||||||
# 在线车辆F
|
|
||||||
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
|
|
||||||
# 推送
|
# 推送
|
||||||
MOGO_MODULE_PUSH_VERSION=1.1.6.2
|
MOGO_MODULE_PUSH_VERSION=2.0.0
|
||||||
MOGO_MODULE_PUSH_BASE_VERSION=1.1.5.5
|
MOGO_MODULE_PUSH_BASE_VERSION=2.0.0
|
||||||
MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6
|
MOGO_MODULE_PUSH_NOOP_VERSION=2.0.0
|
||||||
# 广告资源位
|
|
||||||
MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
|
||||||
# 探路上报和分享模块
|
# 探路上报和分享模块
|
||||||
TANLULIB_VERSION=1.3.1.24
|
TANLULIB_VERSION=2.0.0
|
||||||
MOGO_TANLU_API_VERSION = 1.0.0-SNAPSHOT
|
MOGO_TANLU_API_VERSION=2.0.0
|
||||||
|
|
||||||
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_VERSION=2.0.0
|
||||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION = 1.2.1.10-SNAPSHOT
|
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.0
|
||||||
# 小控件
|
# 小控件
|
||||||
MOGO_MODULE_WIDGETS_VERSION = 1.2.1.10-SNAPSHOT
|
MOGO_MODULE_WIDGETS_VERSION=2.0.0
|
||||||
|
|
||||||
# Boost分包
|
|
||||||
BOOST_MULTIDEX_VERSION=1.0.0
|
|
||||||
# hook ARouter分包实现
|
|
||||||
HOOKPLUGIN_VERSION=1.0.0
|
|
||||||
|
|
||||||
# obu
|
# obu
|
||||||
MOGO_MODULE_OBU_VERSION = 1.2.1.10-SNAPSHOT
|
MOGO_MODULE_OBU_VERSION=2.0.0
|
||||||
|
# 皮肤
|
||||||
|
MOGO_SKIN_SUPPORT_VERSION=2.0.0
|
||||||
|
MOGO_SKIN_LIGHT_VERSION=2.0.0
|
||||||
|
MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.0
|
||||||
|
MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.0
|
||||||
|
SKIN_SUPPORT_VERSION=2.0.0
|
||||||
|
SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.0
|
||||||
|
SKIN_SUPPORT_CARDVIEW_VERSION=2.0.0
|
||||||
|
SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.0
|
||||||
|
SKIN_SUPPORT_DESIGN_VERSION=2.0.0
|
||||||
# 闪屏页
|
# 闪屏页
|
||||||
MOGO_MODULE_SPLASH_VERSION = 1.0.0-SNAPSHOT
|
MOGO_MODULE_SPLASH_VERSION=2.0.0
|
||||||
MOGO_MODULE_SPLASH_NOOP_VERSION = 1.0.0-SNAPSHOT
|
MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.0
|
||||||
MOGO_SKIN_SUPPORT_VERSION=1.0.0
|
# monitor
|
||||||
MOGO_SKIN_LIGHT_VERSION=1.0.0
|
MOGO_MODULE_MONITOR_VERSION=2.0.0
|
||||||
MOGO_SKIN_SUPPORT_IMPL_VERSION=1.0.0
|
# bugly
|
||||||
MOGO_SKIN_SUPPORT_NOOP_VERSION=1.0.0
|
CRASHREPORT_VERSION=2.0.0
|
||||||
|
CRASHREPORT_BUGLY_VERSION=2.0.0
|
||||||
|
CRASHREPORT_NOOP_VERSION=2.0.0
|
||||||
|
## tts
|
||||||
|
TTS_BASE_VERSION=1.0.0
|
||||||
|
TTS_DI_VERSION=1.0.0
|
||||||
|
TTS_ZHI_VERSION=1.0.0
|
||||||
|
TTS_NOOP_VERSION=1.0.0
|
||||||
|
|
||||||
|
######## 外部依赖引用
|
||||||
|
# 车聊聊
|
||||||
|
CARCHATTING_VERSION=1.9.7.1
|
||||||
|
# 车聊聊接口
|
||||||
|
CARCHATTINGPROVIDER_VERSION=1.4.1
|
||||||
# loglib
|
# loglib
|
||||||
LOGLIB_VERSION = 1.0.4
|
LOGLIB_VERSION = 1.0.4
|
||||||
# monitor
|
|
||||||
MOGO_MODULE_MONITOR_VERSION = 1.0.0-SNAPSHOT
|
|
||||||
|
|
||||||
CRASHREPORT_VERSION = 1.0.0
|
|
||||||
CRASHREPORT_BUGLY_VERSION = 1.0.0
|
|
||||||
CRASHREPORT_NOOP_VERSION = 1.0.0
|
|
||||||
|
|
||||||
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
|
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
|
||||||
applicationId=com.mogo.launcer
|
applicationId=com.mogo.launcer
|
||||||
|
|||||||
@@ -34,10 +34,12 @@ public class AMapBaseMapView extends MogoBaseMapView {
|
|||||||
@Override
|
@Override
|
||||||
protected IMogoMapView createMapView( Context context ) {
|
protected IMogoMapView createMapView( Context context ) {
|
||||||
IMogoMapView mapView = AMapViewHandler.getMapView();
|
IMogoMapView mapView = AMapViewHandler.getMapView();
|
||||||
if ( mapView.getMapView().getParent() != null ) {
|
if ( mapView != null
|
||||||
|
&& mapView.getMapView()!= null
|
||||||
|
&& mapView.getMapView().getParent() != null ) {
|
||||||
ViewGroup group = ( ViewGroup ) mapView.getMapView().getParent();
|
ViewGroup group = ( ViewGroup ) mapView.getMapView().getParent();
|
||||||
group.removeView( mapView.getMapView() );
|
group.removeView( mapView.getMapView() );
|
||||||
}
|
}
|
||||||
return AMapViewHandler.getMapView();
|
return mapView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
|
|||||||
import com.mogo.map.impl.amap.message.AMapMessageListener;
|
import com.mogo.map.impl.amap.message.AMapMessageListener;
|
||||||
import com.mogo.map.impl.amap.message.AMapMessageManager;
|
import com.mogo.map.impl.amap.message.AMapMessageManager;
|
||||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||||
|
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
|
||||||
import com.mogo.map.impl.amap.utils.MogoMapUtils;
|
import com.mogo.map.impl.amap.utils.MogoMapUtils;
|
||||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||||
@@ -234,6 +235,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if ( mMapView != null ) {
|
if ( mMapView != null ) {
|
||||||
mMapView.onDestroy();
|
mMapView.onDestroy();
|
||||||
|
AMapUIController.getInstance().release();
|
||||||
|
AMapWrapper.release();
|
||||||
Logger.d( TAG, "map onDestroy" );
|
Logger.d( TAG, "map onDestroy" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
|
|||||||
import com.mogo.map.impl.amap.message.AMapMessageListener;
|
import com.mogo.map.impl.amap.message.AMapMessageListener;
|
||||||
import com.mogo.map.impl.amap.message.AMapMessageManager;
|
import com.mogo.map.impl.amap.message.AMapMessageManager;
|
||||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||||
|
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
|
||||||
import com.mogo.map.impl.amap.utils.MogoMapUtils;
|
import com.mogo.map.impl.amap.utils.MogoMapUtils;
|
||||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||||
@@ -48,6 +49,7 @@ import com.mogo.map.uicontroller.EnumMapUI;
|
|||||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||||
import com.mogo.map.uicontroller.MapControlResult;
|
import com.mogo.map.uicontroller.MapControlResult;
|
||||||
|
import com.mogo.utils.NetworkUtils;
|
||||||
import com.mogo.utils.WindowUtils;
|
import com.mogo.utils.WindowUtils;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
@@ -163,7 +165,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
|||||||
// mMapView.setRouteOverlayVisible( false );
|
// mMapView.setRouteOverlayVisible( false );
|
||||||
// mMapView.setCarOverlayVisible( false );
|
// mMapView.setCarOverlayVisible( false );
|
||||||
changeMapMode( EnumMapUI.CarUp_2D );
|
changeMapMode( EnumMapUI.CarUp_2D );
|
||||||
setTrafficEnabled( true );
|
if ( NetworkUtils.isConnected( mMapView.getContext() ) ) {
|
||||||
|
setTrafficEnabled( true );
|
||||||
|
}
|
||||||
mMapView.getMap().moveCamera( CameraUpdateFactory.zoomTo( mDefaultZoomLevel ) );
|
mMapView.getMap().moveCamera( CameraUpdateFactory.zoomTo( mDefaultZoomLevel ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,6 +206,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate( Bundle bundle ) {
|
public void onCreate( Bundle bundle ) {
|
||||||
|
Logger.d( TAG, Log.getStackTraceString( new Throwable( ) ) );
|
||||||
if ( mMapView != null ) {
|
if ( mMapView != null ) {
|
||||||
mMapView.onCreate( bundle );
|
mMapView.onCreate( bundle );
|
||||||
Logger.d( TAG, "map onCreate" );
|
Logger.d( TAG, "map onCreate" );
|
||||||
@@ -232,6 +237,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if ( mMapView != null ) {
|
if ( mMapView != null ) {
|
||||||
mMapView.onDestroy();
|
mMapView.onDestroy();
|
||||||
|
AMapUIController.getInstance().release();
|
||||||
|
AMapWrapper.release();
|
||||||
Logger.d( TAG, "map onDestroy" );
|
Logger.d( TAG, "map onDestroy" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,6 +315,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
|||||||
@Override
|
@Override
|
||||||
public void setTrafficEnabled( boolean visible ) {
|
public void setTrafficEnabled( boolean visible ) {
|
||||||
if ( checkMapView() ) {
|
if ( checkMapView() ) {
|
||||||
|
Logger.d( TAG, "setTrafficEnabled" );
|
||||||
mMapView.getMap().setTrafficEnabled( true );
|
mMapView.getMap().setTrafficEnabled( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -552,7 +560,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
|||||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||||
}
|
}
|
||||||
Logger.d( TAG, "Zoom锁定锁车比例尺 %s", var1 );
|
Logger.d( TAG, "Zoom锁定锁车比例尺 %s", var1 );
|
||||||
// TODO: 2020/8/27 设置锁车比例尺
|
|
||||||
// mMapView.setLockZoom( var1 );
|
// mMapView.setLockZoom( var1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ public class AMapWrapper implements IMogoMap {
|
|||||||
return sAMap;
|
return sAMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void release(){
|
||||||
|
sAMap = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IMogoUiSettings getUiSettings() {
|
public IMogoUiSettings getUiSettings() {
|
||||||
if ( !checkAMap() ) {
|
if ( !checkAMap() ) {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class NaviClient implements IMogoNavi {
|
|||||||
private boolean mAimlessStatus;
|
private boolean mAimlessStatus;
|
||||||
|
|
||||||
private NaviClient( Context context ) {
|
private NaviClient( Context context ) {
|
||||||
mContext = context;
|
mContext = context.getApplicationContext();
|
||||||
if ( DebugConfig.isUseCustomNavi() ) {
|
if ( DebugConfig.isUseCustomNavi() ) {
|
||||||
// 按需初始化导航组件
|
// 按需初始化导航组件
|
||||||
initAMapNavi();
|
initAMapNavi();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import android.text.TextUtils;
|
|||||||
|
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
import com.mogo.commons.AbsMogoApplication;
|
||||||
import com.mogo.commons.voice.AIAssist;
|
import com.mogo.commons.voice.AIAssist;
|
||||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
@@ -16,7 +15,7 @@ import java.util.LinkedList;
|
|||||||
* <p>
|
* <p>
|
||||||
* 策略:队列缓存预播报的 tts,然后上一句播完后
|
* 策略:队列缓存预播报的 tts,然后上一句播完后
|
||||||
*/
|
*/
|
||||||
public class TTSSpeaker implements IMogoVoiceCmdCallBack {
|
public class TTSSpeaker {
|
||||||
|
|
||||||
private static volatile TTSSpeaker sInstance;
|
private static volatile TTSSpeaker sInstance;
|
||||||
|
|
||||||
@@ -48,7 +47,6 @@ public class TTSSpeaker implements IMogoVoiceCmdCallBack {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mWaiting.add( tts );
|
mWaiting.add( tts );
|
||||||
peekAndSpeak();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void shutUp() {
|
public synchronized void shutUp() {
|
||||||
@@ -60,61 +58,5 @@ public class TTSSpeaker implements IMogoVoiceCmdCallBack {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCmdSelected( String cmd ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCmdAction( String speakText ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCmdCancel( String speakText ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSpeakEnd( String speakText ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSpeakSelectTimeOut( String speakText ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTTSStart( String ttsId, String tts ) {
|
|
||||||
if ( TextUtils.equals( mLastTts, tts ) ) {
|
|
||||||
mLastTtsId = ttsId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTTSEnd( String ttsId, String tts ) {
|
|
||||||
mLastTtsId = null;
|
|
||||||
peekAndSpeak();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTTSError( String ttsId, String tts ) {
|
|
||||||
mLastTtsId = null;
|
|
||||||
peekAndSpeak();
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized void peekAndSpeak() {
|
|
||||||
if ( mWaiting.isEmpty() ) {
|
|
||||||
mLastTts = null;
|
|
||||||
mLastTtsId = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( mLastTtsId != null ) {
|
|
||||||
// 上一句还没有播完
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastTts = mWaiting.pop();
|
|
||||||
AIAssist.getInstance( AbsMogoApplication.getApp() ).speakTTSAndDuck( mLastTts, this );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public class AMapUIController implements IMogoMapUIController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void release() {
|
public synchronized void release() {
|
||||||
|
mClient = null;
|
||||||
sInstance = null;
|
sInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
@@ -6,6 +6,7 @@ import android.content.Intent;
|
|||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.mogo.commons.storage.SpStorage;
|
||||||
import com.mogo.map.impl.amap.utils.IconTypeUtils;
|
import com.mogo.map.impl.amap.utils.IconTypeUtils;
|
||||||
import com.mogo.map.navi.MogoNaviInfo;
|
import com.mogo.map.navi.MogoNaviInfo;
|
||||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||||
@@ -66,6 +67,11 @@ public class AutoNaviReceiver extends BroadcastReceiver {
|
|||||||
int state = intent.getIntExtra( "EXTRA_STATE", -1 );
|
int state = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||||
handleMapStatusChanged( state );
|
handleMapStatusChanged( state );
|
||||||
break;
|
break;
|
||||||
|
case 10056:
|
||||||
|
String json = intent.getStringExtra( "EXTRA_ROAD_INFO" );
|
||||||
|
SpStorage.setNavigationTarget(json);
|
||||||
|
Logger.d( TAG, json );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +132,7 @@ public class AutoNaviReceiver extends BroadcastReceiver {
|
|||||||
case MapStateValue.START_NAVI:
|
case MapStateValue.START_NAVI:
|
||||||
case MapStateValue.START_EMULATOR_NAVI:
|
case MapStateValue.START_EMULATOR_NAVI:
|
||||||
if ( MapState.getInstance().isNaving() ) {
|
if ( MapState.getInstance().isNaving() ) {
|
||||||
|
Logger.w( TAG, "naving..." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MapState.getInstance().setNaving( true );
|
MapState.getInstance().setNaving( true );
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
|||||||
if ( mMapView != null ) {
|
if ( mMapView != null ) {
|
||||||
mMapView.onDestroy();
|
mMapView.onDestroy();
|
||||||
}
|
}
|
||||||
|
MogoMap.getInstance().clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -46,4 +46,9 @@ public class MogoMap {
|
|||||||
public IMogoMap getMogoMap() {
|
public IMogoMap getMogoMap() {
|
||||||
return mMap;
|
return mMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clear(){
|
||||||
|
mContext = null;
|
||||||
|
mMap = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.Collection;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author congtaowang
|
* @author congtaowang
|
||||||
@@ -33,7 +34,7 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker
|
|||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map< String, List< IMogoMarker > > mServicesMarkers = new HashMap<>();
|
private Map< String, List< IMogoMarker > > mServicesMarkers = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private MogoMarkersHandler() {
|
private MogoMarkersHandler() {
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
@@ -3,15 +3,10 @@ package com.zhidao.mogo.tanlu.api;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
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.analytics.AnalyticsUtils;
|
||||||
import com.mogo.service.IMogoServiceApis;
|
import com.mogo.service.share.IMogoTanluProvider;
|
||||||
import com.mogo.service.MogoServicePaths;
|
import com.mogo.service.share.TanluUploadParams;
|
||||||
import com.mogo.service.tanlu.IMogoTanluProvider;
|
|
||||||
import com.mogo.service.tanlu.TanluUploadParams;
|
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
import com.zhidao.roadcondition.service.MainService;
|
import com.zhidao.roadcondition.service.MainService;
|
||||||
import com.zhidao.roadcondition.service.UploadParams;
|
import com.zhidao.roadcondition.service.UploadParams;
|
||||||
|
|||||||
@@ -46,12 +46,11 @@ dependencies {
|
|||||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
|
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
|
||||||
implementation 'com.zhidaoauto.controller:api:1.0.8'
|
implementation 'com.zhidaoauto.controller:api:1.0.8'
|
||||||
implementation 'com.zhidao.cosupload:cosuploadsdk:1.1.6'
|
implementation 'com.zhidao.cosupload:cosuploadsdk:1.1.6', {
|
||||||
|
exclude group: 'com.zhidao.utils', module: 'utils'
|
||||||
|
}
|
||||||
implementation 'com.zhidao.video:video-processor:1.0.2.1'
|
implementation 'com.zhidao.video:video-processor:1.0.2.1'
|
||||||
implementation 'com.foundation.utils:common-utils:1.0.7'
|
implementation 'com.foundation.utils:common-utils:1.0.7'
|
||||||
|
|
||||||
implementation rootProject.ext.dependencies.eventbus
|
|
||||||
compileOnly rootProject.ext.dependencies.mogocommons
|
|
||||||
implementation rootProject.ext.dependencies.eventbus
|
implementation rootProject.ext.dependencies.eventbus
|
||||||
implementation rootProject.ext.dependencies.coroutinescore
|
implementation rootProject.ext.dependencies.coroutinescore
|
||||||
implementation rootProject.ext.dependencies.coroutinesandroid
|
implementation rootProject.ext.dependencies.coroutinesandroid
|
||||||
@@ -60,9 +59,16 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.gson
|
implementation rootProject.ext.dependencies.gson
|
||||||
implementation rootProject.ext.dependencies.rxjava
|
implementation rootProject.ext.dependencies.rxjava
|
||||||
implementation rootProject.ext.dependencies.rxandroid
|
implementation rootProject.ext.dependencies.rxandroid
|
||||||
compileOnly rootProject.ext.dependencies.mogomap
|
|
||||||
implementation rootProject.ext.dependencies.aspectj
|
implementation rootProject.ext.dependencies.aspectj
|
||||||
implementation rootProject.ext.dependencies.analytics
|
implementation rootProject.ext.dependencies.analytics
|
||||||
|
|
||||||
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
|
compileOnly rootProject.ext.dependencies.mogocommons
|
||||||
|
compileOnly rootProject.ext.dependencies.mogomap
|
||||||
|
} else {
|
||||||
|
implementation project(':modules:mogo-module-common')
|
||||||
|
implementation project(':libraries:mogo-map')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ class CosStatusController : CosStatusCallback {
|
|||||||
) {
|
) {
|
||||||
// VoiceController.speakVoice("cos上报失败")
|
// VoiceController.speakVoice("cos上报失败")
|
||||||
Log.d(TAG, "uploadCosFailed mType = $mType")
|
Log.d(TAG, "uploadCosFailed mType = $mType")
|
||||||
if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
|
// if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
|
||||||
sendGetInfoFailedReceiver("100")
|
// sendGetInfoFailedReceiver("100")
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isRetry) {
|
if (!isRetry) {
|
||||||
@@ -227,9 +227,9 @@ class CosStatusController : CosStatusCallback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (type == INFO_TYPE_VIDEO) {
|
// if (type == INFO_TYPE_VIDEO) {
|
||||||
TipToast.shortTip("分享失败,请检查网络")
|
// TipToast.shortTip("分享失败,请检查网络")
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,14 @@ import android.os.IBinder
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.elegant.analytics.Analytics
|
import com.elegant.analytics.Analytics
|
||||||
import com.mogo.commons.AbsMogoApplication
|
import com.mogo.commons.AbsMogoApplication
|
||||||
import com.mogo.commons.debug.DebugConfig
|
import com.mogo.utils.logger.Logger
|
||||||
|
import com.mogo.utils.storage.SharedPrefsMgr
|
||||||
import com.zhidao.cosupload.manager.CosUploadManagerImpl
|
import com.zhidao.cosupload.manager.CosUploadManagerImpl
|
||||||
import com.zhidao.roadcondition.BuildConfig
|
import com.zhidao.roadcondition.BuildConfig
|
||||||
import com.zhidao.roadcondition.constant.*
|
import com.zhidao.roadcondition.constant.DEFAULT_VIDEO_DURATION
|
||||||
|
import com.zhidao.roadcondition.constant.TANLU_ROAD_CURRENT
|
||||||
|
import com.zhidao.roadcondition.constant.UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO
|
||||||
|
import com.zhidao.roadcondition.constant.UPLOAD_FROM_STRATEGY_BLOCK_AUTO
|
||||||
import com.zhidao.roadcondition.event.GetImageSuccessEvent
|
import com.zhidao.roadcondition.event.GetImageSuccessEvent
|
||||||
import com.zhidao.roadcondition.event.LatLngStickyEventBus
|
import com.zhidao.roadcondition.event.LatLngStickyEventBus
|
||||||
import com.zhidao.roadcondition.util.*
|
import com.zhidao.roadcondition.util.*
|
||||||
@@ -200,18 +204,18 @@ class MainService : Service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun sendMarkerInfoReceiver(lat: Double, lon: Double, imageUrl: String?, type: String?) {
|
private fun sendMarkerInfoReceiver(lat: Double, lon: Double, imageUrl: String?, type: String?) {
|
||||||
Log.e("MainService", "sendMarkerInfoReceiver ------> type = $type ")
|
// Log.e("MainService", "sendMarkerInfoReceiver ------> type = $type ")
|
||||||
Log.e("MainService", "sendMarkerInfoReceiver ------> fromType = $fromType ")
|
// Log.e("MainService", "sendMarkerInfoReceiver ------> fromType = $fromType ")
|
||||||
Log.e("MainService", "sendMarkerInfoReceiver ------> isCustom = $isCustom ")
|
// Log.e("MainService", "sendMarkerInfoReceiver ------> isCustom = $isCustom ")
|
||||||
var intent = Intent()
|
// var intent = Intent()
|
||||||
intent.action = "com.zhidao.roadcondition.marker.info"
|
// intent.action = "com.zhidao.roadcondition.marker.info"
|
||||||
intent.putExtra("type", type)
|
// intent.putExtra("type", type)
|
||||||
intent.putExtra("imageUrl", imageUrl)
|
// intent.putExtra("imageUrl", imageUrl)
|
||||||
intent.putExtra("lat", lat)
|
// intent.putExtra("lat", lat)
|
||||||
intent.putExtra("lon", lon)
|
// intent.putExtra("lon", lon)
|
||||||
intent.putExtra("custom", isCustom)
|
// intent.putExtra("custom", isCustom)
|
||||||
intent.putExtra("fromType", fromType)
|
// intent.putExtra("fromType", fromType)
|
||||||
sendBroadcast(intent)
|
// sendBroadcast(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -221,12 +225,16 @@ class MainService : Service() {
|
|||||||
//开始开始监听速度,只要超过一次5公里每小时则即开始获取策略进行本地上报 只有release才加此判断,qa环境方便测试
|
//开始开始监听速度,只要超过一次5公里每小时则即开始获取策略进行本地上报 只有release才加此判断,qa环境方便测试
|
||||||
LocationUtil.getInstance().setonSpeedlistenner(object : LocationUtil.SpeedListener {
|
LocationUtil.getInstance().setonSpeedlistenner(object : LocationUtil.SpeedListener {
|
||||||
override fun onSpeedGet(speed: Float) {
|
override fun onSpeedGet(speed: Float) {
|
||||||
if (speed > (5 / 3.6f) && !isGetStrategies) {
|
var isOpen = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().applicationContext).getBoolean("KEY_SERVER_REPORTSTRATEGY_SWITCH", false)
|
||||||
mainServiceHttpModel.initStrategies {
|
Logger.d("EntrancePresenter", " -------- isOpen = $isOpen")
|
||||||
handleReportStrategy()
|
if (isOpen) {
|
||||||
|
if (speed > (5 / 3.6f) && !isGetStrategies) {
|
||||||
|
mainServiceHttpModel.initStrategies {
|
||||||
|
handleReportStrategy()
|
||||||
|
}
|
||||||
|
Log.d("MainService", "initLocationListener more than 5 start upload speed = $speed")
|
||||||
|
isGetStrategies = true
|
||||||
}
|
}
|
||||||
Log.d("MainService", "initLocationListener more than 5 start upload speed = $speed")
|
|
||||||
isGetStrategies = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -264,20 +264,23 @@ class MainServiceController {
|
|||||||
longitude: Double,
|
longitude: Double,
|
||||||
latitude: Double
|
latitude: Double
|
||||||
) {
|
) {
|
||||||
Log.d(TAG, " geoLocation -- poiType = $poiType");
|
Log.d(TAG, " geoLocation -- poiType = $poiType")
|
||||||
LocationUtil.getInstance()
|
LocationUtil.getInstance()
|
||||||
.geoCodeLocation(locationInfo.toLatLngPoint(), { locInfo: LocationInfo ->
|
.geoCodeLocation(locationInfo.toLatLngPoint(), { locInfo: LocationInfo ->
|
||||||
|
Log.d(TAG, "geoLocation -------start -->")
|
||||||
postInformationMessage(
|
postInformationMessage(
|
||||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude),
|
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude),
|
||||||
customSend
|
customSend
|
||||||
)
|
)
|
||||||
}, {
|
}, {
|
||||||
//转换失败的情况下再重试一次
|
//转换失败的情况下再重试一次
|
||||||
|
Log.d(TAG, "geoLocation -------true-->")
|
||||||
geoRetryed = if (!geoRetryed) {
|
geoRetryed = if (!geoRetryed) {
|
||||||
geoLocation(type, url, locationInfo, isCustom, trafficInfoType, isShare, customSend, poiType,mainInfoId,longitude,latitude)
|
geoLocation(type, url, locationInfo, isCustom, trafficInfoType, isShare, customSend, poiType,mainInfoId,longitude,latitude)
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
//如果两次都失败,直接上报服务端
|
//如果两次都失败,直接上报服务端
|
||||||
|
Log.d(TAG, "geoLocation ---- postInformationMessage ---false-->")
|
||||||
postInformationMessage(
|
postInformationMessage(
|
||||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude),
|
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude),
|
||||||
customSend
|
customSend
|
||||||
|
|||||||
@@ -39,7 +39,12 @@ public class MainIndependentActivity extends MainActivity {
|
|||||||
eventPanelParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
|
eventPanelParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
|
||||||
mEntrance.setLayoutParams( eventPanelParams );
|
mEntrance.setLayoutParams( eventPanelParams );
|
||||||
|
|
||||||
mLeftShadowFrame.setVisibility(View.VISIBLE);
|
// 事件面板
|
||||||
|
FrameLayout.LayoutParams historyMessagePanelParams = ( ( FrameLayout.LayoutParams ) mEventPanel.getLayoutParams() );
|
||||||
|
historyMessagePanelParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
|
||||||
|
mHistoryMessagePanel.setLayoutParams( historyMessagePanelParams );
|
||||||
|
|
||||||
|
mLeftShadowFrame.setVisibility(View.INVISIBLE);
|
||||||
mApps.setVisibility( View.GONE );
|
mApps.setVisibility( View.GONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +63,6 @@ public class MainIndependentActivity extends MainActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<dimen name="module_main_entrance_fragment_container_marginLeft">358px</dimen>
|
||||||
|
<dimen name="module_main_header_fragment_container_marginLeft">366px</dimen>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<dimen name="module_main_entrance_fragment_container_marginLeft">358px</dimen>
|
||||||
|
<dimen name="module_main_header_fragment_container_marginLeft">366px</dimen>
|
||||||
|
</resources>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="module_main_entrance_fragment_container_marginLeft">350px</dimen>
|
<dimen name="module_main_entrance_fragment_container_marginLeft">358px</dimen>
|
||||||
<dimen name="module_main_header_fragment_container_marginLeft">366px</dimen>
|
<dimen name="module_main_header_fragment_container_marginLeft">366px</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -2,15 +2,18 @@ package com.zhidao.mogo.module.main.launcher;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Process;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.mogo.map.uicontroller.EnumMapUI;
|
||||||
import com.mogo.module.extensions.utils.ExtensionsConfig;
|
import com.mogo.module.extensions.utils.ExtensionsConfig;
|
||||||
import com.mogo.module.main.MainActivity;
|
import com.mogo.module.main.MainActivity;
|
||||||
import com.mogo.module.main.cards.MogoModulesManager;
|
import com.mogo.module.main.cards.MogoModulesManager;
|
||||||
import com.mogo.service.intent.IMogoIntentListener;
|
import com.mogo.service.intent.IMogoIntentListener;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对作为Launcher的情况,做个性化操作
|
* 针对作为Launcher的情况,做个性化操作
|
||||||
@@ -82,4 +85,29 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
protected boolean shouldCloseADASPanelWhenPause() {
|
protected boolean shouldCloseADASPanelWhenPause() {
|
||||||
return !mIsHomeKeyDown;
|
return !mIsHomeKeyDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
try {
|
||||||
|
// acc off 之后会出现进程还在,但是页面被杀的情况,这个直接杀掉进程,然后让整个进程重启
|
||||||
|
Process.killProcess( Process.myPid() );
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMapUiModeChanged( EnumMapUI mapUI ) {
|
||||||
|
super.onMapUiModeChanged( mapUI );
|
||||||
|
Intent intent = new Intent( "com.mogo.style.SKIN_CHANGED" );
|
||||||
|
intent.putExtra( "type", -1 );
|
||||||
|
if ( mapUI == EnumMapUI.Type_Light ) {
|
||||||
|
intent.putExtra( "type", 1 );
|
||||||
|
} else if( mapUI == EnumMapUI.Type_Night ){
|
||||||
|
intent.putExtra( "type", 0 );
|
||||||
|
}
|
||||||
|
sendBroadcast( intent );
|
||||||
|
Logger.d( TAG, "send msg to AI Voice" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.mogo.module.apps;
|
package com.mogo.module.apps;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.mogo.module.common.MogoApisHandler;
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
|
||||||
import com.mogo.service.IMogoServiceApis;
|
import com.mogo.service.IMogoServiceApis;
|
||||||
import com.mogo.service.MogoServicePaths;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* author : zyz
|
* author : zyz
|
||||||
@@ -20,7 +18,7 @@ public class AppServiceHandler {
|
|||||||
|
|
||||||
public static IMogoServiceApis getApis() {
|
public static IMogoServiceApis getApis() {
|
||||||
if ( mApis == null ) {
|
if ( mApis == null ) {
|
||||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( AbsMogoApplication.getApp() );
|
mApis = MogoApisHandler.getInstance().getApis();
|
||||||
}
|
}
|
||||||
return mApis;
|
return mApis;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,12 @@ import androidx.lifecycle.LifecycleOwner;
|
|||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.module.apps.applaunch.AppLaunchFilter;
|
import com.mogo.module.apps.applaunch.AppLaunchFilter;
|
||||||
import com.mogo.module.apps.applaunch.AppLauncher;
|
import com.mogo.module.apps.applaunch.AppLauncher;
|
||||||
import com.mogo.module.apps.applaunch.CardAppLauncher;
|
|
||||||
import com.mogo.module.apps.applaunch.GuideShowLauncher;
|
import com.mogo.module.apps.applaunch.GuideShowLauncher;
|
||||||
import com.mogo.module.apps.applaunch.InternalFunctionLauncher;
|
import com.mogo.module.apps.applaunch.InternalFunctionLauncher;
|
||||||
import com.mogo.module.apps.model.AppInfo;
|
import com.mogo.module.apps.model.AppInfo;
|
||||||
import com.mogo.module.apps.model.AppsModel;
|
import com.mogo.module.apps.model.AppsModel;
|
||||||
import com.mogo.module.apps.model.UnScannedApps;
|
import com.mogo.module.apps.model.UnScannedApps;
|
||||||
import com.mogo.service.analytics.IMogoAnalytics;
|
import com.mogo.service.analytics.IMogoAnalytics;
|
||||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
|
||||||
import com.mogo.utils.ThreadPoolService;
|
import com.mogo.utils.ThreadPoolService;
|
||||||
import com.mogo.utils.UiThreadHandler;
|
import com.mogo.utils.UiThreadHandler;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
@@ -38,16 +36,11 @@ public class AppsPresenter extends Presenter< AppsView > {
|
|||||||
private IMogoAnalytics mAnalytics;
|
private IMogoAnalytics mAnalytics;
|
||||||
private AppLaunchFilter mLauncher;
|
private AppLaunchFilter mLauncher;
|
||||||
|
|
||||||
private IMogoCardManager mCardManager;
|
|
||||||
|
|
||||||
public AppsPresenter( AppsView view ) {
|
public AppsPresenter( AppsView view ) {
|
||||||
super( view );
|
super( view );
|
||||||
mCardManager = AppServiceHandler.getApis().getCardManagerApi();
|
|
||||||
InternalFunctionLauncher internalFunctionLauncher = new InternalFunctionLauncher( getContext() );
|
InternalFunctionLauncher internalFunctionLauncher = new InternalFunctionLauncher( getContext() );
|
||||||
CardAppLauncher cardAppLauncher = new CardAppLauncher( this, mCardManager );
|
|
||||||
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ) );
|
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ) );
|
||||||
internalFunctionLauncher.setNext( cardAppLauncher );
|
internalFunctionLauncher.setNext( guideShowLauncher );
|
||||||
cardAppLauncher.setNext( guideShowLauncher );
|
|
||||||
guideShowLauncher.setNext( new AppLauncher() );
|
guideShowLauncher.setNext( new AppLauncher() );
|
||||||
mLauncher = internalFunctionLauncher;
|
mLauncher = internalFunctionLauncher;
|
||||||
}
|
}
|
||||||
@@ -217,7 +210,6 @@ public class AppsPresenter extends Presenter< AppsView > {
|
|||||||
mView = null;
|
mView = null;
|
||||||
mLauncher.destroy();
|
mLauncher.destroy();
|
||||||
mAnalytics = null;
|
mAnalytics = null;
|
||||||
mCardManager = null;
|
|
||||||
if ( mLauncher != null ) {
|
if ( mLauncher != null ) {
|
||||||
mLauncher.destroy();
|
mLauncher.destroy();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.mogo.module.apps.applaunch;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import com.mogo.module.apps.AppsPresenter;
|
|
||||||
import com.mogo.module.apps.model.AppInfo;
|
|
||||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2020-02-09
|
|
||||||
* <p>
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
public class CardAppLauncher extends BaseAppLauncher {
|
|
||||||
|
|
||||||
private static Map< String, String > sCardApps = new HashMap<>();
|
|
||||||
|
|
||||||
static {
|
|
||||||
sCardApps.put( "com.zhidao.roadcondition.split", "CARD_TYPE_ROAD_CONDITION" );
|
|
||||||
sCardApps.put( "com.zhidao.roadcondition", "CARD_TYPE_ROAD_CONDITION" );
|
|
||||||
sCardApps.put( "com.zhidao.imdemo", "CARD_TYPE_CARS_CHATTING" );
|
|
||||||
}
|
|
||||||
|
|
||||||
private AppsPresenter mAppsPresenter;
|
|
||||||
private IMogoCardManager mCardManager;
|
|
||||||
|
|
||||||
public CardAppLauncher( AppsPresenter mAppsPresenter, IMogoCardManager mCardManager ) {
|
|
||||||
this.mAppsPresenter = mAppsPresenter;
|
|
||||||
this.mCardManager = mCardManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void launch( Context context, AppInfo appInfo ) {
|
|
||||||
if ( getNext() != null ) {
|
|
||||||
getNext().launch( context, appInfo );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() {
|
|
||||||
mAppsPresenter = null;
|
|
||||||
mCardManager = null;
|
|
||||||
if ( getNext() != null ) {
|
|
||||||
getNext().destroy();
|
|
||||||
setNext( null );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -156,7 +156,8 @@ public class AppsModel {
|
|||||||
if ( totalPages == 0 ) {
|
if ( totalPages == 0 ) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
if ( mPagedApps.get( totalPages - 1 ).size() == AppsConst.TOTAL_SIZE_EACH_PAGE ) {
|
if ( mPagedApps.get( totalPages - 1 ) == null
|
||||||
|
|| mPagedApps.get( totalPages - 1 ).size() == AppsConst.TOTAL_SIZE_EACH_PAGE ) {
|
||||||
return totalPages;
|
return totalPages;
|
||||||
} else {
|
} else {
|
||||||
return totalPages - 1;
|
return totalPages - 1;
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick( View v ) {
|
public void onClick( View v ) {
|
||||||
if ( Devices.isBind() || !DebugConfig.isActiveAIAssistFlag() ) {
|
if ( Devices.isBind() || !DebugConfig.isActiveAIAssistFlag() ) {
|
||||||
AIAssist.startAssistant( v.getContext() );
|
AIAssist.getInstance( v.getContext() ).startAssistant( v.getContext() );
|
||||||
} else {
|
} else {
|
||||||
if ( mDebugModeOpen ) {
|
if ( mDebugModeOpen ) {
|
||||||
AIAssist.startAssistant( v.getContext(), 1 );
|
AIAssist.getInstance( v.getContext() ).startAssistant( v.getContext(), 1 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( mClickCounter == 0 ) {
|
if ( mClickCounter == 0 ) {
|
||||||
@@ -38,7 +38,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
|||||||
mClickCounter++;
|
mClickCounter++;
|
||||||
} else {
|
} else {
|
||||||
if ( mClickCounter == TOTAL_CLICK_AMOUNT ) {
|
if ( mClickCounter == TOTAL_CLICK_AMOUNT ) {
|
||||||
AIAssist.startAssistant( v.getContext(), 2 );
|
AIAssist.getInstance( v.getContext() ).startAssistant( v.getContext(), 2 );
|
||||||
TipToast.shortTip( "开启语音调试" );
|
TipToast.shortTip( "开启语音调试" );
|
||||||
mClickCounter = 0;
|
mClickCounter = 0;
|
||||||
mLastClickTime = 0L;
|
mLastClickTime = 0L;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener
|
|||||||
import com.mogo.map.navi.IMogoNaviListener
|
import com.mogo.map.navi.IMogoNaviListener
|
||||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
|
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.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||||
|
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize
|
||||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||||
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
|
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
|
||||||
import com.mogo.service.MogoServicePaths
|
import com.mogo.service.MogoServicePaths
|
||||||
@@ -91,4 +92,8 @@ class MogoAuthorizeProvider : IMogoAuthManager {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
mContext = null
|
||||||
|
mogoAuthShow.release()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.mogo.module.authorize.authprovider.launcher
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
|
import com.mogo.commons.context.ContextHolderUtil
|
||||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
||||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||||
@@ -82,7 +83,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (authorizeDialog == null) {
|
if (authorizeDialog == null) {
|
||||||
authorizeDialog = AuthorizeDialog(tag, mContext!!)
|
authorizeDialog = AuthorizeDialog(tag, ContextHolderUtil.getContext() ?: mContext!!)
|
||||||
authorizeDialog!!.setOnDismissListener {
|
authorizeDialog!!.setOnDismissListener {
|
||||||
authorizeDialog = null
|
authorizeDialog = null
|
||||||
}
|
}
|
||||||
@@ -96,4 +97,8 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun release(){
|
||||||
|
mContext = null
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
|||||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||||
import com.mogo.module.authorize.util.SharedPreferenceUtil
|
import com.mogo.module.authorize.util.SharedPreferenceUtil
|
||||||
import com.mogo.module.authorize.util.isDeviceOfD
|
|
||||||
import com.mogo.service.module.IMogoModuleProvider
|
import com.mogo.service.module.IMogoModuleProvider
|
||||||
|
|
||||||
class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeModuleProvider {
|
class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeModuleProvider {
|
||||||
@@ -22,7 +21,7 @@ class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IM
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun invokeAuthorization(tag: String) {
|
override fun invokeAuthorization(tag: String) {
|
||||||
if(isDeviceOfD() && !SharedPreferenceUtil.hasGuide()){
|
if(!SharedPreferenceUtil.hasGuide()){
|
||||||
val guideService = ARouter.getInstance().build("/guide/showFragment").navigation()
|
val guideService = ARouter.getInstance().build("/guide/showFragment").navigation()
|
||||||
if(guideService is IMogoModuleProvider){
|
if(guideService is IMogoModuleProvider){
|
||||||
guideService.init(AbsMogoApplication.getApp().applicationContext)
|
guideService.init(AbsMogoApplication.getApp().applicationContext)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.mogo.module.authorize.layout
|
package com.mogo.module.authorize.layout
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.ColorDrawable
|
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
@@ -207,4 +206,9 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
|||||||
showAuthorizationError()
|
showAuthorizationError()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun dismiss() {
|
||||||
|
super.dismiss()
|
||||||
|
mContext = 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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mogo.module.authorize.util
|
package com.mogo.module.authorize.util
|
||||||
|
|
||||||
import com.mogo.commons.AbsMogoApplication
|
import com.mogo.commons.AbsMogoApplication
|
||||||
import com.mogo.commons.debug.DebugConfig.getSpGuide
|
import com.mogo.module.common.utils.SPConst.getSpGuide
|
||||||
import com.mogo.utils.storage.SharedPrefsMgr
|
import com.mogo.utils.storage.SharedPrefsMgr
|
||||||
|
|
||||||
object SharedPreferenceUtil {
|
object SharedPreferenceUtil {
|
||||||
|
|||||||
@@ -8,15 +8,10 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.mogo.commons.debug.DebugConfig;
|
||||||
import com.mogo.map.listener.IMogoMapListener;
|
import com.mogo.module.common.MogoApisHandler;
|
||||||
import com.mogo.map.location.IMogoLocationListener;
|
|
||||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
|
||||||
import com.mogo.map.navi.IMogoNaviListener;
|
|
||||||
import com.mogo.module.common.utils.CarSeries;
|
import com.mogo.module.common.utils.CarSeries;
|
||||||
import com.mogo.service.IMogoServiceApis;
|
import com.mogo.service.IMogoServiceApis;
|
||||||
import com.mogo.service.MogoServicePaths;
|
|
||||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
|
||||||
import com.mogo.service.module.IMogoModuleProvider;
|
import com.mogo.service.module.IMogoModuleProvider;
|
||||||
import com.mogo.service.module.ModuleType;
|
import com.mogo.service.module.ModuleType;
|
||||||
|
|
||||||
@@ -56,10 +51,21 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init( Context context ) {
|
public void init( Context context ) {
|
||||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
final String product = DebugConfig.getProductFlavor();
|
||||||
BackToMainHomeManager.addMainHomeView();
|
if ( product != null ) {
|
||||||
|
switch ( product ) {
|
||||||
|
case "f80x":
|
||||||
|
case "f8xx":
|
||||||
|
BackToMainHomeManager.addMainHomeView();
|
||||||
|
break;
|
||||||
|
case "changanauto":
|
||||||
|
if ( DebugConfig.isDebug() ) {
|
||||||
|
BackToMainHomeManager.addMainHomeView();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||||
BackToMainHomeManager.init( mServiceApis );
|
BackToMainHomeManager.init( mServiceApis );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class BackToMainHomeManager {
|
|||||||
.size( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT )
|
.size( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT )
|
||||||
.gravity( Gravity.LEFT | Gravity.TOP )
|
.gravity( Gravity.LEFT | Gravity.TOP )
|
||||||
.showInWindowManager();
|
.showInWindowManager();
|
||||||
mWindowManagerView.attachTouchEvent( view -> {
|
mWindowManagerView.attachTouchEvent( (view, xPos, yPos) -> {
|
||||||
backToLauncher();
|
backToLauncher();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.androidxappcompat
|
implementation rootProject.ext.dependencies.androidxappcompat
|
||||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||||
|
implementation rootProject.ext.dependencies.arouter
|
||||||
|
implementation rootProject.ext.dependencies.carcallprovider
|
||||||
if (Boolean.valueOf(RELEASE)) {
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
api rootProject.ext.dependencies.mogomap
|
api rootProject.ext.dependencies.mogomap
|
||||||
api rootProject.ext.dependencies.mogomapapi
|
api rootProject.ext.dependencies.mogomapapi
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.mogo.module.common;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
|
import com.mogo.service.IMogoServiceApis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2020/9/21
|
||||||
|
* <p>
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
public final class MogoApisHandler {
|
||||||
|
|
||||||
|
private IMogoServiceApis sApis;
|
||||||
|
|
||||||
|
private static volatile MogoApisHandler sInstance;
|
||||||
|
|
||||||
|
private MogoApisHandler() {
|
||||||
|
sApis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MogoApisHandler getInstance() {
|
||||||
|
if ( sInstance == null ) {
|
||||||
|
synchronized ( MogoApisHandler.class ) {
|
||||||
|
if ( sInstance == null ) {
|
||||||
|
sInstance = new MogoApisHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void release() {
|
||||||
|
sInstance = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Object readResolve() {
|
||||||
|
// 阻止反序列化,必须实现 Serializable 接口
|
||||||
|
return sInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMogoServiceApis getApis() {
|
||||||
|
if ( sApis == null ) {
|
||||||
|
synchronized ( this ) {
|
||||||
|
if ( sApis != null ) {
|
||||||
|
sApis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sApis;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.module.v2x.utils.animation;
|
package com.mogo.module.common.animation;
|
||||||
|
|
||||||
interface Animation {
|
interface Animation {
|
||||||
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.mogo.module.v2x.utils.animation;
|
package com.mogo.module.common.animation;
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
|
||||||
public class V2XAnimationManager implements Animation {
|
public class AnimationManager implements Animation {
|
||||||
|
|
||||||
private static final String TAG = "V2XAnimationManager";
|
private static final String TAG = "V2XAnimationManager";
|
||||||
private ProgressBar targetImageView;
|
private ProgressBar targetImageView;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mogo.module.v2x.utils.animation;
|
package com.mogo.module.common.animation;
|
||||||
|
|
||||||
|
|
||||||
import com.mogo.module.v2x.R;
|
import com.mogo.module.common.R;
|
||||||
|
|
||||||
public class AnimationResources {
|
public class AnimationResources {
|
||||||
public static final int loadingRes[] = {
|
public static final int loadingRes[] = {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.module.v2x.utils.animation;
|
package com.mogo.module.common.animation;
|
||||||
|
|
||||||
import android.graphics.drawable.AnimationDrawable;
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.mogo.module.common.api;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
|
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
|
||||||
|
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
import com.zhidao.carchattingprovider.MogoDriverInfo;
|
||||||
|
|
||||||
|
public
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2020/9/24
|
||||||
|
*
|
||||||
|
* 车聊聊接口
|
||||||
|
*/
|
||||||
|
class CallChatApi {
|
||||||
|
|
||||||
|
private static final String TAG = "CallChatApi";
|
||||||
|
|
||||||
|
private static volatile CallChatApi sInstance;
|
||||||
|
|
||||||
|
private CallChatApi() {
|
||||||
|
mApiProvider = ARouter.getInstance().navigation( ICarsChattingProvider.class );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CallChatApi getInstance() {
|
||||||
|
if ( sInstance == null ) {
|
||||||
|
synchronized ( CallChatApi.class ) {
|
||||||
|
if ( sInstance == null ) {
|
||||||
|
sInstance = new CallChatApi();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void release() {
|
||||||
|
sInstance = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Object readResolve() {
|
||||||
|
// 阻止反序列化,必须实现 Serializable 接口
|
||||||
|
return sInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICarsChattingProvider getApiProvider() {
|
||||||
|
return mApiProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ICarsChattingProvider mApiProvider;
|
||||||
|
|
||||||
|
public void showUserWindow( Context context, MarkerOnlineCar onlineCar ) throws Exception {
|
||||||
|
if ( mApiProvider == null ) {
|
||||||
|
Logger.e( TAG, "no call chat api instance." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MogoDriverInfo driverInfo = new MogoDriverInfo();
|
||||||
|
driverInfo.setAge( onlineCar.getUserInfo().getAgeNumber() );
|
||||||
|
driverInfo.setCarTypeName( onlineCar.getCarInfo().getCarTypeName() );
|
||||||
|
driverInfo.setGender( onlineCar.getUserInfo().getGender() );
|
||||||
|
driverInfo.setLat( onlineCar.getLocation().getLat() );
|
||||||
|
driverInfo.setLon( onlineCar.getLocation().getLon() );
|
||||||
|
driverInfo.setLocationInfo( onlineCar.getLocation().getAddress() );
|
||||||
|
driverInfo.setSn( onlineCar.getUserInfo().getSn() );
|
||||||
|
driverInfo.setUserHead( onlineCar.getUserInfo().getUserHead() );
|
||||||
|
driverInfo.setUserName( onlineCar.getUserInfo().getUserName() );
|
||||||
|
mApiProvider.showUserWindow( TAG, driverInfo, context );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hideUserWindow( Context context ) {
|
||||||
|
if ( mApiProvider != null ) {
|
||||||
|
if ( mApiProvider == null ) {
|
||||||
|
Logger.e( TAG, "no call chat api instance." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mApiProvider.hideUserWindow( TAG, context, null );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,6 +33,19 @@ public class V2XMessageEntity<T> implements Serializable {
|
|||||||
*/
|
*/
|
||||||
boolean showState;
|
boolean showState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要判断重复事件
|
||||||
|
* true-判断,false-不判断
|
||||||
|
* 默认需要判断
|
||||||
|
*/
|
||||||
|
boolean isNeedCompareSameScenario = true;
|
||||||
|
|
||||||
|
//是否播报tts
|
||||||
|
private boolean onlyShow = false;
|
||||||
|
|
||||||
|
//本机与事件是否连线
|
||||||
|
private boolean needAddLine = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 场景具体的数据内容
|
* 场景具体的数据内容
|
||||||
*/
|
*/
|
||||||
@@ -54,6 +67,14 @@ public class V2XMessageEntity<T> implements Serializable {
|
|||||||
this.showState = showState;
|
this.showState = showState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isNeedCompareSameScenario() {
|
||||||
|
return isNeedCompareSameScenario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNeedCompareSameScenario(boolean needCompareSameScenario) {
|
||||||
|
isNeedCompareSameScenario = needCompareSameScenario;
|
||||||
|
}
|
||||||
|
|
||||||
public T getContent() {
|
public T getContent() {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
@@ -76,6 +97,22 @@ public class V2XMessageEntity<T> implements Serializable {
|
|||||||
return Objects.hash(type, content);
|
return Objects.hash(type, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOnlyShow() {
|
||||||
|
return onlyShow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlyShow(boolean onlyShow) {
|
||||||
|
this.onlyShow = onlyShow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNeedAddLine() {
|
||||||
|
return needAddLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNeedAddLine(boolean needAddLine) {
|
||||||
|
this.needAddLine = needAddLine;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* V2X 场景类型
|
* V2X 场景类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class V2XRoadEventEntity implements Serializable {
|
|||||||
private MarkerExploreWay noveltyInfo;
|
private MarkerExploreWay noveltyInfo;
|
||||||
// tts 提示
|
// tts 提示
|
||||||
private String tts;
|
private String tts;
|
||||||
|
|
||||||
// ADAS 展示文案
|
// ADAS 展示文案
|
||||||
private String alarmContent;
|
private String alarmContent;
|
||||||
// 距离当前车辆的距离
|
// 距离当前车辆的距离
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mogo.module.common.map;
|
package com.mogo.module.common.map;
|
||||||
|
|
||||||
|
import com.mogo.commons.debug.DebugConfig;
|
||||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||||
import com.mogo.module.common.utils.CarSeries;
|
|
||||||
import com.mogo.utils.UiThreadHandler;
|
import com.mogo.utils.UiThreadHandler;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
@@ -18,112 +18,102 @@ public class MapCenterPointStrategy {
|
|||||||
|
|
||||||
private static final String TAG = "MapCenterPointStrategy";
|
private static final String TAG = "MapCenterPointStrategy";
|
||||||
|
|
||||||
private static Map< Integer, Map< Integer, MapCenterPoint > > sStrategies = new HashMap<>();
|
private static Map< Integer, Map< String, MapCenterPoint > > sStrategies = new HashMap<>();
|
||||||
|
|
||||||
public static final MapCenterPoint DEFAULT = new MapCenterPoint( 0.677734D, 0.5733333D );
|
public static final MapCenterPoint DEFAULT = new MapCenterPoint( 0.677734D, 0.5733333D );
|
||||||
|
|
||||||
private static MapCenterPoint sLastPoint = DEFAULT;
|
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
|
||||||
{
|
{
|
||||||
// 选点场景,定位中心点
|
// 选点场景,定位中心点
|
||||||
Map< Integer, MapCenterPoint > choosePoint = new HashMap<>();
|
Map< String, MapCenterPoint > choosePoint = new HashMap<>();
|
||||||
choosePoint.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
choosePoint.put( "d80x", new MapCenterPoint( 0.5D, 0.5D ) );
|
||||||
choosePoint.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.5D, 0.5D ) );
|
choosePoint.put( "em4", new MapCenterPoint( 0.5D, 0.5D ) );
|
||||||
choosePoint.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.5D, 0.5D ) );
|
choosePoint.put( "e8xx", new MapCenterPoint( 0.5D, 0.5D ) );
|
||||||
choosePoint.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
choosePoint.put( "f80x", new MapCenterPoint( 0.5D, 0.5D ) );
|
||||||
|
choosePoint.put( "f8xx", new MapCenterPoint( 0.5D, 0.5D ) );
|
||||||
sStrategies.put( Scene.CHOOSE_POINT, choosePoint );
|
sStrategies.put( Scene.CHOOSE_POINT, choosePoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 导航场景,定位视图右下角偏下
|
// 导航场景,定位视图右下角偏下
|
||||||
Map< Integer, MapCenterPoint > navi = new HashMap<>();
|
Map< String, MapCenterPoint > navi = new HashMap<>();
|
||||||
navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.573333333333D ) );
|
navi.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.573333333333D ) );
|
||||||
navi.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
navi.put( "em4", new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
||||||
navi.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
navi.put( "e8xx", new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
||||||
navi.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.575D ) );
|
navi.put( "f80x", new MapCenterPoint( 0.705208333D, 0.575D ) );
|
||||||
|
navi.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.575D ) );
|
||||||
sStrategies.put( Scene.NAVI, navi );
|
sStrategies.put( Scene.NAVI, navi );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 导航场景 vs 道路事件展示场景,定位视图右下角偏下
|
// 导航场景 vs 道路事件展示场景,定位视图右下角偏下
|
||||||
Map< Integer, MapCenterPoint > naviWithRoadEvent = new HashMap<>();
|
Map< String, MapCenterPoint > naviWithRoadEvent = new HashMap<>();
|
||||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.73936170212766D ) );
|
naviWithRoadEvent.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.73936170212766D ) );
|
||||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.73936170212766D ) );
|
naviWithRoadEvent.put( "em4", new MapCenterPoint( 0.734375D, 0.73936170212766D ) );
|
||||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.73936170212766D ) );
|
naviWithRoadEvent.put( "e8xx", new MapCenterPoint( 0.734375D, 0.73936170212766D ) );
|
||||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
|
naviWithRoadEvent.put( "f80x", new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
|
||||||
|
naviWithRoadEvent.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
|
||||||
sStrategies.put( Scene.NAVI_WITH_ROAD_EVENT, naviWithRoadEvent );
|
sStrategies.put( Scene.NAVI_WITH_ROAD_EVENT, naviWithRoadEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 巡航场景
|
// 巡航场景
|
||||||
Map< Integer, MapCenterPoint > aimless = new HashMap<>();
|
Map< String, MapCenterPoint > aimless = new HashMap<>();
|
||||||
aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.5D ) );
|
aimless.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.5D ) );
|
||||||
aimless.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.5D ) );
|
aimless.put( "em4", new MapCenterPoint( 0.734375D, 0.5D ) );
|
||||||
aimless.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.5D ) );
|
aimless.put( "e8xx", new MapCenterPoint( 0.734375D, 0.5D ) );
|
||||||
aimless.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.5D ) );
|
aimless.put( "f80x", new MapCenterPoint( 0.705208333D, 0.5D ) );
|
||||||
|
aimless.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.5D ) );
|
||||||
sStrategies.put( Scene.AIMLESS, aimless );
|
sStrategies.put( Scene.AIMLESS, aimless );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 巡航场景 vs 道路事件展示场景
|
// 巡航场景 vs 道路事件展示场景
|
||||||
Map< Integer, MapCenterPoint > aimlessWithRoadEvent = new HashMap<>();
|
Map< String, MapCenterPoint > aimlessWithRoadEvent = new HashMap<>();
|
||||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.68617 ) );
|
aimlessWithRoadEvent.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.68617 ) );
|
||||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.68617 ) );
|
aimlessWithRoadEvent.put( "em4", new MapCenterPoint( 0.734375D, 0.68617 ) );
|
||||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.68617 ) );
|
aimlessWithRoadEvent.put( "e8xx", new MapCenterPoint( 0.734375D, 0.68617 ) );
|
||||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.599074074D ) );
|
aimlessWithRoadEvent.put( "f80x", new MapCenterPoint( 0.705208333D, 0.599074074D ) );
|
||||||
|
aimlessWithRoadEvent.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.599074074D ) );
|
||||||
sStrategies.put( Scene.AIMLESS_WITH_ROAD_EVENT, aimlessWithRoadEvent );
|
sStrategies.put( Scene.AIMLESS_WITH_ROAD_EVENT, aimlessWithRoadEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 规划路线,定位视图右边
|
// 规划路线,定位视图右边
|
||||||
Map< Integer, MapCenterPoint > calculatePath = new HashMap<>();
|
Map< String, MapCenterPoint > calculatePath = new HashMap<>();
|
||||||
calculatePath.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
calculatePath.put( "d80x", new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||||
calculatePath.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
calculatePath.put( "em4", new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||||
calculatePath.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
calculatePath.put( "e8xx", new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||||
calculatePath.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.703125D, 0.6083333D ) );
|
calculatePath.put( "f80x", new MapCenterPoint( 0.703125D, 0.6083333D ) );
|
||||||
|
calculatePath.put( "f8xx", new MapCenterPoint( 0.703125D, 0.6083333D ) );
|
||||||
sStrategies.put( Scene.CALCULATE_PATH, calculatePath );
|
sStrategies.put( Scene.CALCULATE_PATH, calculatePath );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 分类搜索,定位视图右边
|
// 分类搜索,定位视图右边
|
||||||
Map< Integer, MapCenterPoint > categorySearch = new HashMap<>();
|
Map< String, MapCenterPoint > categorySearch = new HashMap<>();
|
||||||
categorySearch.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.5D ) );
|
categorySearch.put( "d80x", new MapCenterPoint( 0.733398D, 0.5D ) );
|
||||||
categorySearch.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.733398D, 0.5D ) );
|
categorySearch.put( "em4", new MapCenterPoint( 0.733398D, 0.5D ) );
|
||||||
categorySearch.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.733398D, 0.5D ) );
|
categorySearch.put( "e8xx", new MapCenterPoint( 0.733398D, 0.5D ) );
|
||||||
categorySearch.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.733594D, 0.5D ) );
|
categorySearch.put( "f80x", new MapCenterPoint( 0.733594D, 0.5D ) );
|
||||||
|
categorySearch.put( "f8xx", new MapCenterPoint( 0.733594D, 0.5D ) );
|
||||||
sStrategies.put( Scene.CATEGORY_SEARCH, categorySearch );
|
sStrategies.put( Scene.CATEGORY_SEARCH, categorySearch );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// V2X,场景视图右边
|
// V2X,场景视图右边
|
||||||
Map< Integer, MapCenterPoint > categoryV2XEvent = new HashMap<>();
|
Map< String, MapCenterPoint > categoryV2XEvent = new HashMap<>();
|
||||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.7D ) );
|
categoryV2XEvent.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.7D ) );
|
||||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
categoryV2XEvent.put( "em4", new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
categoryV2XEvent.put( "e8xx", new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.65D ) );
|
categoryV2XEvent.put( "f80x", new MapCenterPoint( 0.6963541D, 0.65D ) );
|
||||||
|
categoryV2XEvent.put( "f8xx", new MapCenterPoint( 0.6963541D, 0.65D ) );
|
||||||
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
|
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
sLastPoint = sStrategies.get( Scene.AIMLESS ).get( CarSeries.getSeries() );
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
sLastPoint = DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void restoreLastScene( IMogoMapUIController controller ) {
|
public static void addScene( int scene, Map< String, MapCenterPoint > config ) {
|
||||||
if ( sLastPoint == null ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( controller == null ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
controller.setPointToCenter( sLastPoint.x, sLastPoint.y );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addScene( int scene, Map< Integer, MapCenterPoint > config ) {
|
|
||||||
if ( sStrategies.containsKey( scene ) ) {
|
if ( sStrategies.containsKey( scene ) ) {
|
||||||
Logger.w( TAG, "scene has already defined, append config..." );
|
Logger.w( TAG, "scene has already defined, append config..." );
|
||||||
}
|
}
|
||||||
@@ -147,25 +137,21 @@ public class MapCenterPointStrategy {
|
|||||||
if ( !sStrategies.containsKey( scene ) ) {
|
if ( !sStrategies.containsKey( scene ) ) {
|
||||||
Logger.w( TAG, "no strategy for scene: %s, use DEFAULT", scene );
|
Logger.w( TAG, "no strategy for scene: %s, use DEFAULT", scene );
|
||||||
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
|
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
|
||||||
sLastPoint = DEFAULT;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map< Integer, MapCenterPoint > points = sStrategies.get( scene );
|
Map< String, MapCenterPoint > points = sStrategies.get( scene );
|
||||||
int car = CarSeries.getSeries();
|
String car = DebugConfig.getProductFlavor();
|
||||||
if ( !points.containsKey( car ) ) {
|
if ( !points.containsKey( car ) ) {
|
||||||
Logger.w( TAG, "no strategy for series: %s, use DEFAULT", scene );
|
Logger.w( TAG, "no strategy for series: %s, use DEFAULT", scene );
|
||||||
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
|
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
|
||||||
sLastPoint = DEFAULT;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MapCenterPoint point = points.get( car );
|
MapCenterPoint point = points.get( car );
|
||||||
if ( point == null ) {
|
if ( point == null ) {
|
||||||
Logger.w( TAG, "no strategy config for series: %s, use DEFAULT", scene );
|
Logger.w( TAG, "no strategy config for series: %s, use DEFAULT", scene );
|
||||||
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
|
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
|
||||||
sLastPoint = DEFAULT;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sLastPoint = point;
|
|
||||||
controller.setPointToCenter( point.x, point.y );
|
controller.setPointToCenter( point.x, point.y );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.mogo.module.common.utils;
|
||||||
|
|
||||||
|
public class Const {
|
||||||
|
/**
|
||||||
|
* V2X 场景广播 Action
|
||||||
|
*/
|
||||||
|
public static final String BROADCAST_SCENE_HANDLER_ACTION = "com.v2x.scene_handler_broadcast";
|
||||||
|
public static final String BROADCAST_SCENE_EXTRA_KEY = "V2XMessageEntity";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.mogo.module.common.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多模块之间SP状态公共类
|
||||||
|
*/
|
||||||
|
public class SPConst {
|
||||||
|
|
||||||
|
private static String SP_GUIDE = "SP_GUIDE_2020_09_09";
|
||||||
|
|
||||||
|
//用于多模块之间引导状态判断
|
||||||
|
public static String getSpGuide() {
|
||||||
|
return SP_GUIDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String SP_GUIDE_FIRST_TIME_RECORD = "SP_GUIDE_FIRST_TIME_RECORD";
|
||||||
|
|
||||||
|
//用于多模块之间首次引导时间记录
|
||||||
|
public static String getSPGuideRecord(){
|
||||||
|
return SP_GUIDE_FIRST_TIME_RECORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,298 @@
|
|||||||
|
package com.mogo.module.common.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.mogo.module.common.R;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class CustomRatingBar extends LinearLayout {
|
||||||
|
private Context mContext;
|
||||||
|
/*
|
||||||
|
是否可点击
|
||||||
|
* */
|
||||||
|
private boolean mClickable;
|
||||||
|
/*
|
||||||
|
* 单元总数(心形/星星)
|
||||||
|
* */
|
||||||
|
private int elementCount;
|
||||||
|
/*
|
||||||
|
* 单元点击事件
|
||||||
|
* */
|
||||||
|
private OnRatingChangeListener mOnRatingBarChangeListener;
|
||||||
|
/*
|
||||||
|
* 每个单元的大小
|
||||||
|
* */
|
||||||
|
private float elementWidth;
|
||||||
|
|
||||||
|
private float elementHeight;
|
||||||
|
|
||||||
|
public float getElementWidth() {
|
||||||
|
return elementWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementWidth(float elementWidth) {
|
||||||
|
this.elementWidth = elementWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getElementHeight() {
|
||||||
|
return elementHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementHeight(float elementHeight) {
|
||||||
|
this.elementHeight = elementHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 每个单元间的距离
|
||||||
|
* */
|
||||||
|
private float elementPadding;
|
||||||
|
/*
|
||||||
|
*单元的显示数量,支持小数点
|
||||||
|
* */
|
||||||
|
private float elementStep;
|
||||||
|
/*
|
||||||
|
* 空白的默认单元图片
|
||||||
|
* */
|
||||||
|
private Drawable elementEmptyDrawable;
|
||||||
|
/*
|
||||||
|
* 选中后的单元图片
|
||||||
|
* */
|
||||||
|
private Drawable elementFillDrawable;
|
||||||
|
/*
|
||||||
|
* 半颗单元图片
|
||||||
|
* */
|
||||||
|
private Drawable elementHarfDrawable;
|
||||||
|
/*
|
||||||
|
* 每次点击单元所增加的量是半个还是整个
|
||||||
|
* */
|
||||||
|
private StepSize stepSize;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isClickable() {
|
||||||
|
return mClickable;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setClickable(boolean clickable) {
|
||||||
|
mClickable = clickable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getElementCount() {
|
||||||
|
return elementCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementCount(int elementCount) {
|
||||||
|
this.elementCount = elementCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OnRatingChangeListener getOnRatingBarChangeListener() {
|
||||||
|
return mOnRatingBarChangeListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnRatingChangeListener(OnRatingChangeListener onRatingBarChangeListener) {
|
||||||
|
mOnRatingBarChangeListener = onRatingBarChangeListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getElementPadding() {
|
||||||
|
return elementPadding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementPadding(float elementPadding) {
|
||||||
|
this.elementPadding = elementPadding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getElementStep() {
|
||||||
|
return elementStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementStep(float elementStep) {
|
||||||
|
this.elementStep = elementStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Drawable getElementEmptyDrawable() {
|
||||||
|
return elementEmptyDrawable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementEmptyDrawable(Drawable elementEmptyDrawable) {
|
||||||
|
this.elementEmptyDrawable = elementEmptyDrawable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Drawable getElementFillDrawable() {
|
||||||
|
return elementFillDrawable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementFillDrawable(Drawable elementFillDrawable) {
|
||||||
|
this.elementFillDrawable = elementFillDrawable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Drawable getElementHarfDrawable() {
|
||||||
|
return elementHarfDrawable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElementHarfDrawable(Drawable elementHarfDrawable) {
|
||||||
|
this.elementHarfDrawable = elementHarfDrawable;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setStepSize(StepSize stepSize) {
|
||||||
|
this.stepSize = stepSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomRatingBar(Context context, @Nullable AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
mContext = context;
|
||||||
|
setOrientation(LinearLayout.HORIZONTAL);
|
||||||
|
TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.CustomRatingBar);
|
||||||
|
elementWidth = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentWidth,
|
||||||
|
context.getResources().getDimension(R.dimen.heart_ratingbar_width));
|
||||||
|
elementHeight = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentHeight,
|
||||||
|
context.getResources().getDimension(R.dimen.heart_ratingbar_height));
|
||||||
|
elementPadding = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentPadding, 10);
|
||||||
|
|
||||||
|
elementStep = mTypedArray.getFloat(R.styleable.CustomRatingBar_elenmentStep, 1.0f);
|
||||||
|
stepSize = StepSize.fromStep(mTypedArray.getInt(R.styleable.CustomRatingBar_stepSize, 1));
|
||||||
|
elementCount = mTypedArray.getInteger(R.styleable.CustomRatingBar_elenmentCount, 5);
|
||||||
|
stepSize = StepSize.Half;
|
||||||
|
|
||||||
|
Drawable drawable_empty_default = ContextCompat.getDrawable(context, R.drawable.icon_heart_unchoose);
|
||||||
|
Drawable drawable_harf_default = ContextCompat.getDrawable(context, R.drawable.icon_heart_second);
|
||||||
|
Drawable drawable_fill_default = ContextCompat.getDrawable(context, R.drawable.icon_heart_choose);
|
||||||
|
|
||||||
|
Drawable drawable_empty = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentEmpty);
|
||||||
|
Drawable drawable_harf = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentHarf);
|
||||||
|
Drawable drawable_fill = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentFill);
|
||||||
|
|
||||||
|
elementEmptyDrawable = drawable_empty != null ? drawable_empty : drawable_empty_default;
|
||||||
|
elementFillDrawable = drawable_harf != null ? drawable_harf : drawable_fill_default;
|
||||||
|
elementHarfDrawable = drawable_fill != null ? drawable_fill : drawable_harf_default;
|
||||||
|
mClickable = mTypedArray.getBoolean(R.styleable.CustomRatingBar_clickable, false);
|
||||||
|
mTypedArray.recycle();
|
||||||
|
for (int i = 0; i < elementCount; ++i) {
|
||||||
|
final ImageView imageView = getElenmentImageView();
|
||||||
|
imageView.setImageDrawable(elementEmptyDrawable);
|
||||||
|
imageView.setOnClickListener(
|
||||||
|
new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (mClickable) {
|
||||||
|
//浮点数的整数部分
|
||||||
|
int fint = (int) elementStep;
|
||||||
|
BigDecimal b1 = new BigDecimal(Float.toString(elementStep));
|
||||||
|
BigDecimal b2 = new BigDecimal(Integer.toString(fint));
|
||||||
|
//浮点数的小数部分
|
||||||
|
float fPoint = b1.subtract(b2).floatValue();
|
||||||
|
if (fPoint == 0) {
|
||||||
|
fint -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (indexOfChild(v) > fint) {
|
||||||
|
setRating(indexOfChild(v) + 1);
|
||||||
|
} else if (indexOfChild(v) == fint) {
|
||||||
|
if (stepSize == StepSize.Full) {//如果是满星 就不考虑半颗星了
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//点击之后默认每次先增加一颗星,再次点击变为半颗星
|
||||||
|
if (imageView.getDrawable().getCurrent().getConstantState().
|
||||||
|
equals(elementHarfDrawable.getConstantState())) {
|
||||||
|
setRating(indexOfChild(v) + 1);
|
||||||
|
} else {
|
||||||
|
setRating(indexOfChild(v) + 0.5f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setRating(indexOfChild(v) + 1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
addView(imageView);
|
||||||
|
}
|
||||||
|
setRating(elementStep);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ImageView getElenmentImageView() {
|
||||||
|
ImageView imageView = new ImageView(getContext());
|
||||||
|
LayoutParams layout = new LayoutParams(
|
||||||
|
Math.round(mContext.getResources().getDimension(R.dimen.heart_ratingbar_width)),
|
||||||
|
Math.round(mContext.getResources().getDimension(R.dimen.heart_ratingbar_width)));//设置每个单元格在线性布局的大小
|
||||||
|
layout.setMargins(0, 0, Math.round(elementPadding), 0);//设置每颗星星在线性布局的间距
|
||||||
|
imageView.setLayoutParams(layout);
|
||||||
|
imageView.setAdjustViewBounds(true);
|
||||||
|
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||||
|
imageView.setImageDrawable(elementEmptyDrawable);
|
||||||
|
imageView.setMinimumWidth((int) elementWidth);
|
||||||
|
imageView.setMaxWidth((int) elementWidth);
|
||||||
|
imageView.setMinimumHeight((int) elementHeight);
|
||||||
|
imageView.setMaxHeight((int) elementHeight);
|
||||||
|
return imageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRating(float rating) {
|
||||||
|
if (rating > elementCount)
|
||||||
|
rating = elementCount;
|
||||||
|
|
||||||
|
if (mOnRatingBarChangeListener != null) {
|
||||||
|
mOnRatingBarChangeListener.onRatingChange(rating);
|
||||||
|
}
|
||||||
|
this.elementStep = rating;
|
||||||
|
//浮点数的整数部分
|
||||||
|
int fint = (int) rating;
|
||||||
|
BigDecimal b1 = new BigDecimal(Float.toString(rating));
|
||||||
|
BigDecimal b2 = new BigDecimal(Integer.toString(fint));
|
||||||
|
//浮点数的小数部分
|
||||||
|
float fPoint = b1.subtract(b2).floatValue();
|
||||||
|
|
||||||
|
//设置选中的单元
|
||||||
|
for (int i = 0; i < fint; ++i) {
|
||||||
|
((ImageView) getChildAt(i)).setImageDrawable(elementFillDrawable);
|
||||||
|
}
|
||||||
|
//设置没有选中的单元
|
||||||
|
for (int i = fint; i < elementCount; i++) {
|
||||||
|
((ImageView) getChildAt(i)).setImageDrawable(elementEmptyDrawable);
|
||||||
|
}
|
||||||
|
//小数点默认增加半个
|
||||||
|
if (fPoint > 0) {
|
||||||
|
((ImageView) getChildAt(fint)).setImageDrawable(elementHarfDrawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnRatingChangeListener {
|
||||||
|
void onRatingChange(float ratingCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每次增加的方式整颗还是半颗,枚举类型
|
||||||
|
* 类似于View.GONE
|
||||||
|
*/
|
||||||
|
public enum StepSize {
|
||||||
|
Half(0), Full(1);
|
||||||
|
int step;
|
||||||
|
|
||||||
|
StepSize(int step) {
|
||||||
|
this.step = step;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StepSize fromStep(int step) {
|
||||||
|
for (StepSize f : values()) {
|
||||||
|
if (f.step == step) {
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,37 +1,36 @@
|
|||||||
package com.mogo.module.v2x.view;
|
package com.mogo.module.common.view;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.mogo.module.v2x.R;
|
import com.mogo.module.common.R;
|
||||||
import com.mogo.module.v2x.utils.animation.AnimationResources;
|
import com.mogo.module.common.animation.AnimationResources;
|
||||||
import com.mogo.module.v2x.utils.animation.V2XAnimationManager;
|
import com.mogo.module.common.animation.AnimationManager;
|
||||||
|
|
||||||
public class V2XNetworkLoadingView extends RelativeLayout {
|
public class NetworkLoadingView extends RelativeLayout {
|
||||||
|
|
||||||
private ProgressBar loadView;
|
private ProgressBar loadView;
|
||||||
private TextView textView;
|
private TextView textView;
|
||||||
private V2XAnimationManager v2XAnimationManager;
|
private AnimationManager mAnimationManager;
|
||||||
public Button refresButton;
|
public Button refresButton;
|
||||||
private String loadingText = "正在获取信息…";
|
private String loadingText = "正在获取信息…";
|
||||||
|
|
||||||
public V2XNetworkLoadingView(Context context) {
|
public NetworkLoadingView(Context context) {
|
||||||
|
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public V2XNetworkLoadingView(Context context, @Nullable AttributeSet attrs) {
|
public NetworkLoadingView(Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
LayoutInflater.from(context).inflate(R.layout.v2x_network_loading_item, this);
|
LayoutInflater.from(context).inflate(R.layout.network_loading_item, this);
|
||||||
initView();
|
initView();
|
||||||
/*
|
/*
|
||||||
添加动画图片资源
|
添加动画图片资源
|
||||||
@@ -39,12 +38,12 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
|||||||
setLoadingImage(AnimationResources.loadingRes);
|
setLoadingImage(AnimationResources.loadingRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public V2XNetworkLoadingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
public NetworkLoadingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initView() {
|
public void initView() {
|
||||||
v2XAnimationManager = new V2XAnimationManager();
|
mAnimationManager = new AnimationManager();
|
||||||
loadView = findViewById(R.id.loading_imageview);
|
loadView = findViewById(R.id.loading_imageview);
|
||||||
textView = findViewById(R.id.loading_text);
|
textView = findViewById(R.id.loading_text);
|
||||||
refresButton = findViewById(R.id.refresh_button);
|
refresButton = findViewById(R.id.refresh_button);
|
||||||
@@ -57,12 +56,12 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setLoadingImage(int[] resources) {
|
public void setLoadingImage(int[] resources) {
|
||||||
v2XAnimationManager.animationWithTarget(loadView, resources, 100);
|
mAnimationManager.animationWithTarget(loadView, resources, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
if (v2XAnimationManager != null) {
|
if (mAnimationManager != null) {
|
||||||
v2XAnimationManager.start();
|
mAnimationManager.start();
|
||||||
this.setVisibility(View.VISIBLE);
|
this.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (refresButton != null) {
|
if (refresButton != null) {
|
||||||
@@ -74,15 +73,15 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if (v2XAnimationManager != null) {
|
if (mAnimationManager != null) {
|
||||||
v2XAnimationManager.stop();
|
mAnimationManager.stop();
|
||||||
this.setVisibility(GONE);
|
this.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopWithError(String errormsg, int showRefreshButton) {
|
public void stopWithError(String errormsg, int showRefreshButton) {
|
||||||
if (v2XAnimationManager != null) {
|
if (mAnimationManager != null) {
|
||||||
v2XAnimationManager.soptWithError();
|
mAnimationManager.soptWithError();
|
||||||
}
|
}
|
||||||
if (textView != null) {
|
if (textView != null) {
|
||||||
textView.setText(errormsg);
|
textView.setText(errormsg);
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.mogo.module.common.view;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
public
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2020/9/25
|
||||||
|
*
|
||||||
|
* 防止短时间内多次点击
|
||||||
|
*/
|
||||||
|
abstract class OnPreventFastClickListener implements View.OnClickListener {
|
||||||
|
|
||||||
|
public static final long INTERVAL = 1_000L;
|
||||||
|
|
||||||
|
private long mInterval;
|
||||||
|
private long mLastClickTime = 0L;
|
||||||
|
|
||||||
|
public OnPreventFastClickListener() {
|
||||||
|
this( INTERVAL );
|
||||||
|
}
|
||||||
|
|
||||||
|
public OnPreventFastClickListener( long interval ) {
|
||||||
|
if ( interval < 0L ) {
|
||||||
|
interval = INTERVAL;
|
||||||
|
}
|
||||||
|
this.mInterval = interval;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void onClick( View v ) {
|
||||||
|
if ( System.currentTimeMillis() - mLastClickTime > mInterval ) {
|
||||||
|
onClickImpl( v );
|
||||||
|
mLastClickTime = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onClickImpl( View v );
|
||||||
|
}
|
||||||
@@ -0,0 +1,337 @@
|
|||||||
|
package com.mogo.module.common.widget;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapShader;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.ColorFilter;
|
||||||
|
import android.graphics.Matrix;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.Shader;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import androidx.annotation.ColorInt;
|
||||||
|
import androidx.annotation.ColorRes;
|
||||||
|
import androidx.annotation.DrawableRes;
|
||||||
|
|
||||||
|
import com.mogo.module.common.R;
|
||||||
|
|
||||||
|
@SuppressLint("AppCompatCustomView")
|
||||||
|
public class CustomCircleImageView extends ImageView {
|
||||||
|
|
||||||
|
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
|
||||||
|
|
||||||
|
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
|
||||||
|
private static final int COLORDRAWABLE_DIMENSION = 2;
|
||||||
|
|
||||||
|
private static final int DEFAULT_BORDER_WIDTH = 0;
|
||||||
|
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
|
||||||
|
private static final int DEFAULT_FILL_COLOR = Color.TRANSPARENT;
|
||||||
|
private static final boolean DEFAULT_BORDER_OVERLAY = false;
|
||||||
|
|
||||||
|
private final RectF mDrawableRect = new RectF();
|
||||||
|
private final RectF mBorderRect = new RectF();
|
||||||
|
|
||||||
|
private final Matrix mShaderMatrix = new Matrix();
|
||||||
|
private final Paint mBitmapPaint = new Paint();
|
||||||
|
private final Paint mBorderPaint = new Paint();
|
||||||
|
private final Paint mFillPaint = new Paint();
|
||||||
|
|
||||||
|
private int mBorderColor = DEFAULT_BORDER_COLOR;
|
||||||
|
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
|
||||||
|
private int mFillColor = DEFAULT_FILL_COLOR;
|
||||||
|
|
||||||
|
private Bitmap mBitmap;
|
||||||
|
private BitmapShader mBitmapShader;
|
||||||
|
private int mBitmapWidth;
|
||||||
|
private int mBitmapHeight;
|
||||||
|
|
||||||
|
private float mDrawableRadius;
|
||||||
|
private float mBorderRadius;
|
||||||
|
|
||||||
|
private ColorFilter mColorFilter;
|
||||||
|
|
||||||
|
private boolean mReady;
|
||||||
|
private boolean mSetupPending;
|
||||||
|
private boolean mBorderOverlay;
|
||||||
|
|
||||||
|
public CustomCircleImageView( Context context) {
|
||||||
|
super(context);
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomCircleImageView( Context context, AttributeSet attrs) {
|
||||||
|
this(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomCircleImageView( Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
|
||||||
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CustomCircleImageView, defStyle, 0);
|
||||||
|
|
||||||
|
mBorderWidth = a.getDimensionPixelSize(R.styleable.CustomCircleImageView_civ_border_width, DEFAULT_BORDER_WIDTH);
|
||||||
|
mBorderColor = a.getColor(R.styleable.CustomCircleImageView_civ_border_color, DEFAULT_BORDER_COLOR);
|
||||||
|
mBorderOverlay = a.getBoolean(R.styleable.CustomCircleImageView_civ_border_overlay, DEFAULT_BORDER_OVERLAY);
|
||||||
|
mFillColor = a.getColor(R.styleable.CustomCircleImageView_civ_fill_color, DEFAULT_FILL_COLOR);
|
||||||
|
|
||||||
|
a.recycle();
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
super.setScaleType(SCALE_TYPE);
|
||||||
|
mReady = true;
|
||||||
|
|
||||||
|
if (mSetupPending) {
|
||||||
|
setup();
|
||||||
|
mSetupPending = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ScaleType getScaleType() {
|
||||||
|
return SCALE_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setScaleType(ScaleType scaleType) {
|
||||||
|
if (scaleType != SCALE_TYPE) {
|
||||||
|
throw new IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAdjustViewBounds(boolean adjustViewBounds) {
|
||||||
|
if (adjustViewBounds) {
|
||||||
|
throw new IllegalArgumentException("adjustViewBounds not supported.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
if (mBitmap == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mFillColor != Color.TRANSPARENT) {
|
||||||
|
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mFillPaint);
|
||||||
|
}
|
||||||
|
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mBitmapPaint);
|
||||||
|
if (mBorderWidth != 0) {
|
||||||
|
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mBorderRadius, mBorderPaint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||||
|
super.onSizeChanged(w, h, oldw, oldh);
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBorderColor() {
|
||||||
|
return mBorderColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBorderColor(@ColorInt int borderColor) {
|
||||||
|
if (borderColor == mBorderColor) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mBorderColor = borderColor;
|
||||||
|
mBorderPaint.setColor(mBorderColor);
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBorderColorResource(@ColorRes int borderColorRes) {
|
||||||
|
setBorderColor(getContext().getResources().getColor(borderColorRes));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFillColor() {
|
||||||
|
return mFillColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFillColor(@ColorInt int fillColor) {
|
||||||
|
if (fillColor == mFillColor) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mFillColor = fillColor;
|
||||||
|
mFillPaint.setColor(fillColor);
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFillColorResource(@ColorRes int fillColorRes) {
|
||||||
|
setFillColor(getContext().getResources().getColor(fillColorRes));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBorderWidth() {
|
||||||
|
return mBorderWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBorderWidth(int borderWidth) {
|
||||||
|
if (borderWidth == mBorderWidth) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mBorderWidth = borderWidth;
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBorderOverlay() {
|
||||||
|
return mBorderOverlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBorderOverlay(boolean borderOverlay) {
|
||||||
|
if (borderOverlay == mBorderOverlay) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mBorderOverlay = borderOverlay;
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setImageBitmap(Bitmap bm) {
|
||||||
|
super.setImageBitmap(bm);
|
||||||
|
mBitmap = bm;
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setImageDrawable(Drawable drawable) {
|
||||||
|
super.setImageDrawable(drawable);
|
||||||
|
mBitmap = getBitmapFromDrawable(drawable);
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setImageResource(@DrawableRes int resId) {
|
||||||
|
super.setImageResource(resId);
|
||||||
|
mBitmap = getBitmapFromDrawable(getDrawable());
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setImageURI(Uri uri) {
|
||||||
|
super.setImageURI(uri);
|
||||||
|
mBitmap = uri != null ? getBitmapFromDrawable(getDrawable()) : null;
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setColorFilter(ColorFilter cf) {
|
||||||
|
if (cf == mColorFilter) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mColorFilter = cf;
|
||||||
|
mBitmapPaint.setColorFilter(mColorFilter);
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Bitmap getBitmapFromDrawable(Drawable drawable) {
|
||||||
|
if (drawable == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (drawable instanceof BitmapDrawable) {
|
||||||
|
return ((BitmapDrawable) drawable).getBitmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Bitmap bitmap;
|
||||||
|
|
||||||
|
if (drawable instanceof ColorDrawable) {
|
||||||
|
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
|
||||||
|
} else {
|
||||||
|
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
|
Canvas canvas = new Canvas(bitmap);
|
||||||
|
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||||
|
drawable.draw(canvas);
|
||||||
|
return bitmap;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setup() {
|
||||||
|
if (!mReady) {
|
||||||
|
mSetupPending = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getWidth() == 0 && getHeight() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mBitmap == null) {
|
||||||
|
invalidate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
|
||||||
|
|
||||||
|
mBitmapPaint.setAntiAlias(true);
|
||||||
|
mBitmapPaint.setShader(mBitmapShader);
|
||||||
|
|
||||||
|
mBorderPaint.setStyle(Paint.Style.STROKE);
|
||||||
|
mBorderPaint.setAntiAlias(true);
|
||||||
|
mBorderPaint.setColor(mBorderColor);
|
||||||
|
mBorderPaint.setStrokeWidth(mBorderWidth);
|
||||||
|
|
||||||
|
mFillPaint.setStyle(Paint.Style.FILL);
|
||||||
|
mFillPaint.setAntiAlias(true);
|
||||||
|
mFillPaint.setColor(mFillColor);
|
||||||
|
|
||||||
|
mBitmapHeight = mBitmap.getHeight();
|
||||||
|
mBitmapWidth = mBitmap.getWidth();
|
||||||
|
|
||||||
|
mBorderRect.set(0, 0, getWidth(), getHeight());
|
||||||
|
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2.0f, (mBorderRect.width() - mBorderWidth) / 2.0f);
|
||||||
|
|
||||||
|
mDrawableRect.set(mBorderRect);
|
||||||
|
if (!mBorderOverlay) {
|
||||||
|
mDrawableRect.inset(mBorderWidth, mBorderWidth);
|
||||||
|
}
|
||||||
|
mDrawableRadius = Math.min(mDrawableRect.height() / 2.0f, mDrawableRect.width() / 2.0f);
|
||||||
|
|
||||||
|
updateShaderMatrix();
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateShaderMatrix() {
|
||||||
|
float scale;
|
||||||
|
float dx = 0;
|
||||||
|
float dy = 0;
|
||||||
|
|
||||||
|
mShaderMatrix.set(null);
|
||||||
|
|
||||||
|
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {
|
||||||
|
scale = mDrawableRect.height() / (float) mBitmapHeight;
|
||||||
|
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
|
||||||
|
} else {
|
||||||
|
scale = mDrawableRect.width() / (float) mBitmapWidth;
|
||||||
|
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
mShaderMatrix.setScale(scale, scale);
|
||||||
|
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mDrawableRect.left, (int) (dy + 0.5f) + mDrawableRect.top);
|
||||||
|
|
||||||
|
mBitmapShader.setLocalMatrix(mShaderMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,6 +33,6 @@ interface IWindowManagerView {
|
|||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
interface OnViewClickListener {
|
interface OnViewClickListener {
|
||||||
void onClick( View view );
|
void onClick( View view, float xPos, float yPos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,10 @@ class WindowManagerImpl implements IWindowManagerView {
|
|||||||
// 只要按钮一动位置不是很大,就认为是点击事件
|
// 只要按钮一动位置不是很大,就认为是点击事件
|
||||||
if ( Math.abs( mOldOffsetX - newOffsetX ) <= 20
|
if ( Math.abs( mOldOffsetX - newOffsetX ) <= 20
|
||||||
&& Math.abs( mOldOffsetY - newOffsetY ) <= 20 ) {
|
&& Math.abs( mOldOffsetY - newOffsetY ) <= 20 ) {
|
||||||
listener.onClick( mParams.mContentView );
|
if ( listener != null ) {
|
||||||
|
listener.onClick( mParams.mContentView, x, y );
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
mOldOffsetX = newOffsetX;
|
mOldOffsetX = newOffsetX;
|
||||||
mOldOffsetY = newOffsetY;
|
mOldOffsetY = newOffsetY;
|
||||||
|
|||||||
|
After Width: | Height: | Size: 753 B |
|
After Width: | Height: | Size: 750 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 753 B |
|
After Width: | Height: | Size: 750 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -2,15 +2,15 @@
|
|||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item
|
<item
|
||||||
android:id="@android:id/background"
|
android:id="@android:id/background"
|
||||||
android:drawable="@drawable/icon_enthusiasm_unchoose">
|
android:drawable="@drawable/icon_heart_unchoose">
|
||||||
</item>
|
</item>
|
||||||
<item
|
<item
|
||||||
android:id="@android:id/secondaryProgress"
|
android:id="@android:id/secondaryProgress"
|
||||||
android:drawable="@drawable/icon_enthusiasm_second">
|
android:drawable="@drawable/icon_heart_second">
|
||||||
</item>
|
</item>
|
||||||
<item
|
<item
|
||||||
android:id="@android:id/progress"
|
android:id="@android:id/progress"
|
||||||
android:drawable="@drawable/icon_enthusiasm_choose">
|
android:drawable="@drawable/icon_heart_choose">
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
</layer-list>
|
</layer-list>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/customRatingBar">
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_gravity="top|center"
|
android:layout_gravity="top|center"
|
||||||
android:layout_marginTop="@dimen/dp_40"
|
android:layout_marginTop="@dimen/dp_40"
|
||||||
android:background="@drawable/v2xt_dw_common_corner_bkg_light"
|
android:background="@drawable/module_dw_common_corner_bkg_light"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="刷新"
|
android:text="刷新"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<dimen name="heart_ratingbar_width">20px</dimen>
|
||||||
|
<dimen name="heart_ratingbar_height">16px</dimen>
|
||||||
|
<dimen name="v2x_panel_loading_top">120px</dimen>
|
||||||
|
<dimen name="v2x_share_btn_width">150px</dimen>
|
||||||
|
<dimen name="v2x_share_btn_height">48px</dimen>
|
||||||
|
<dimen name="share_item_address">17.5000px</dimen>
|
||||||
|
|
||||||
|
</resources>
|
||||||
@@ -1054,5 +1054,12 @@
|
|||||||
<dimen name="sp_48">48px</dimen>
|
<dimen name="sp_48">48px</dimen>
|
||||||
<dimen name="module_common_shadow_width">-10px</dimen>
|
<dimen name="module_common_shadow_width">-10px</dimen>
|
||||||
<dimen name="module_common_shadow_width_pos">10px</dimen>
|
<dimen name="module_common_shadow_width_pos">10px</dimen>
|
||||||
|
<dimen name="heart_ratingbar_width">40px</dimen>
|
||||||
|
<dimen name="heart_ratingbar_height">43px</dimen>
|
||||||
|
<dimen name="v2x_panel_loading_top">300px</dimen>
|
||||||
|
<dimen name="v2x_share_btn_width">281px</dimen>
|
||||||
|
<dimen name="v2x_share_btn_height">90px</dimen>
|
||||||
|
<dimen name="share_item_address">32px</dimen>
|
||||||
|
<dimen name="panel_list_item_title_size">28px</dimen>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -6,4 +6,38 @@
|
|||||||
<enum name="vertical" value="1" />
|
<enum name="vertical" value="1" />
|
||||||
</attr>
|
</attr>
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
|
<declare-styleable name="CustomCircleImageView">
|
||||||
|
<attr name="civ_border_width" format="dimension" />
|
||||||
|
<attr name="civ_border_color" format="color" />
|
||||||
|
<attr name="civ_border_overlay" format="boolean" />
|
||||||
|
<attr name="civ_fill_color" format="color" />
|
||||||
|
</declare-styleable>
|
||||||
|
<declare-styleable name="CustomRatingBar">
|
||||||
|
<!--宽-->
|
||||||
|
<attr name="elenmentWidth" format="dimension" />
|
||||||
|
<!--高-->
|
||||||
|
<attr name="elenmentHeight" format="dimension" />
|
||||||
|
<!--单元间距-->
|
||||||
|
<attr name="elenmentPadding" format="dimension" />
|
||||||
|
<!--单元总数-->
|
||||||
|
<attr name="elenmentCount" format="integer" />
|
||||||
|
<!--空资源-->
|
||||||
|
<attr name="elenmentEmpty" format="reference" />
|
||||||
|
<!--满资源-->
|
||||||
|
<attr name="elenmentFill" format="reference" />
|
||||||
|
<!--半资源-->
|
||||||
|
<attr name="elenmentHarf" format="reference" />
|
||||||
|
<!--是否可点击-->
|
||||||
|
<attr name="clickable" format="boolean" />
|
||||||
|
<!--当前进度-->
|
||||||
|
<attr name="elenmentStep" format="float" />
|
||||||
|
<!--进度方式 半个还是整个-->
|
||||||
|
|
||||||
|
<attr name="stepSize">
|
||||||
|
<enum name="Half" value="0" />
|
||||||
|
<enum name="Full" value="1" />
|
||||||
|
</attr>
|
||||||
|
|
||||||
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -2,4 +2,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<color name="module_commons_dlg_bkg">#7f000000</color>
|
<color name="module_commons_dlg_bkg">#7f000000</color>
|
||||||
<color name="module_commons_wm_dialog_text_textColor">#FFFFFF</color>
|
<color name="module_commons_wm_dialog_text_textColor">#FFFFFF</color>
|
||||||
|
<color name="v2x_FFF_666">#FFFFFF</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1045,4 +1045,12 @@
|
|||||||
<dimen name="sp_48">26.2500px</dimen>
|
<dimen name="sp_48">26.2500px</dimen>
|
||||||
<dimen name="module_common_shadow_width">-8px</dimen>
|
<dimen name="module_common_shadow_width">-8px</dimen>
|
||||||
<dimen name="module_common_shadow_width_pos">8px</dimen>
|
<dimen name="module_common_shadow_width_pos">8px</dimen>
|
||||||
|
<dimen name="heart_ratingbar_width">20px</dimen>
|
||||||
|
<dimen name="heart_ratingbar_height">16px</dimen>
|
||||||
|
<dimen name="v2x_panel_loading_top">120px</dimen>
|
||||||
|
<dimen name="v2x_share_btn_width">150px</dimen>
|
||||||
|
<dimen name="v2x_share_btn_height">48px</dimen>
|
||||||
|
<dimen name="share_item_address">17.5000px</dimen>
|
||||||
|
<dimen name="panel_list_item_title_size">15.3125px</dimen>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||