Merge branch 'dev' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into dev
@@ -71,7 +71,7 @@ android {
|
||||
//独立app
|
||||
independent{
|
||||
dimension "basic"
|
||||
applicationId rootProject.ext.android.applicationId
|
||||
applicationId rootProject.ext.android.independentApplicationId
|
||||
// 是否启动位置服务
|
||||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
|
||||
// 是否使用自定义导航
|
||||
@@ -82,7 +82,7 @@ android {
|
||||
// launcher app
|
||||
launcher{
|
||||
dimension "basic"
|
||||
applicationId rootProject.ext.android.applicationId
|
||||
applicationId rootProject.ext.android.launcherApplicationId
|
||||
// 是否启动位置服务
|
||||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
|
||||
// 是否使用自定义导航
|
||||
@@ -93,14 +93,20 @@ android {
|
||||
// f系列-分体机全系列,未细分
|
||||
f8xx{
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
}
|
||||
// e系列
|
||||
e8xx {
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
}
|
||||
// d系列
|
||||
d8xx {
|
||||
dimension "product"
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
}
|
||||
qa {
|
||||
dimension "env"
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
<application
|
||||
android:name=".MogoApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_shell_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
tools:replace="android:label">
|
||||
@@ -16,7 +15,7 @@
|
||||
<meta-data
|
||||
tools:replace="android:value"
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="a36b9f7b086fa3951bb35338a5a06dd3" />
|
||||
android:value="1c3fbc5f5e183619ffb1e7bc01e6751f" />
|
||||
</application>
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
<application
|
||||
android:name=".MogoApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_shell_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
tools:replace="android:label">
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
<application
|
||||
android:name=".MogoApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_shell_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
tools:replace="android:label">
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.module.media.MediaConstants;
|
||||
import com.mogo.module.push.PushUIConstants;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.utils.logger.LogLevel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -36,6 +37,10 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
public void onCreate() {
|
||||
DebugConfig.setNetMode(BuildConfig.NET_ENV);
|
||||
DebugConfig.setDebug(BuildConfig.DEBUG);
|
||||
DebugConfig.setAIType(BuildConfig.AIType);
|
||||
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
|
||||
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
|
||||
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
|
||||
super.onCreate();
|
||||
// Crash 日志收集
|
||||
final long start = System.currentTimeMillis();
|
||||
@@ -50,18 +55,17 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
|
||||
//运营位卡片,需要默认显示,放在第一个加载
|
||||
MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
|
||||
if(DebugConfig.isLauncher()) {
|
||||
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
|
||||
}
|
||||
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
|
||||
|
||||
MogoModulePaths.addModule(new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
|
||||
// 暂时去掉推送
|
||||
// MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
|
||||
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
|
||||
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
|
||||
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
|
||||
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
app/src/main/res/drawable-xhdpi/ic_launcher.png
Executable file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/ic_launcher.png
Executable file
|
After Width: | Height: | Size: 7.4 KiB |
@@ -1,170 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#008577"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,11 +1,13 @@
|
||||
ext {
|
||||
android = [
|
||||
applicationId : "com.mogo.launcher",
|
||||
zhidadoApplicationId: "com.zhidao.launcher",
|
||||
compileSdkVersion : 28,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 19,
|
||||
targetSdkVersion : 22,
|
||||
// applicationId : "com.mogo.launcher",
|
||||
// zhidadoApplicationId: "com.zhidao.launcher",
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
independentApplicationId: "com.mogo.launcher.app",
|
||||
compileSdkVersion : 28,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 19,
|
||||
targetSdkVersion : 22,
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@@ -149,5 +151,6 @@ ext {
|
||||
|
||||
// 个人中心的SDK
|
||||
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
|
||||
tanluupload : "com.mogo.module:module-tanlu-upload:${TANLULIB_VERSION}",
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.commons.debug;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -51,6 +53,17 @@ public class DebugConfig {
|
||||
|
||||
private static int sNetMode = NET_MODE_RELEASE;
|
||||
|
||||
/**
|
||||
* 语音使用同行者
|
||||
*/
|
||||
public static final int AI_TYPE_TXZ = 1;
|
||||
/**
|
||||
* 语音使用思必驰
|
||||
*/
|
||||
public static final int AI_TYPE_SPEECH = 2;
|
||||
|
||||
private static int sAIType = AI_TYPE_TXZ;
|
||||
|
||||
/**
|
||||
* 获取网络环境类型
|
||||
*
|
||||
@@ -100,6 +113,22 @@ public class DebugConfig {
|
||||
DebugConfig.sUseCustomNavi = sUseCustomNavi;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置使用哪个语音助手
|
||||
* @param aiType {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
public static void setAIType(int aiType){
|
||||
Logger.d("DebugConfig", "setAiType: " + aiType);
|
||||
sAIType = aiType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用哪个语音助手 {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
public static int getAIType(){
|
||||
return sAIType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否作为launcher运行
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,6 @@ class Devices {
|
||||
}
|
||||
|
||||
public static boolean isBind() {
|
||||
return false;
|
||||
return sIsBind;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,6 +380,9 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.0.0.1
|
||||
|
||||
## 工程外部模块
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.0.6.6
|
||||
MOGO_MODULE_TANLU_VERSION=1.1.0.1-SNAPSHOT
|
||||
# 车聊聊
|
||||
CARCHATTING_VERSION=1.0.6-SNAPSHOT
|
||||
# 车聊聊接口
|
||||
@@ -77,6 +77,8 @@ MOGO_MODULE_MEDIA_VERSION=1.0.4.11
|
||||
MOGO_MODULE_PUSH_VERSION=1.0.1
|
||||
# 广告资源位
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=1.0.2-SNAPSHOT
|
||||
|
||||
## 产品库必备配置
|
||||
applicationId=com.mogo.launcer
|
||||
|
||||
@@ -53,14 +53,8 @@ public class BnHooker implements InvocationHandler {
|
||||
@Override
|
||||
public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable {
|
||||
if ( method.getName().equals( "setRenderFps" ) ) {
|
||||
Logger.d( TAG, "setRenderFps" );
|
||||
if ( !NaviClient.getInstance( mContext ).isNaviing() ) {
|
||||
}
|
||||
return method.invoke( host, 10 );
|
||||
}
|
||||
if ( method.getName().equals( "drawFrame" ) ) {
|
||||
Logger.d( TAG, "drawFrame" );
|
||||
}
|
||||
return method.invoke( host, args );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,12 @@ public class NavigatorApps {
|
||||
private static AppInfo app = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi, 1 );
|
||||
private static AppInfo app_ = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi_disable, 1 );
|
||||
private static AppInfo app2 = new AppInfo( "音乐", "com.pvetec.musics", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
|
||||
private static AppInfo app3 = new AppInfo( "个人中心", "com.zhidao.auto.personal", "", 0, null, R.drawable.module_apps_ic_navigator_personcenter, 3 );
|
||||
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist, 4 );
|
||||
|
||||
public static List< AppInfo > getApps() {
|
||||
List< AppInfo > sApps = new ArrayList<>();
|
||||
sApps.add( app );
|
||||
sApps.add( app2 );
|
||||
// sApps.add( app3 );
|
||||
sApps.add( app4 );
|
||||
return sApps;
|
||||
}
|
||||
@@ -32,7 +30,6 @@ public class NavigatorApps {
|
||||
List< AppInfo > sApps = new ArrayList<>();
|
||||
sApps.add( app );
|
||||
sApps.add( app2 );
|
||||
// sApps.add( app3 );
|
||||
sApps.add( app4 );
|
||||
return sApps;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.apps.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.device.Devices;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.apps.AppServiceHandler;
|
||||
@@ -34,7 +35,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
trackNavigatorClickEvent( 5 );
|
||||
} else {
|
||||
if ( mDebugModeOpen ) {
|
||||
AIAssist.startAssistant( v.getContext(), 2 );
|
||||
AIAssist.startAssistant( v.getContext(), 1 );
|
||||
trackNavigatorClickEvent( 5 );
|
||||
return;
|
||||
}
|
||||
@@ -42,7 +43,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
mLastClickTime = System.currentTimeMillis();
|
||||
mClickCounter++;
|
||||
} else {
|
||||
if ( mClickCounter == TOTAL_CLICK_AMOUNT && !mDebugModeOpen ) {
|
||||
if ( mClickCounter == TOTAL_CLICK_AMOUNT ) {
|
||||
AIAssist.startAssistant( v.getContext(), 2 );
|
||||
TipToast.shortTip( "开启语音调试" );
|
||||
mClickCounter = 0;
|
||||
@@ -50,7 +51,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
mDebugModeOpen = true;
|
||||
} else if ( System.currentTimeMillis() - mLastClickTime > INTERVAL ) {
|
||||
mClickCounter = 0;
|
||||
TipToast.shortTip( "请在2秒内打开调试模式" );
|
||||
TipToast.shortTip( "请在2秒内连续点击5次打开语音调试模式" );
|
||||
} else {
|
||||
mClickCounter++;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -51,7 +51,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.moduleshare
|
||||
implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
// implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
@@ -60,7 +60,7 @@ dependencies {
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-share')
|
||||
implementation project(':modules:mogo-module-authorize')
|
||||
// implementation project(':modules:mogo-module-authorize')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
@@ -54,6 +55,7 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
mUserHeadImg = findViewById(R.id.ivUserHeadImg);
|
||||
|
||||
mMsgContainer = findViewById( R.id.module_ext_id_msg );
|
||||
|
||||
mMsgContainer.setOnClickListener( view -> {
|
||||
ARouter.getInstance().build( "/push/ui/message" ).navigation( getContext() );
|
||||
} );
|
||||
@@ -65,6 +67,8 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
Logger.e(TAG, e, "打开个人中心Exception");
|
||||
}
|
||||
});
|
||||
|
||||
mUserHeadImg.setVisibility(DebugConfig.isLauncher()?View.VISIBLE:View.GONE);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -125,8 +125,12 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
|
||||
@Override
|
||||
public void onSuccess(UserInfoResponse userInfoBaseResponse) {
|
||||
userInfo = userInfoBaseResponse.getResult();
|
||||
Logger.d(TAG, "获取个人信息成功: " + userInfo);
|
||||
mView.renderUserInfo(userInfo);
|
||||
if(userInfo!=null) {
|
||||
Logger.d(TAG, "获取个人信息成功: " + userInfo);
|
||||
mView.renderUserInfo(userInfo);
|
||||
}else{
|
||||
Logger.e(TAG,"获取个人信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -30,9 +29,6 @@ import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.common.map.CustomNaviInterrupter;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
@@ -40,9 +36,7 @@ import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.utils.TopViewAnimHelper;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
@@ -56,14 +50,12 @@ import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -71,12 +63,11 @@ import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerCons
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresenter >
|
||||
public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresenter>
|
||||
implements EntranceView,
|
||||
IMogoNaviListener,
|
||||
IMogoMapListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoAcquireAuthorizeListener,
|
||||
IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "EntranceFragment";
|
||||
@@ -107,7 +98,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private IMogoStatusManager mMogoStatusManager;
|
||||
private EntrancePresenter mEntrancePresenter;
|
||||
private IMogoAuthorizeModuleManager mIMogoAuthorizeModuleManager;
|
||||
private IMogoStatusManager mStatusManager;
|
||||
|
||||
|
||||
@@ -176,10 +166,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private Runnable mLockCarRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if ( !mStatusManager.isDisplayOverview() ) {
|
||||
if (!mStatusManager.isDisplayOverview()) {
|
||||
return;
|
||||
}
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
mStatusManager.setDisplayOverview(TAG, false);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
};
|
||||
@@ -189,23 +179,21 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
return R.layout.module_ext_layout_entrance;
|
||||
}
|
||||
|
||||
private List< View > demoCache = new ArrayList<>();
|
||||
private List<View> demoCache = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
mIMogoAuthorizeModuleManager = ( IMogoAuthorizeModuleManager ) ARouter.getInstance().build( AuthorizeConstant.PROVIDER_MODULE ).navigation( getContext() );
|
||||
mIMogoAuthorizeModuleManager.registerAuthorizeListener( AUTHORIZE_TYPE_LAUNCHER_SHARE, this );
|
||||
mApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(getContext());
|
||||
|
||||
mEntrancePresenter = new EntrancePresenter( getContext(), this, mIMogoAuthorizeModuleManager );
|
||||
mEntrancePresenter = new EntrancePresenter(getContext(), this);
|
||||
mMogoFragmentManager = mApis.getFragmentManagerApi();
|
||||
|
||||
mStatusManager = mApis.getStatusManagerApi();
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUpload = findViewById( R.id.module_entrance_id_upload );
|
||||
mUploading = findViewById( R.id.module_entrance_id_uploading );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
mUploadRoadCondition = findViewById(R.id.module_entrance_id_upload_road_condition);
|
||||
mUpload = findViewById(R.id.module_entrance_id_upload);
|
||||
mUploading = findViewById(R.id.module_entrance_id_uploading);
|
||||
mUploadRoadCondition.setOnClickListener(view -> {
|
||||
// // todo 测试动画
|
||||
// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
|
||||
// TextView tv = v.findViewById(R.id.tvIndex);
|
||||
@@ -224,25 +212,25 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
// });
|
||||
// 原始逻辑
|
||||
showShareDialog();
|
||||
} );
|
||||
});
|
||||
|
||||
mDisplayOverview = findViewById( R.id.module_ext_id_display_overview );
|
||||
mDisplayOverviewText = findViewById( R.id.module_ext_id_display_overview_text );
|
||||
mDisplayOverviewIcon = findViewById( R.id.module_ext_id_display_overview_icon );
|
||||
mDisplayOverview.setOnClickListener( view -> {
|
||||
if ( !mStatusManager.isDisplayOverview() ) {
|
||||
mMApUIController.displayOverview( mDisplayOverviewBounds );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
UiThreadHandler.postDelayed( mLockCarRunnable, 20_000 );
|
||||
mDisplayOverview = findViewById(R.id.module_ext_id_display_overview);
|
||||
mDisplayOverviewText = findViewById(R.id.module_ext_id_display_overview_text);
|
||||
mDisplayOverviewIcon = findViewById(R.id.module_ext_id_display_overview_icon);
|
||||
mDisplayOverview.setOnClickListener(view -> {
|
||||
if (!mStatusManager.isDisplayOverview()) {
|
||||
mMApUIController.displayOverview(mDisplayOverviewBounds);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
UiThreadHandler.postDelayed(mLockCarRunnable, 20_000);
|
||||
} else {
|
||||
mMApUIController.recoverLockMode();
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
}
|
||||
mStatusManager.setDisplayOverview( TAG, !mStatusManager.isDisplayOverview() );
|
||||
} );
|
||||
mStatusManager.setDisplayOverview(TAG, !mStatusManager.isDisplayOverview());
|
||||
});
|
||||
|
||||
mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
|
||||
mMove2CurrentLocation.setOnClickListener( view -> {
|
||||
mMove2CurrentLocation = findViewById(R.id.module_entrance_id_move2_current_location);
|
||||
mMove2CurrentLocation.setOnClickListener(view -> {
|
||||
// // todo 测试动画
|
||||
// if(!toggle) {
|
||||
// TopViewAnimHelper.getInstance().showNaviView();
|
||||
@@ -258,102 +246,109 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
// }
|
||||
// 原始逻辑
|
||||
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
|
||||
if ( location != null ) {
|
||||
if ( !mMogoStatusManager.isV2XShow() ) {
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.setLockZoom( 16 );
|
||||
mMApUIController.changeZoom( 16.0f );
|
||||
if (location != null) {
|
||||
if (!mMogoStatusManager.isV2XShow()) {
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.setLockZoom(16);
|
||||
mMApUIController.changeZoom(16.0f);
|
||||
}
|
||||
if ( mStatusManager.isDisplayOverview() ) {
|
||||
mMogoStatusManager.setDisplayOverview( TAG, false );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
if (mStatusManager.isDisplayOverview()) {
|
||||
mMogoStatusManager.setDisplayOverview(TAG, false);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
}
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
// mNaviInfo = findViewById( R.id.module_entrance_id_navi_info_panel );
|
||||
ConstraintLayout rootView = findViewById( R.id.module_entrance_id_top_motion_layout );
|
||||
if ( rootView != null ) {
|
||||
TopViewAnimHelper.getInstance().init( rootView );
|
||||
ConstraintLayout rootView = findViewById(R.id.module_entrance_id_top_motion_layout);
|
||||
if (rootView != null) {
|
||||
TopViewAnimHelper.getInstance().init(rootView);
|
||||
}
|
||||
|
||||
mExitNavi = findViewById( R.id.module_entrance_id_exit_navi );
|
||||
mExitNavi.setOnClickListener( view -> {
|
||||
if ( mMogoNavi != null ) {
|
||||
if ( mIsLock ) {
|
||||
new WMDialog.Builder( getContext() )
|
||||
.setOkButton( R.string.module_commons_button_ok, ( dlg, which ) -> {
|
||||
mExitNavi = findViewById(R.id.module_entrance_id_exit_navi);
|
||||
mExitNavi.setOnClickListener(view -> {
|
||||
if (mMogoNavi != null) {
|
||||
if (mIsLock) {
|
||||
new WMDialog.Builder(getContext())
|
||||
.setOkButton(R.string.module_commons_button_ok, (dlg, which) -> {
|
||||
dlg.dismiss();
|
||||
mMogoNavi.stopNavi();
|
||||
} )
|
||||
.setCancelButton( R.string.module_commons_button_cancel, ( dlg, which ) -> {
|
||||
})
|
||||
.setCancelButton(R.string.module_commons_button_cancel,
|
||||
(dlg, which) -> {
|
||||
dlg.dismiss();
|
||||
} )
|
||||
.setContent( R.string.module_commons_exit_navi_content )
|
||||
})
|
||||
.setContent(R.string.module_commons_exit_navi_content)
|
||||
.build()
|
||||
.show();
|
||||
} else {
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMApUIController, Scene.NAVI );
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mMApUIController, Scene.NAVI);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
mCameraMode = findViewById( R.id.module_ext_id_north );
|
||||
mCameraMode.setOnClickListener( view -> {
|
||||
if ( mCameraMode.isSelected() ) {
|
||||
mMApUIController.changeMapMode( EnumMapUI.CarUp_2D );
|
||||
mCameraMode = findViewById(R.id.module_ext_id_north);
|
||||
mCameraMode.setOnClickListener(view -> {
|
||||
if (mCameraMode.isSelected()) {
|
||||
mMApUIController.changeMapMode(EnumMapUI.CarUp_2D);
|
||||
} else {
|
||||
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
mCameraMode.setSelected( !mCameraMode.isSelected() );
|
||||
mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
} );
|
||||
mCameraMode.setSelected(!mCameraMode.isSelected());
|
||||
mCameraMode.setText(getString(mCameraMode.isSelected() ? R.string.mode_car_up :
|
||||
R.string.mode_north_up));
|
||||
});
|
||||
|
||||
|
||||
mApis.getIntentManagerApi().registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV,
|
||||
new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
int key_type = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
|
||||
int opera_type = intent.getIntExtra( "EXTRA_OPERA", -1 );
|
||||
if ( key_type == 10027 ) {
|
||||
if ( opera_type == 0 ) {
|
||||
mCameraMode.setSelected( false );
|
||||
} else if ( opera_type == 1 ) {
|
||||
mCameraMode.setSelected( true );
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
int key_type = intent.getIntExtra("KEY_TYPE", 0);
|
||||
int type = intent.getIntExtra("EXTRA_TYPE", -1);
|
||||
int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
|
||||
if (key_type == 10027) {
|
||||
if (opera_type == 0) {
|
||||
mCameraMode.setSelected(false);
|
||||
} else if (opera_type == 1) {
|
||||
mCameraMode.setSelected(true);
|
||||
}
|
||||
mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
mCameraMode.setText(getString(mCameraMode.isSelected() ?
|
||||
R.string.mode_car_up : R.string.mode_north_up));
|
||||
}
|
||||
}
|
||||
} );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON1, findViewById( R.id.module_entrance_id_button1 ) );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON2, findViewById( R.id.module_entrance_id_button2 ) );
|
||||
});
|
||||
MogoEntranceButtons.save(ButtonIndex.BUTTON1,
|
||||
findViewById(R.id.module_entrance_id_button1));
|
||||
MogoEntranceButtons.save(ButtonIndex.BUTTON2,
|
||||
findViewById(R.id.module_entrance_id_button2));
|
||||
|
||||
mDisplayOverviewBounds = new Rect(
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_left_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_top_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_right_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_bottom_margin )
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_left_margin),
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_top_margin),
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_right_margin),
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_bottom_margin)
|
||||
);
|
||||
|
||||
mNaviInfo = new NaviInfoView();
|
||||
mNaviInfo.inflate( rootView );
|
||||
mNaviInfo.inflate(rootView);
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
isClickShare = true;
|
||||
if ( mIMogoAuthorizeModuleManager.needAuthorize( AUTHORIZE_TYPE_LAUNCHER_SHARE ) ) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization( AUTHORIZE_TYPE_LAUNCHER_SHARE );
|
||||
} else {
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData( "1" );
|
||||
}
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData("1");
|
||||
}
|
||||
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -362,165 +357,142 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
mService = mApis.getMapServiceApi();
|
||||
mMogoRegisterCenter = mApis.getRegisterCenterApi();
|
||||
mMApUIController = mService.getMapUIController();
|
||||
mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
|
||||
mMogoNavi = mService.getNavi( getContext() );
|
||||
mMogoLocationClient = mService.getSingletonLocationClient(getContext());
|
||||
mMogoNavi = mService.getNavi(getContext());
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mMogoStatusManager = mApis.getStatusManagerApi();
|
||||
|
||||
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoAimlessModeListener( TAG, this );
|
||||
mMogoRegisterCenter.registerMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
|
||||
mMogoRegisterCenter.registerMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
|
||||
mMogoRegisterCenter.registerMogoAimlessModeListener(TAG, this);
|
||||
|
||||
mMogoMarkerManager = mService.getMarkerManager( getContext() );
|
||||
mMogoMarkerManager = mService.getMarkerManager(getContext());
|
||||
|
||||
mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.UPLOADING, this );
|
||||
mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.DISPLAY_OVERVIEW, this );
|
||||
mMogoStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.UPLOADING, this);
|
||||
mMogoStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW,
|
||||
this);
|
||||
|
||||
TopViewAnimHelper.getInstance().setIMogoMapUIController( mMApUIController );
|
||||
TopViewAnimHelper.getInstance().setIMogoMapUIController(mMApUIController);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if ( mEntrancePresenter != null ) {
|
||||
mEntrancePresenter.unregisterUnWake();
|
||||
}
|
||||
|
||||
isClickShare = false;
|
||||
mIMogoAuthorizeModuleManager.unregisterAuthorizeListener( AUTHORIZE_TYPE_LAUNCHER_SHARE );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void authorizeSuccess() {
|
||||
Log.d( TAG, "authorizeSuccess --------> isClickShare = " + isClickShare );
|
||||
if ( isClickShare ) {
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData( "1" );
|
||||
} else {
|
||||
mEntrancePresenter.handleNeedAuthorizeCmd();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorizeFailed( String errorMsg ) {
|
||||
Log.e( TAG, "authorizeFailed --------> errorMsg = " + errorMsg + " >> isClickShare = " + isClickShare );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forbiddenVoiceWhenAuthorize( String cmd ) {
|
||||
Log.d( TAG, "forbiddenVoiceWhenAuthorize --------> cmd = " + cmd );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
if ( naviinfo == null ) {
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
if (naviinfo == null) {
|
||||
return;
|
||||
}
|
||||
if ( mExitNavi.getVisibility() == View.GONE ) {
|
||||
if (mExitNavi.getVisibility() == View.GONE) {
|
||||
// 避免先导航,后启动app导致无法显示控件
|
||||
onStartNavi();
|
||||
}
|
||||
mNaviInfo.notifyChanged( naviinfo );
|
||||
mNaviInfo.notifyChanged(naviinfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
TopViewAnimHelper.getInstance().showNaviView();
|
||||
mMApUIController.changeMapMode( mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D : EnumMapUI.CarUp_2D );
|
||||
MapCenterPointStrategy.setMapCenterPointBySceneAndDelay( mMApUIController, Scene.NAVI, 500, () -> {
|
||||
mMApUIController.changeMapMode(mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D :
|
||||
EnumMapUI.CarUp_2D);
|
||||
MapCenterPointStrategy.setMapCenterPointBySceneAndDelay(mMApUIController, Scene.NAVI, 500
|
||||
, () -> {
|
||||
return !mMogoNavi.isNaviing();
|
||||
} );
|
||||
if(CustomNaviInterrupter.getInstance().interrupt()){
|
||||
});
|
||||
if (CustomNaviInterrupter.getInstance().interrupt()) {
|
||||
mDisplayOverview.setVisibility(View.GONE);
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
}else {
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility(View.GONE);
|
||||
} else {
|
||||
mExitNavi.setVisibility(View.VISIBLE);
|
||||
mDisplayOverview.setVisibility(View.VISIBLE);
|
||||
mCameraMode.setVisibility( View.VISIBLE );
|
||||
mCameraMode.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mApis.getAnalyticsApi().track( "Navigation_begin", new HashMap<>() );
|
||||
mApis.getAnalyticsApi().track("Navigation_begin", new HashMap<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
TopViewAnimHelper.getInstance().hideNaviView();
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
mDisplayOverview.setVisibility( View.GONE );
|
||||
mCameraMode.setVisibility( View.GONE );
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMApUIController, Scene.AIMLESS );
|
||||
mExitNavi.setVisibility(View.GONE);
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
mDisplayOverview.setVisibility(View.GONE);
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mMApUIController, Scene.AIMLESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic2( MogoTraffic traffic ) {
|
||||
if ( traffic == null ) {
|
||||
public void onUpdateTraffic2(MogoTraffic traffic) {
|
||||
if (traffic == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
public void onLockMap(boolean isLock) {
|
||||
mIsLock = isLock;
|
||||
if ( isLock ) {
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_navi );
|
||||
if ( mMogoStatusManager.isDisplayOverview() ) {
|
||||
mMogoStatusManager.setDisplayOverview( TAG, false );
|
||||
if (isLock) {
|
||||
mExitNavi.setText(R.string.module_ext_str_exit_navi);
|
||||
if (mMogoStatusManager.isDisplayOverview()) {
|
||||
mMogoStatusManager.setDisplayOverview(TAG, false);
|
||||
}
|
||||
} else {
|
||||
mExitNavi.setText( R.string.module_ext_str_continue_navi );
|
||||
mExitNavi.setText(R.string.module_ext_str_continue_navi);
|
||||
}
|
||||
}
|
||||
|
||||
private void traceData( String from ) {
|
||||
Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "from", from );
|
||||
mAnalytics.track( "Launcher_Share_Click", properties );
|
||||
private void traceData(String from) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("from", from);
|
||||
mAnalytics.track("Launcher_Share_Click", properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
if ( mUploadRoadCondition == null ) {
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (mUploadRoadCondition == null) {
|
||||
return;
|
||||
}
|
||||
if ( descriptor == StatusDescriptor.UPLOADING ) {
|
||||
if ( isTrue ) {
|
||||
mUploading.setVisibility( View.VISIBLE );
|
||||
mUpload.setVisibility( View.GONE );
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
if (descriptor == StatusDescriptor.UPLOADING) {
|
||||
if (isTrue) {
|
||||
mUploading.setVisibility(View.VISIBLE);
|
||||
mUpload.setVisibility(View.GONE);
|
||||
if (mUploadFrameAnimHandler != null) {
|
||||
mUploadFrameAnimHandler.removeMessages(MSG_STOP_ANIM);
|
||||
mUploadFrameAnimHandler.removeMessages(MSG_FRAME_ANIM);
|
||||
}
|
||||
doFrameAnimOnUploadButton();
|
||||
} else {
|
||||
mCurrentUploadFrame = 0;
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
if (mUploadFrameAnimHandler != null) {
|
||||
mUploadFrameAnimHandler.removeMessages(MSG_FRAME_ANIM);
|
||||
}
|
||||
mUploading.setVisibility( View.GONE );
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
mUploading.setVisibility(View.GONE);
|
||||
mUpload.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else if ( descriptor == StatusDescriptor.DISPLAY_OVERVIEW ) {
|
||||
if ( !mMogoNavi.isNaviing() ) {
|
||||
} else if (descriptor == StatusDescriptor.DISPLAY_OVERVIEW) {
|
||||
if (!mMogoNavi.isNaviing()) {
|
||||
return;
|
||||
}
|
||||
if ( isTrue ) {
|
||||
mDisplayOverviewText.setText( "退出全览" );
|
||||
mDisplayOverviewText.setTextSize( TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize( R.dimen.module_ext_display_overview_textSize ) );
|
||||
mCameraMode.setVisibility( View.GONE );
|
||||
if (isTrue) {
|
||||
mDisplayOverviewText.setText("退出全览");
|
||||
mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize));
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
} else {
|
||||
mDisplayOverviewText.setText( "全览" );
|
||||
mDisplayOverviewText.setTextSize( TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize( R.dimen.module_ext_display_overview_textSize_large ) );
|
||||
if(CustomNaviInterrupter.getInstance().interrupt()){
|
||||
mDisplayOverviewText.setText("全览");
|
||||
mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize_large));
|
||||
if (CustomNaviInterrupter.getInstance().interrupt()) {
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
}else {
|
||||
} else {
|
||||
mCameraMode.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
@@ -528,40 +500,41 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
private void doFrameAnimOnUploadButton() {
|
||||
if ( mUploadFrameAnimHandler == null ) {
|
||||
mUploadFrameAnimHandler = new Handler( Looper.getMainLooper() ) {
|
||||
if (mUploadFrameAnimHandler == null) {
|
||||
mUploadFrameAnimHandler = new Handler(Looper.getMainLooper()) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == MSG_FRAME_ANIM ) {
|
||||
if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
|
||||
if ( mUploading != null ) {
|
||||
mUploading.setVisibility( View.GONE );
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == MSG_FRAME_ANIM) {
|
||||
if (mUploadingFrameRes == null || mUploadingFrameRes.length == 0) {
|
||||
if (mUploading != null) {
|
||||
mUploading.setVisibility(View.GONE);
|
||||
}
|
||||
if ( mUpload != null ) {
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
if (mUpload != null) {
|
||||
mUpload.setVisibility(View.VISIBLE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( !mMogoStatusManager.isUploading() ) {
|
||||
if (!mMogoStatusManager.isUploading()) {
|
||||
mCurrentUploadFrame = 0;
|
||||
return;
|
||||
}
|
||||
if ( mUploading != null ) {
|
||||
if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
|
||||
if (mUploading != null) {
|
||||
if (mCurrentUploadFrame == mUploadingFrameRes.length) {
|
||||
mCurrentUploadFrame = 12;
|
||||
}
|
||||
mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
|
||||
mUploading.setImageResource(mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length]);
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM, TIME_FRAME_INTERVAL_TIME );
|
||||
} else if ( msg.what == MSG_STOP_ANIM ) {
|
||||
mStatusManager.setUploadingStatus( TAG, false );
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed(MSG_FRAME_ANIM,
|
||||
TIME_FRAME_INTERVAL_TIME);
|
||||
} else if (msg.what == MSG_STOP_ANIM) {
|
||||
mStatusManager.setUploadingStatus(TAG, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
|
||||
mUploadFrameAnimHandler.sendEmptyMessage(MSG_FRAME_ANIM);
|
||||
// 30s 后无论成功与否,停止动画
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed(MSG_STOP_ANIM, 30_000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,11 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.net.UserInfoNetApiServices;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoConstant;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoResponse;
|
||||
import com.mogo.module.extensions.utils.ExtensionsConfig;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.module.share.manager.UploadHelper;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.digest.DigestUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.auto.platform.util.DeviceUtil;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -54,353 +14,22 @@ import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerCons
|
||||
* 描述
|
||||
*/
|
||||
public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
private static final String REPORT_TANLU_BLOCK = "10007";
|
||||
private static final String REPORT_TANLU_TRAFFIC_CHECK = "10002";
|
||||
private static final String REPORT_TANLU_CLOSURE = "10003";
|
||||
|
||||
private Context mContext;
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private static final String TAG = "EntranceFragment";
|
||||
private IMogoIntentManager mogoIntentManager;
|
||||
private IMogoAuthorizeModuleManager mIMogoAuthorizeModuleManager;
|
||||
private String mVoiceCmdType; //一级命令
|
||||
private String mVoiceCmdShareType; //对某些一级命令里面细分的类型做处理
|
||||
private IMogoStatusManager mStatusManager;
|
||||
|
||||
public EntrancePresenter(Context context, EntranceView view,
|
||||
IMogoAuthorizeModuleManager authorizeModuleManager) {
|
||||
public EntrancePresenter(Context context, EntranceView view) {
|
||||
super(view);
|
||||
mContext = context;
|
||||
IMogoServiceApis apis =
|
||||
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(mContext);
|
||||
mAnalytics = apis.getAnalyticsApi();
|
||||
mogoIntentManager = apis.getIntentManagerApi();
|
||||
mIMogoAuthorizeModuleManager = authorizeModuleManager;
|
||||
mStatusManager = apis.getStatusManagerApi();
|
||||
|
||||
registerUnWake();
|
||||
registerAwakeVoice();
|
||||
}
|
||||
|
||||
private void registerUnWake() {
|
||||
// AIAssist.getInstance( mContext ).registerUnWakeupCommand( ExtensionsModuleConst.CLOSE,
|
||||
// ExtensionsModuleConst.CMD_CLOSE, mogoVoiceListener );
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.CANCLE_SHARE
|
||||
, ExtensionsModuleConst.CMD_CANCLE_SHARE, mogoVoiceListener);
|
||||
//探路相关上报
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK, ExtensionsModuleConst.CMD_UPLOAD_BLOCK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK, ExtensionsModuleConst.CMD_TRAFFIC_CHECK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE, ExtensionsModuleConst.CMD_ROAD_CLOSURE, mogoVoiceListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume(@NonNull LifecycleOwner owner) {
|
||||
super.onResume(owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 免唤醒语音监听
|
||||
*/
|
||||
private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() {
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
Log.d(TAG,
|
||||
"免唤醒 mogoVoiceListener needAuthorize = " + mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE) + " >>>cmd = " + cmd);
|
||||
mVoiceCmdType = cmd;
|
||||
if (cmd.equals(ExtensionsModuleConst.CANCLE_SHARE)
|
||||
/*|| cmd.equals( ExtensionsModuleConst.CLOSE ) */) { //取消分享,关闭页面
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)) { //上报拥堵
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadRoadCondition();
|
||||
}
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK)) { //上报交通检查
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadTrfficCheck();
|
||||
}
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE)) { //上报封路
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadRoadClosed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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 onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册唤醒命令
|
||||
*/
|
||||
private void registerAwakeVoice() {
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION,
|
||||
mogoIntentListener);
|
||||
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.GO_TO_SHARE,
|
||||
mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.SHARE_DIALOG_CLOSE,
|
||||
mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.NO_REPLY_SHARE_DIALOG_CLOSE, mogoIntentListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 唤醒语音
|
||||
*/
|
||||
private IMogoIntentListener mogoIntentListener = new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
mVoiceCmdType = intentStr;
|
||||
EntranceFragment.isClickShare = false;
|
||||
|
||||
String data = intent.getStringExtra("data");
|
||||
Log.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data + " " +
|
||||
">>> needAuthorize = " + mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE));
|
||||
if (intentStr.equals(ExtensionsModuleConst.GO_TO_SHARE)) { //我要分享 --ok
|
||||
String conditionData = intent.getStringExtra("data");
|
||||
Log.d(TAG,
|
||||
"唤醒 mogoIntentListener intentStr =" + intentStr + ">>conditionData =" + conditionData);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(data);
|
||||
String typeString = jsonObject.get("ob").toString();
|
||||
Log.d(TAG, "mogoIntentListener specified typeString = " + typeString);
|
||||
mVoiceCmdShareType = typeString;
|
||||
if (!TextUtils.isEmpty(typeString)) {
|
||||
if (typeString.equals("封路")) {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
Log.d(TAG, "mogoIntentListener 封路 -------> ");
|
||||
uploadRoadClosed();
|
||||
}
|
||||
} else if (typeString.equals("油价")) {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
Log.d(TAG, "mogoIntentListener 油价 -------> ");
|
||||
shareOilPrice();
|
||||
}
|
||||
} else if (typeString.equals("交通检查")) {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
Log.d(TAG, "mogoIntentListener 交通检查 -------> ");
|
||||
uploadTrfficCheck();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
Log.d(TAG, "mogoIntentListener 我要分享 ----> ");
|
||||
traceData("2");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)) {
|
||||
//分享路况/上报路况/上报拥堵 唤醒
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
jsonObject = new JSONObject(data);
|
||||
String typeString = jsonObject.get("obj").toString();
|
||||
Logger.d(TAG, "mogiIntentListener 准备上报拥堵: " + typeString);
|
||||
if ("拥堵".equals(typeString)) {
|
||||
uploadRoadCondition();
|
||||
Log.d(TAG, "mogoIntentListener 上报拥堵 唤醒 ----> ");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.SHARE_DIALOG_CLOSE)) { //关闭分享框 唤醒
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
Log.d(TAG, "mogoIntentListener 关闭分享框 唤醒 ----> ");
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.NO_REPLY_SHARE_DIALOG_CLOSE)) {
|
||||
// 两次未回复关闭对话框
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
Logger.d(TAG, "mogoIntentListener 两次未回复关闭对话框");
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) { //上报路况
|
||||
// 免唤醒 --ok
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadRoadCondition();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 处理需要授权的命令 TODO
|
||||
*/
|
||||
public void handleNeedAuthorizeCmd() {
|
||||
Log.e(TAG, "handleNeedAuthorizeCmd mVoiceCmdType = " + mVoiceCmdType + " >>> " +
|
||||
"mVoiceCmdShareType = " + mVoiceCmdShareType);
|
||||
if (!TextUtils.isEmpty(mVoiceCmdType)) {
|
||||
if (mVoiceCmdType.equals(ExtensionsModuleConst.CANCLE_SHARE) || mVoiceCmdType.equals(ExtensionsModuleConst.CLOSE)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.SHARE_DIALOG_CLOSE) || mVoiceCmdType.equals(ExtensionsModuleConst.NO_REPLY_SHARE_DIALOG_CLOSE)) { //关闭分享弹框
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.GO_TO_SHARE)) { //打开分享弹框
|
||||
if (!TextUtils.isEmpty(mVoiceCmdShareType)) {
|
||||
if (mVoiceCmdShareType.equals("封路")) {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 封路 -------> ");
|
||||
uploadRoadClosed();
|
||||
} else if (mVoiceCmdShareType.equals("油价")) {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 油价 -------> ");
|
||||
shareOilPrice();
|
||||
} else if (mVoiceCmdShareType.equals("交通检查")) {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 交通检查 -------> ");
|
||||
uploadTrfficCheck();
|
||||
}
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().showShareDialog();
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 我要分享 ----> ");
|
||||
traceData("2");
|
||||
}
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK)) { //上报交通检查
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报交通检查 ----> ");
|
||||
uploadTrfficCheck();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE)) { //上报封路
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报封路 ----> ");
|
||||
uploadRoadClosed();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) {
|
||||
//上报拥堵, 分享路况, 上报路况
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报路况 ----> ");
|
||||
uploadRoadCondition();
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "handleNeedAuthorizeCmd mVoiceCmdType == null ");
|
||||
}
|
||||
}
|
||||
|
||||
private void uploadRoadCondition() {
|
||||
mStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
|
||||
traceTanluData("2");
|
||||
sendShareReceiver(REPORT_TANLU_BLOCK);
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 上报路况 ----> ");
|
||||
traceTypeData("1");
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
private void uploadTrfficCheck() {
|
||||
mStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
sendShareReceiver(REPORT_TANLU_TRAFFIC_CHECK);
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 分享交通检查 ----> ");
|
||||
traceTypeData("3");
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
private void uploadRoadClosed() {
|
||||
mStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
sendShareReceiver(REPORT_TANLU_CLOSURE);
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 分享封路 ----> ");
|
||||
traceTypeData("4");
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享/上报按钮点击 from=1 手动点击 from=2 语音打开
|
||||
*
|
||||
* @param from
|
||||
*/
|
||||
private void traceData(String from) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("from", from);
|
||||
mAnalytics.track(ExtensionsModuleConst.LAUNCHER_SHARE_CLICK, properties);
|
||||
}
|
||||
|
||||
private void shareOilPrice() {
|
||||
// Intent intent = new Intent();
|
||||
// intent.setData(Uri.parse("freshthing://com.zhidao.fresh.things/shareOilPrice"));
|
||||
// getContext().startActivity(intent);
|
||||
// traceTypeData("2");
|
||||
// ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送广播 上报路况
|
||||
*/
|
||||
private void sendShareReceiver(String type) {
|
||||
Logger.d("EntrancePresenter", "TanluCardViewFragment sendShareReceiver ---->");
|
||||
UploadHelper.INSTANCE.upload(getContext(),type);
|
||||
}
|
||||
|
||||
/**
|
||||
* type=1 路况
|
||||
* <p>
|
||||
* type=2 油价
|
||||
* <p>
|
||||
* type=3 交通检查
|
||||
* <p>
|
||||
* type=4 封路
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
private void traceTypeData(String type) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
mAnalytics.track(ExtensionsModuleConst.LAUNCHER_SHARE_TYPE, properties);
|
||||
}
|
||||
|
||||
private void traceTanluData(String type) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
mAnalytics.track(ExtensionsModuleConst.CARNET_USER_UPLOAD, properties);
|
||||
}
|
||||
|
||||
|
||||
public void unregisterUnWake() {
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.CANCLE_SHARE);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.CLOSE);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.module.extensions.net;
|
||||
|
||||
import com.mogo.module.authorize.model.BaseResponse;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -39,6 +39,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.tanluupload
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
@@ -213,16 +214,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
EventDispatchCenter.getInstance().onMarkerClicked( marker );
|
||||
if ( !mMogoStatusManager.isADASShow() ) {
|
||||
switch2Card( marker.getOwner(), false );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void switch2Card( String cardType, boolean lockCar ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@@ -242,7 +236,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if ( mMogoFragmentManager.getStackSize() == 0 ) {
|
||||
return;
|
||||
if(DebugConfig.isLauncher()) {
|
||||
return;
|
||||
}else{
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
if ( mMogoFragmentManager != null ) {
|
||||
mMogoFragmentManager.pop();
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.module.main.livedata.CardSwitchLiveData;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.zhidao.roadcondition.service.MainService;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -28,9 +29,6 @@ import java.util.Map;
|
||||
*/
|
||||
public class MainPresenter extends Presenter< MainView > {
|
||||
|
||||
// 埋点接口
|
||||
private IMogoAnalytics mAnalytics;
|
||||
|
||||
private Handler mMsgHandler = new Handler( Looper.getMainLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
@@ -57,13 +55,6 @@ public class MainPresenter extends Presenter< MainView > {
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
CardSwitchLiveData.getInstance().observeForever( cardInfo -> {
|
||||
if ( TextUtils.isEmpty( cardInfo.mCardName ) ) {
|
||||
return;
|
||||
}
|
||||
mView.switch2Card( cardInfo.mCardName, cardInfo.mLockCar );
|
||||
} );
|
||||
mAnalytics = ( IMogoAnalytics ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_ANALYTICS ).navigation( getContext() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,13 +11,6 @@ import com.mogo.service.IMogoServiceApis;
|
||||
*/
|
||||
public interface MainView extends IView {
|
||||
|
||||
/**
|
||||
* 切换卡片
|
||||
*
|
||||
* @param cardType
|
||||
*/
|
||||
void switch2Card( String cardType, boolean lockCar );
|
||||
|
||||
/**
|
||||
* 加载卡片
|
||||
*/
|
||||
|
||||
@@ -141,7 +141,6 @@ public class MediaCardViewFragment extends MvpFragment<MediaView, MediaPresenter
|
||||
private ImageView mWindowPlayNext;
|
||||
private MediaShareDialogFragment mShareDilogFragment;
|
||||
private MediaMogoVoiceListener mMediaVoiceListener;
|
||||
private LinearLayout mWindowMediaCenter;
|
||||
private TextView mWindowCurrTime;
|
||||
private TextView mWindowMaxTime;
|
||||
private NoScrollSeekBar mWindowProgress;
|
||||
@@ -626,7 +625,6 @@ public class MediaCardViewFragment extends MvpFragment<MediaView, MediaPresenter
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowMediaCenter = mWindowView.findViewById(R.id.window_media_center);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
@@ -637,7 +635,7 @@ public class MediaCardViewFragment extends MvpFragment<MediaView, MediaPresenter
|
||||
int xPos = getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
ServiceMediaHandler.getMogoWindowManager().addView( mWindowView, xPos, yPos, false);
|
||||
updateWindowUI(true);
|
||||
mWindowMediaCenter.setOnClickListener(new NoDoubleClickListener() {
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
|
||||
@@ -57,7 +57,6 @@ public class MediaWindow implements MediaView{
|
||||
private ScrollingTextView mScrollText;
|
||||
private ImageView mWindowPlayPause;
|
||||
private ImageView mWindowPlayNext;
|
||||
private LinearLayout mWindowMediaCenter;
|
||||
private TextView mWindowCurrTime;
|
||||
private TextView mWindowMaxTime;
|
||||
private NoScrollSeekBar mWindowProgress;
|
||||
@@ -112,7 +111,6 @@ public class MediaWindow implements MediaView{
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowMediaCenter = mWindowView.findViewById(R.id.window_media_center);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
@@ -123,7 +121,7 @@ public class MediaWindow implements MediaView{
|
||||
int xPos = getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
ServiceMediaHandler.getMogoWindowManager().addView( mWindowView, xPos, yPos, false);
|
||||
updateWindowUI(true);
|
||||
mWindowMediaCenter.setOnClickListener(new NoDoubleClickListener() {
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.mogo.module.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -20,6 +21,7 @@ import com.mogo.module.media.widget.AnimCircleImageView;
|
||||
import com.mogo.module.media.widget.NoScrollSeekBar;
|
||||
import com.mogo.module.media.widget.ScrollingTextView;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.tencent.wecarflow.flowoutside.sdk.FlowPlayControl;
|
||||
@@ -42,7 +44,6 @@ public class MediaWindow2 implements IMusicView {
|
||||
private ScrollingTextView mScrollText;
|
||||
private ImageView mWindowPlayPause;
|
||||
private ImageView mWindowPlayNext;
|
||||
private LinearLayout mWindowMediaCenter;
|
||||
private TextView mWindowCurrTime;
|
||||
private TextView mWindowMaxTime;
|
||||
private NoScrollSeekBar mWindowProgress;
|
||||
@@ -85,7 +86,6 @@ public class MediaWindow2 implements IMusicView {
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowMediaCenter = mWindowView.findViewById(R.id.window_media_center);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
@@ -96,9 +96,16 @@ public class MediaWindow2 implements IMusicView {
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location);
|
||||
int xPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, xPos, yPos, false);
|
||||
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
|
||||
Logger.d(TAG,
|
||||
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
|
||||
FrameLayout.LayoutParams params =
|
||||
new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height));
|
||||
params.leftMargin = xPos;
|
||||
params.topMargin = yPos;
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false);
|
||||
updateWindowUI(true);
|
||||
mWindowMediaCenter.setOnClickListener(new NoDoubleClickListener() {
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
openAqtApp();
|
||||
@@ -167,7 +174,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
if (mCircleImg != null) {
|
||||
com.bumptech.glide.request.RequestOptions options =
|
||||
new com.bumptech.glide.request.RequestOptions()
|
||||
.placeholder(R.drawable.module_media_share_default_icon);
|
||||
.placeholder(R.drawable.module_media_default_music_img);
|
||||
GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(mCircleImg);
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 459 B |
|
Before Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#42435A" />
|
||||
<corners android:bottomRightRadius="@dimen/module_media_window_corner" android:topRightRadius="@dimen/module_media_window_corner" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 644 B |
|
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 453 B |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 879 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 454 B |
|
After Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#42435A" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:angle="180"
|
||||
android:startColor="#5E6079"
|
||||
android:endColor="#3F4057"
|
||||
android:type="linear" />
|
||||
|
||||
|
After Width: | Height: | Size: 355 B |
|
After Width: | Height: | Size: 181 B |
@@ -1,87 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/module_media_pop_window_width"
|
||||
android:layout_height="@dimen/module_media_pop_window_height"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
tools:layout_marginLeft="@dimen/module_media_music_state_location_x"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginTop="@dimen/module_media_music_state_location"
|
||||
android:background="@drawable/module_media_window_alert_bg">
|
||||
<LinearLayout
|
||||
android:layout_width="@dimen/module_media_pop_window_width"
|
||||
android:layout_height="@dimen/module_media_pop_window_inner_height"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_media_pop_window_inner_padding"
|
||||
android:paddingRight="@dimen/module_media_pop_window_inner_padding">
|
||||
android:background="@drawable/module_media_window_alert_bg"
|
||||
tools:layout_marginLeft="@dimen/module_media_music_state_location_x">
|
||||
|
||||
<com.mogo.module.media.widget.AnimCircleImageView
|
||||
android:id="@+id/window_circle_img"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:src="@drawable/module_media_play"/>
|
||||
<com.mogo.module.media.widget.AnimCircleImageView
|
||||
android:id="@+id/window_circle_img"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:src="@drawable/module_media_default_music_img"
|
||||
android:layout_marginStart="@dimen/module_media_pop_window_inner_padding"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/window_media_center"
|
||||
android:layout_width="@dimen/module_media_pop_window_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_media_pop_window_text_margin"
|
||||
android:layout_marginRight="@dimen/module_media_pop_window_text_margin"
|
||||
android:orientation="vertical">
|
||||
<com.mogo.module.media.widget.ScrollingTextView
|
||||
android:id="@+id/window_scroll_txt"
|
||||
android:layout_width="@dimen/module_media_pop_window_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="is my life"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/module_media_pop_window_text_top_size"
|
||||
android:ellipsize="end"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"/>
|
||||
<com.mogo.module.media.widget.ScrollingTextView
|
||||
android:id="@+id/window_scroll_txt"
|
||||
android:layout_width="@dimen/module_media_pop_window_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:text="is my life"
|
||||
android:textColor="#ffffff"
|
||||
android:layout_marginStart="@dimen/module_media_pop_window_text_margin"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/window_current_time"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_circle_img"
|
||||
android:textSize="@dimen/module_media_pop_window_text_top_size" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/window_current_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size"
|
||||
android:textColor="#7aFFFFFF"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size"
|
||||
android:textColor="#7aFFFFFF"
|
||||
android:text="/"/>
|
||||
<TextView
|
||||
android:id="@+id/window_current_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#7aFFFFFF"
|
||||
tools:text="00:00"
|
||||
app:layout_constraintTop_toBottomOf="@+id/window_scroll_txt"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/window_scroll_txt"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size" />
|
||||
<TextView
|
||||
android:id="@+id/window_divide"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
android:textColor="#7aFFFFFF"
|
||||
app:layout_constraintTop_toTopOf="@+id/window_current_time"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_current_time"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/window_max_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size"
|
||||
android:textColor="#7aFFFFFF" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/window_max_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#7aFFFFFF"
|
||||
tools:text = "06:50"
|
||||
app:layout_constraintTop_toTopOf="@+id/window_divide"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_divide"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause"
|
||||
android:layout_width="@dimen/module_media_pop_window_control_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_control_img_size"
|
||||
android:layout_marginRight="@dimen/module_media_pop_window_control_margin_right"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/module_media_window_pop_play"/>
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_scroll_txt"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/window_music_next"
|
||||
android:background="@drawable/module_media_play_bg_selector"
|
||||
android:src="@drawable/module_media_window_pop_play" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_music_next"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_play_pause"
|
||||
android:background="@drawable/module_media_next_bg_selector"
|
||||
android:src="@drawable/module_media_next_song" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_music_next"
|
||||
android:layout_width="@dimen/module_media_pop_window_control_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_control_img_size"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/module_media_next_song"/>
|
||||
</LinearLayout>
|
||||
<com.mogo.module.media.widget.NoScrollSeekBar
|
||||
android:id="@+id/window_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
@@ -89,13 +99,14 @@
|
||||
android:layout_marginLeft="@dimen/module_media_pop_window_radius_margin"
|
||||
android:layout_marginRight="@dimen/module_media_pop_window_radius_margin"
|
||||
android:max="100"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/module_media_window_progress_bar"
|
||||
android:splitTrack="false"
|
||||
android:thumbOffset="0dp"
|
||||
android:thumb="@drawable/module_media_progress_pop_bg"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"/>
|
||||
</LinearLayout>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:thumbOffset="0dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#008577</color>
|
||||
<color name="colorPrimaryDark">#00574B</color>
|
||||
<color name="colorAccent">#D81B60</color>
|
||||
</resources>
|
||||
@@ -1,123 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_media_music_state_location">483px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">573px</dimen>
|
||||
|
||||
<!-- lcc start-->
|
||||
<dimen name="module_media_back_width">352px</dimen>
|
||||
<dimen name="module_media_back_height">352px</dimen>
|
||||
<dimen name="module_media_back_radius">10.67px</dimen>
|
||||
<dimen name="module_media_share_full_screen_back_top">12px</dimen>
|
||||
<dimen name="module_media_share_share_icon_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_height">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_pading">5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_margin_left_right">12px</dimen>
|
||||
<dimen name="module_media_share_back_top">62px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_left_right">16px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_height">78px</dimen>
|
||||
<dimen name="module_media_share_user_back_radius">10.6px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_left">16px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_width">48px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_height">48px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_left">11px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_right">12px</dimen>
|
||||
<dimen name="module_media_share_user_from_size">12px</dimen>
|
||||
<dimen name="module_media_share_user_name_size">14px</dimen>
|
||||
<dimen name="module_media_share_user_of_share_size">16px</dimen>
|
||||
<dimen name="module_media_share_user_like_back_margin_right">8px</dimen>
|
||||
<dimen name="module_media_share_user_like_width">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_height">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_size">12px</dimen>
|
||||
<dimen name="module_media_share_media_back_top">18px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_left">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_right">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_height">67.2px</dimen>
|
||||
<dimen name="module_media_share_media_image_radius">3px</dimen>
|
||||
<dimen name="module_media_share_media_image_height">62px</dimen>
|
||||
<dimen name="module_media_share_media_image_width">62px</dimen>
|
||||
<dimen name="module_media_share_media_name_back_left">12px</dimen>
|
||||
<dimen name="module_media_share_media_song_name_size">20px</dimen>
|
||||
<dimen name="module_media_share_media_singer_name_size">15px</dimen>
|
||||
<!-- lcc end-->
|
||||
|
||||
<!-- lidongxiu start-->
|
||||
<dimen name="module_media_share_fragment_width">421px</dimen>
|
||||
<dimen name="module_media_share_fragment_height">280px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_top">28px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_left">32.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_bg_radius">11.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_size">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_right">10.7px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_height">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding">10px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv1_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv2_size">16px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_text_size">18px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_top">32px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_bottom">51px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_height">68px</dimen>
|
||||
<dimen name="module_media_share_fragment_tv2_margin_top">2px</dimen>
|
||||
<dimen name="module_media_share_fragment_img_radius">3.2px</dimen>
|
||||
|
||||
<dimen name="module_media_pop_window_width">322px</dimen>
|
||||
<dimen name="module_media_pop_window_height">66.7px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">60px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">12px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">48px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">123px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">13px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">18px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">14px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">30px</dimen>
|
||||
<dimen name="module_media_pop_window_control_margin_right">21px</dimen>
|
||||
<dimen name="module_media_pop_window_progress_height">4px</dimen>
|
||||
<dimen name="module_media_pop_window_radius">8px</dimen>
|
||||
<dimen name="module_media_pop_window_radius_margin">7px</dimen>
|
||||
|
||||
<dimen name="module_media_toast_share_width">267px</dimen>
|
||||
<dimen name="module_media_toast_share_height">187px</dimen>
|
||||
<dimen name="module_media_toast_share_bg_radius">10px</dimen>
|
||||
<dimen name="module_media_toast_share_img_size">64px</dimen>
|
||||
<dimen name="module_media_toast_share_text_size">18px</dimen>
|
||||
<dimen name="module_media_toast_share_margin_top">11px</dimen>
|
||||
|
||||
<dimen name="module_media_card_width">352px</dimen>
|
||||
<dimen name="module_media_card_height">352px</dimen>
|
||||
<dimen name="module_media_card_radius">10.5px</dimen>
|
||||
<dimen name="module_media_card_radius_blur">11px</dimen>
|
||||
<dimen name="module_media_card_share_full_margin_top">11.5px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_width">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_height">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_width">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_height">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_size">20px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_size">15px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_margin">4px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_margin">2px</dimen>
|
||||
<dimen name="module_media_card_progress_height">6px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_size">12px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_left">11px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_bottom">4px</dimen>
|
||||
<dimen name="module_media_card_control_icon_margin_bottom">1px</dimen>
|
||||
|
||||
<dimen name="module_media_card_control_icon_left_padding">8px</dimen>
|
||||
<dimen name="module_media_card_control_icon_size">44px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_size">62px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_margin">28px</dimen>
|
||||
<dimen name="module_media_card_progress_margin">1px</dimen>
|
||||
<dimen name="module_media_card_no_share_title_margin">35px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_width">3.2px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_height">6.4px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_width">3px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_height">4px</dimen>
|
||||
<dimen name="module_media_card_share_user_text_width_max">96px</dimen>
|
||||
|
||||
<dimen name="module_media_draw_rect_map_bottom">32px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_left">400px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_right">80px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_top">150px</dimen>
|
||||
<dimen name="module_media_window_corner">16px</dimen>
|
||||
<!-- lidongxiu end-->
|
||||
</resources>
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-media</string>
|
||||
</resources>
|
||||
@@ -1,11 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -64,10 +64,10 @@
|
||||
<dimen name="module_media_pop_window_width">580px</dimen>
|
||||
<dimen name="module_media_pop_window_height">120px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">112px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">20px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">30px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">90px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">230px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">20px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">14px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">35px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">24px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">56px</dimen>
|
||||
|
||||
@@ -1,123 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_media_music_state_location">881px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">1067px</dimen>
|
||||
<dimen name="module_media_music_state_location">470px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">573px</dimen>
|
||||
|
||||
<!-- lcc start-->
|
||||
<dimen name="module_media_back_width">660px</dimen>
|
||||
<dimen name="module_media_back_height">660px</dimen>
|
||||
<dimen name="module_media_back_radius">20px</dimen>
|
||||
<dimen name="module_media_share_full_screen_back_top">23px</dimen>
|
||||
<dimen name="module_media_share_share_icon_width">67.5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_width">67.5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_height">67.5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_pading">10px</dimen>
|
||||
<dimen name="module_media_share_full_screen_margin_left_right">23px</dimen>
|
||||
<dimen name="module_media_share_back_top">116px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_left_right">30px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_height">145px</dimen>
|
||||
<dimen name="module_media_share_user_back_radius">20px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_left">30px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_width">90px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_height">90px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_left">21px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_right">24px</dimen>
|
||||
<dimen name="module_media_share_user_from_size">23px</dimen>
|
||||
<dimen name="module_media_share_user_name_size">26px</dimen>
|
||||
<dimen name="module_media_share_user_of_share_size">30px</dimen>
|
||||
<dimen name="module_media_share_user_like_back_margin_right">16px</dimen>
|
||||
<dimen name="module_media_share_user_like_width">68px</dimen>
|
||||
<dimen name="module_media_share_user_like_height">68px</dimen>
|
||||
<dimen name="module_media_share_user_like_size">23px</dimen>
|
||||
<dimen name="module_media_share_media_back_top">35px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_left">56px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_right">56px</dimen>
|
||||
<dimen name="module_media_share_media_back_height">126px</dimen>
|
||||
<dimen name="module_media_back_width">352px</dimen>
|
||||
<dimen name="module_media_back_height">352px</dimen>
|
||||
<dimen name="module_media_back_radius">10.67px</dimen>
|
||||
<dimen name="module_media_share_full_screen_back_top">12px</dimen>
|
||||
<dimen name="module_media_share_share_icon_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_height">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_pading">5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_margin_left_right">12px</dimen>
|
||||
<dimen name="module_media_share_back_top">62px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_left_right">16px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_height">78px</dimen>
|
||||
<dimen name="module_media_share_user_back_radius">10.6px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_left">16px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_width">48px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_height">48px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_left">11px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_right">12px</dimen>
|
||||
<dimen name="module_media_share_user_from_size">12px</dimen>
|
||||
<dimen name="module_media_share_user_name_size">14px</dimen>
|
||||
<dimen name="module_media_share_user_of_share_size">16px</dimen>
|
||||
<dimen name="module_media_share_user_like_back_margin_right">8px</dimen>
|
||||
<dimen name="module_media_share_user_like_width">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_height">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_size">12px</dimen>
|
||||
<dimen name="module_media_share_media_back_top">18px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_left">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_right">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_height">67.2px</dimen>
|
||||
<dimen name="module_media_share_media_image_radius">3px</dimen>
|
||||
<dimen name="module_media_share_media_image_height">116px</dimen>
|
||||
<dimen name="module_media_share_media_image_width">116px</dimen>
|
||||
<dimen name="module_media_share_media_name_back_left">22px</dimen>
|
||||
<dimen name="module_media_share_media_song_name_size">37.5px</dimen>
|
||||
<dimen name="module_media_share_media_singer_name_size">28px</dimen>
|
||||
<dimen name="module_media_share_media_image_height">62px</dimen>
|
||||
<dimen name="module_media_share_media_image_width">62px</dimen>
|
||||
<dimen name="module_media_share_media_name_back_left">12px</dimen>
|
||||
<dimen name="module_media_share_media_song_name_size">20px</dimen>
|
||||
<dimen name="module_media_share_media_singer_name_size">15px</dimen>
|
||||
<!-- lcc end-->
|
||||
|
||||
<!-- lidongxiu start-->
|
||||
<dimen name="module_media_share_fragment_width">790px</dimen>
|
||||
<dimen name="module_media_share_fragment_height">525px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_top">55px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_left">61px</dimen>
|
||||
<dimen name="module_media_share_fragment_bg_radius">20px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_size">136px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_right">20px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_height">136px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding">34px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv1_size">40px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv2_size">30px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_text_size">34px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_size">40px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_top">60px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_bottom">96px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_height">130px</dimen>
|
||||
<dimen name="module_media_share_fragment_tv2_margin_top">4px</dimen>
|
||||
<dimen name="module_media_share_fragment_img_radius">6px</dimen>
|
||||
<dimen name="module_media_share_fragment_width">421px</dimen>
|
||||
<dimen name="module_media_share_fragment_height">280px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_top">28px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_left">32.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_bg_radius">11.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_size">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_right">10.7px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_height">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding">10px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv1_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv2_size">16px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_text_size">18px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_top">32px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_bottom">51px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_height">68px</dimen>
|
||||
<dimen name="module_media_share_fragment_tv2_margin_top">2px</dimen>
|
||||
<dimen name="module_media_share_fragment_img_radius">3.2px</dimen>
|
||||
|
||||
<dimen name="module_media_pop_window_width">580px</dimen>
|
||||
<dimen name="module_media_pop_window_height">120px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">112px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">20px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">90px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">230px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">20px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">35px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">24px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">56px</dimen>
|
||||
<dimen name="module_media_pop_window_control_margin_right">40px</dimen>
|
||||
<dimen name="module_media_pop_window_progress_height">8px</dimen>
|
||||
<dimen name="module_media_pop_window_radius">16px</dimen>
|
||||
<dimen name="module_media_pop_window_radius_margin">16px</dimen>
|
||||
<dimen name="module_media_toast_share_width">500px</dimen>
|
||||
<dimen name="module_media_toast_share_height">350px</dimen>
|
||||
<dimen name="module_media_toast_share_bg_radius">20px</dimen>
|
||||
<dimen name="module_media_toast_share_img_size">120px</dimen>
|
||||
<dimen name="module_media_toast_share_text_size">36px</dimen>
|
||||
<dimen name="module_media_toast_share_margin_top">20px</dimen>
|
||||
<dimen name="module_media_pop_window_width">322px</dimen>
|
||||
<dimen name="module_media_pop_window_height">66.7px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">60px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">18px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">48px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">123px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">10px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">18px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">14px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">30px</dimen>
|
||||
<dimen name="module_media_pop_window_control_margin_right">21px</dimen>
|
||||
<dimen name="module_media_pop_window_progress_height">4px</dimen>
|
||||
<dimen name="module_media_pop_window_radius">8px</dimen>
|
||||
<dimen name="module_media_pop_window_radius_margin">7px</dimen>
|
||||
|
||||
<dimen name="module_media_card_width">660px</dimen>
|
||||
<dimen name="module_media_card_height">660px</dimen>
|
||||
<dimen name="module_media_card_radius">20px</dimen>
|
||||
<dimen name="module_media_card_radius_blur">22px</dimen>
|
||||
<dimen name="module_media_card_share_full_margin_top">22px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_width">348px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_height">348px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_width">226px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_height">226px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_size">36px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_size">28px</dimen>
|
||||
<dimen name="module_media_toast_share_width">267px</dimen>
|
||||
<dimen name="module_media_toast_share_height">187px</dimen>
|
||||
<dimen name="module_media_toast_share_bg_radius">10px</dimen>
|
||||
<dimen name="module_media_toast_share_img_size">64px</dimen>
|
||||
<dimen name="module_media_toast_share_text_size">18px</dimen>
|
||||
<dimen name="module_media_toast_share_margin_top">11px</dimen>
|
||||
|
||||
<dimen name="module_media_card_width">352px</dimen>
|
||||
<dimen name="module_media_card_height">352px</dimen>
|
||||
<dimen name="module_media_card_radius">10.5px</dimen>
|
||||
<dimen name="module_media_card_radius_blur">11px</dimen>
|
||||
<dimen name="module_media_card_share_full_margin_top">11.5px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_width">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_height">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_width">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_height">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_size">20px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_size">15px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_margin">4px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_margin">2px</dimen>
|
||||
<dimen name="module_media_card_progress_height">11px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_size">22px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_left">21px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_right">4px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_bottom">6px</dimen>
|
||||
<dimen name="module_media_card_control_icon_margin_bottom">2px</dimen>
|
||||
<dimen name="module_media_card_progress_height">6px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_size">12px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_left">11px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_bottom">4px</dimen>
|
||||
<dimen name="module_media_card_control_icon_margin_bottom">1px</dimen>
|
||||
|
||||
<dimen name="module_media_card_control_icon_left_padding">15px</dimen>
|
||||
<dimen name="module_media_card_control_icon_size">78px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_size">107px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_margin">53px</dimen>
|
||||
<dimen name="module_media_card_progress_margin">2px</dimen>
|
||||
<dimen name="module_media_card_no_share_title_margin">64px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_width">6px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_height">12px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_width">6px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_height">8px</dimen>
|
||||
<dimen name="module_media_card_share_user_text_width_max">180px</dimen>
|
||||
<dimen name="module_media_card_control_icon_left_padding">8px</dimen>
|
||||
<dimen name="module_media_card_control_icon_size">44px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_size">62px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_margin">28px</dimen>
|
||||
<dimen name="module_media_card_progress_margin">1px</dimen>
|
||||
<dimen name="module_media_card_no_share_title_margin">35px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_width">3.2px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_height">6.4px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_width">3px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_height">4px</dimen>
|
||||
<dimen name="module_media_card_share_user_text_width_max">96px</dimen>
|
||||
|
||||
<dimen name="module_media_draw_rect_map_bottom">60px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_left">750px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_right">120px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_top">270px</dimen>
|
||||
<dimen name="module_media_window_corner">30px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_bottom">32px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_left">400px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_right">80px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_top">150px</dimen>
|
||||
<dimen name="module_media_window_corner">16px</dimen>
|
||||
<!-- lidongxiu end-->
|
||||
</resources>
|
||||
@@ -46,10 +46,12 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
} else {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-authorize')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,5 @@
|
||||
package="com.mogo.module.share" >
|
||||
<application>
|
||||
<service android:name=".VoiceCmdService" />
|
||||
<receiver android:name=".ShareVoiceCmdReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.zhidao.speech.awake.notify" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -1,31 +1,108 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.share.bean.StepAfterAuth;
|
||||
import com.mogo.module.share.bean.StepAfterAuthKt;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.module.share.manager.UploadHelper;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_SEEK_HELP;
|
||||
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_SHOW_DIALOG;
|
||||
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_UPLOAD;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_CANCEL_SHARE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_ROAD_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_UPLOAD_ACCIDENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_UPLOAD_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_ACCIDENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_DENSE_FOG;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_ROAD_CONSTRUCTION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_ROAD_ICY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_STAGNANT_WATER;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_CANCEL_SHARE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ACCIDENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_DENSE_FOG;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_CONDITION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_CONSTRUCTION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_ICY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_SEEK_HELP;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_STAGNANT_WATER;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_DENSE_FOG;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_ROAD_CONSTRUCTION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_ROAD_ICY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_SEEK_HELP;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_STAGNANT_WATER;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_GO_TO_SHARE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_PUB_ROAD_CONDITION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_PUB_TROUBLE_HELP;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_SHARE_DIALOG_CLOSE;
|
||||
|
||||
/**
|
||||
* 分享框的逻辑都放到这里吧
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @description 分享弹框接口
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_SHARE)
|
||||
public class ShareControl implements IMogoShareManager {
|
||||
public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMogoVoiceCmdCallBack {
|
||||
private static final String TAG = "ShareControl";
|
||||
|
||||
private Context mContext;
|
||||
private LaucherShareDialog mShareDialog;
|
||||
|
||||
private IMogoAuthorizeModuleManager authorizeModuleManager;
|
||||
private IMogoIntentManager intentManager;
|
||||
|
||||
@Override
|
||||
public void showShareDialog() {
|
||||
mShareDialog = new LaucherShareDialog(mContext);
|
||||
mShareDialog.show();
|
||||
if (authorizeModuleManager.needAuthorize(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
authorizeModuleManager.invokeAuthorization(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
realShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,9 +112,366 @@ public class ShareControl implements IMogoShareManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void realShowDialog() {
|
||||
if (mShareDialog == null) {
|
||||
mShareDialog = new LaucherShareDialog(mContext);
|
||||
}
|
||||
mShareDialog.show();
|
||||
}
|
||||
|
||||
private StepAfterAuth stepAfterAuth = new StepAfterAuth(-1, "");
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG,"start init====");
|
||||
mContext = context;
|
||||
ServiceApisManager.INSTANCE.init(context);
|
||||
authorizeModuleManager =
|
||||
(IMogoAuthorizeModuleManager) ARouter.getInstance().build(AuthorizeConstant.PROVIDER_MODULE).navigation(context);
|
||||
authorizeModuleManager.registerAuthorizeListener(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE, new IMogoAcquireAuthorizeListener() {
|
||||
@Override
|
||||
public void authorizeSuccess() {
|
||||
switch (stepAfterAuth.getType()) {
|
||||
case STEP_AFTER_AUTH_TYPE_SHOW_DIALOG:
|
||||
realShowDialog();
|
||||
break;
|
||||
case STEP_AFTER_AUTH_TYPE_UPLOAD:
|
||||
UploadHelper.INSTANCE.upload(mContext, stepAfterAuth.getUploadType());
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case STEP_AFTER_AUTH_TYPE_SEEK_HELP:
|
||||
seekHelp();
|
||||
dismissShareDialog();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorizeFailed(@NotNull String errorMsg) {
|
||||
TipToast.tip("未授权,无法分享");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forbiddenVoiceWhenAuthorize(@NotNull String cmd) {
|
||||
TipToast.tip("未授权,无法分享");
|
||||
}
|
||||
});
|
||||
intentManager = ServiceApisManager.serviceApis.getIntentManagerApi();
|
||||
intentManager.registerIntentListener(VOICE_CMD_GO_TO_SHARE, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_PUB_TROUBLE_HELP, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_PUB_ROAD_CONDITION, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(UNWAKE_UPLOAD_ROAD_CONDITION, this);
|
||||
|
||||
// 免唤醒词注册
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_BLOCK,
|
||||
CMD_UPLOAD_BLOCK, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_TRAFFIC_CHECK,
|
||||
CMD_TRAFFIC_CHECK, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_CLOSURE,
|
||||
CMD_ROAD_CLOSURE, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_CANCEL_SHARE,
|
||||
CMD_CANCEL_SHARE, this);
|
||||
if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ) {
|
||||
// 使用同行者语义你的话,增加如下免唤醒词
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ACCIDENT,
|
||||
CMD_UPLOAD_ACCIDENT, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
UPLOAD_REAL_TIME_TRAFFIC, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_SEEK_HELP,
|
||||
UPLOAD_SEEK_HELP, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_STAGNANT_WATER,
|
||||
UPLOAD_STAGNANT_WATER, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_ICY,
|
||||
UPLOAD_ROAD_ICY, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_DENSE_FOG,
|
||||
UPLOAD_DENSE_FOG, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_CONSTRUCTION,
|
||||
UPLOAD_ROAD_CONSTRUCTION, this);
|
||||
}
|
||||
|
||||
Logger.d(TAG,"init over====");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
switch (cmd) {
|
||||
case UNWAKE_CANCEL_SHARE:
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_BLOCK:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_BLOCK);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_BLOCK);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_TRAFFIC_CHECK:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_TRAFFIC_CHECK);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_TRAFFIC_CHECK);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_CLOSURE:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_CLOSURE);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_CLOSURE);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ACCIDENT:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ACCIDENT);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ACCIDENT);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_REAL_TIME_TRAFFIC:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_REAL_TIME_TRAFFIC);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_REAL_TIME_TRAFFIC);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_SEEK_HELP:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_SEEK_HELP, TYPE_BLOCK);
|
||||
} else {
|
||||
seekHelp();
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_STAGNANT_WATER:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_STAGNANT_WATER);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_STAGNANT_WATER);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_ICY:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_ICY);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_ICY);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_DENSE_FOG:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_DENSE_FOG);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_DENSE_FOG);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_CONSTRUCTION:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_CONSTRUCTION);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_CONSTRUCTION);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
// 此处只接受处理语音相关广播
|
||||
Logger.d(TAG, "收到唤醒词指令: " + intentStr);
|
||||
try {
|
||||
switch (intentStr) {
|
||||
case VOICE_CMD_PUB_TROUBLE_HELP:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_SEEK_HELP, TYPE_DENSE_FOG);
|
||||
} else {
|
||||
// 开启服务,准备上报求助
|
||||
seekHelp();
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case VOICE_CMD_GO_TO_SHARE:
|
||||
String ob =
|
||||
new JSONObject(intent.getStringExtra("data")).opt("ob").toString();
|
||||
Logger.d(TAG, "ob: " + ob);
|
||||
switch (ob) {
|
||||
case "积水":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_STAGNANT_WATER);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_STAGNANT_WATER);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "积冰":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_ICY);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_ICY);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "雾":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_DENSE_FOG);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_DENSE_FOG);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "交通事故":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ACCIDENT);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ACCIDENT);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "施工":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_CONSTRUCTION);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_CONSTRUCTION);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "封路":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_CLOSURE);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_CLOSURE);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "交通检查":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_TRAFFIC_CHECK);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_TRAFFIC_CHECK);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// showShareDialog();
|
||||
break;
|
||||
}
|
||||
case VOICE_CMD_PUB_ROAD_CONDITION:
|
||||
String obCondition =
|
||||
new JSONObject(intent.getStringExtra("data")).opt("obj").toString();
|
||||
Logger.d(TAG, "ob:" + obCondition);
|
||||
switch (obCondition) {
|
||||
case "路况":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_REAL_TIME_TRAFFIC);
|
||||
} else {
|
||||
Logger.d(TAG, "分享框准备触发上报实时路况");
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_REAL_TIME_TRAFFIC);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "拥堵":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_BLOCK);
|
||||
} else {
|
||||
Logger.d(TAG, "分享框准备触发上报拥堵");
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_BLOCK);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case VOICE_CMD_SHARE_DIALOG_CLOSE:
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE:
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_CONDITION:
|
||||
Logger.d(TAG, "免唤醒准备触发上报拥堵");
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_BLOCK);
|
||||
dismissShareDialog();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "ShareControl exception");
|
||||
}
|
||||
}
|
||||
|
||||
private void seekHelp() {
|
||||
Intent seekHelp = new Intent(mContext, VoiceCmdService.class);
|
||||
seekHelp.putExtra(ShareConstants.VOICE_CMD_SERVICE_EVENT_KEY,
|
||||
ShareConstants.VOICE_CMD_SERVICE_SEEK_HELP);
|
||||
mContext.startService(seekHelp);
|
||||
}
|
||||
|
||||
private boolean needAuth() {
|
||||
return authorizeModuleManager.needAuthorize(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
}
|
||||
|
||||
private void goAuth(int type, String uploadType) {
|
||||
stepAfterAuth.setType(type);
|
||||
stepAfterAuth.setUploadType(uploadType);
|
||||
authorizeModuleManager.invokeAuthorization(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "ShareControl";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.mogo.module.share
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.module.share.constant.ShareConstants
|
||||
import com.mogo.module.share.constant.ShareConstants.*
|
||||
import com.mogo.module.share.manager.ServiceApisManager
|
||||
import com.mogo.module.share.manager.UploadHelper
|
||||
import com.mogo.utils.logger.Logger
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
* 用于接收唤醒词指令,现在只接收 com.zhidao.speech.awake.notify 这一条广播
|
||||
*/
|
||||
class ShareVoiceCmdReceiver : BroadcastReceiver() {
|
||||
private val TAG = "ShareVoiceCmdReceiver"
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
// 接收唤醒词指令
|
||||
val command = intent.getStringExtra("command")?:""
|
||||
Logger.d(TAG, "收到唤醒词指令: $command")
|
||||
when (command) {
|
||||
VOICE_CMD_PUB_TROUBLE_HELP -> {
|
||||
// 开启服务,准备上报求助
|
||||
val seekHelp = Intent(context, VoiceCmdService::class.java)
|
||||
seekHelp.putExtra(ShareConstants.VOICE_CMD_SERVICE_EVENT_KEY, ShareConstants.VOICE_CMD_SERVICE_SEEK_HELP)
|
||||
context.startService(seekHelp)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
VOICE_CMD_GO_TO_SHARE ->{
|
||||
val ob = JSONObject(intent.getStringExtra("data") ?: "").opt("ob")
|
||||
Logger.d(TAG, "ob: $ob")
|
||||
when (ob) {
|
||||
"积水"->{
|
||||
UploadHelper.upload(context, TYPE_STAGNANT_WATER)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"积冰"->{
|
||||
UploadHelper.upload(context, TYPE_ROAD_ICY)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"雾"->{
|
||||
UploadHelper.upload(context, TYPE_DENSE_FOG)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"交通事故"->{
|
||||
UploadHelper.upload(context, TYPE_ACCIDENT)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"施工"->{
|
||||
UploadHelper.upload(context, TYPE_ROAD_CONSTRUCTION)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
VOICE_CMD_PUB_ROAD_CONDITION->{
|
||||
val ob = JSONObject(intent.getStringExtra("data") ?: "").opt("obj")
|
||||
Logger.d(TAG, "ob: $ob")
|
||||
if(ob == "路况") {
|
||||
// 上报实时路况
|
||||
Logger.d(TAG, "分享框准备触发上报实时路况")
|
||||
UploadHelper.upload(context, TYPE_REAL_TIME_TRAFFIC)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.share.bean
|
||||
|
||||
/**
|
||||
* 授权完成后,下一步要做的事情
|
||||
*/
|
||||
class StepAfterAuth(var type:Int,var uploadType:String)
|
||||
|
||||
const val STEP_AFTER_AUTH_TYPE_SHOW_DIALOG = 1
|
||||
const val STEP_AFTER_AUTH_TYPE_UPLOAD = 2
|
||||
const val STEP_AFTER_AUTH_TYPE_SEEK_HELP = 3
|
||||
@@ -8,24 +8,80 @@ package com.mogo.module.share.constant;
|
||||
*/
|
||||
public class ShareConstants {
|
||||
|
||||
//埋点数据
|
||||
//分享分类
|
||||
/**
|
||||
* 分享分类
|
||||
*/
|
||||
public static final String LAUNCHER_SHARE_TYPE = "Launcher_Share_type";
|
||||
//分享/上报按钮点击
|
||||
/**
|
||||
* 分享/上报按钮点击
|
||||
*/
|
||||
public static final String LAUNCHER_SHARE_CLICK = "Launcher_Share_Click";
|
||||
//
|
||||
public static final String CARNET_USER_UPLOAD = "CarNet_user_upload";
|
||||
|
||||
public static final String VOICE_CMD_SERVICE_EVENT_KEY = "type";
|
||||
public static final int VOICE_CMD_SERVICE_SEEK_HELP = 1;
|
||||
|
||||
// 此处只记录了事故、实时路况、道路积水、道路结冰、浓雾,至于拥堵、交通检查和封路是在extention模块里面管理
|
||||
public static final String VOICE_CMD_PUB_TROUBLE_HELP = "com.zhidao.auxiliaryDriving.pubTroubleHelp";
|
||||
|
||||
public static final String VOICE_CMD_PUB_TROUBLE_HELP = "com.zhidao.auxiliaryDriving" +
|
||||
".pubTroubleHelp";
|
||||
public static final String VOICE_CMD_GO_TO_SHARE = "com.zhidao.share";
|
||||
|
||||
/**
|
||||
* 免唤醒词上报拥堵
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
|
||||
|
||||
/**
|
||||
* 关闭分享框 唤醒
|
||||
*/
|
||||
public static final String VOICE_CMD_SHARE_DIALOG_CLOSE = "com.zhidao.share.close";
|
||||
/**
|
||||
* 两次未回复关闭分享对话框
|
||||
*/
|
||||
public static final String VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE = "com.zhidao.share.dialog" +
|
||||
".close";
|
||||
|
||||
/**
|
||||
* 免唤醒上报拥堵
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_BLOCK = "command_upload_block";
|
||||
/**
|
||||
* 免唤醒上报交通检查
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_TRAFFIC_CHECK = "command_upload_traffic_check";
|
||||
/**
|
||||
* 免唤醒上报封路
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CLOSURE = "command_upload_road_closure";
|
||||
|
||||
public static final String UNWAKE_UPLOAD_ACCIDENT = "command_upload_accident";
|
||||
public static final String UNWAKE_UPLOAD_REAL_TIME_TRAFFIC = "command_upload_real_time_traffic";
|
||||
public static final String UNWAKE_UPLOAD_SEEK_HELP = "command_upload_seek_help";
|
||||
public static final String UNWAKE_UPLOAD_STAGNANT_WATER = "command_upload_stagnant_water";
|
||||
public static final String UNWAKE_UPLOAD_ROAD_ICY = "command_upload_road_icy";
|
||||
public static final String UNWAKE_UPLOAD_DENSE_FOG = "command_upload_dense_fog";
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CONSTRUCTION = "command_upload_road_construction";
|
||||
|
||||
public static final String[] CMD_UPLOAD_BLOCK = {"上报拥堵"};
|
||||
public static final String[] CMD_TRAFFIC_CHECK = {"上报交通检查"};
|
||||
public static final String[] CMD_ROAD_CLOSURE = {"上报封路"};
|
||||
public static final String[] CMD_UPLOAD_ACCIDENT = {"上报事故", "上报交通事故"};
|
||||
public static final String[] UPLOAD_REAL_TIME_TRAFFIC = {"上报实时路况", "上报路况"};
|
||||
public static final String[] UPLOAD_SEEK_HELP = {"故障求助","发起故障求助"};
|
||||
public static final String[] UPLOAD_STAGNANT_WATER = {"上报积水"};
|
||||
public static final String[] UPLOAD_ROAD_ICY = {"上报积冰","上报道路积冰","上报结冰","上报道路结冰"};
|
||||
public static final String[] UPLOAD_DENSE_FOG = {"上报大雾", "上报浓雾"};
|
||||
public static final String[] UPLOAD_ROAD_CONSTRUCTION = {"上报施工", "上报道路施工"};
|
||||
|
||||
public static final String[] CMD_CANCEL_SHARE = {"取消分享"};
|
||||
public static final String UNWAKE_CANCEL_SHARE = "com.zhidao.launcher.cancle.share";
|
||||
|
||||
/**
|
||||
* 这个是实时路况,不是拥堵,拥堵放在了extention模块里面处理
|
||||
*/
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report.roadCondition";
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report" +
|
||||
".roadCondition";
|
||||
|
||||
public static final String TYPE_BLOCK = "10007";
|
||||
public static final String TYPE_TRAFFIC_CHECK = "10002";
|
||||
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 765 B |
|
After Width: | Height: | Size: 767 B |
@@ -25,8 +25,8 @@
|
||||
android:layout_marginTop="@dimen/share_module_title_margin_top"
|
||||
android:text="我要分享"
|
||||
android:textColor="@color/white"
|
||||
android:drawableLeft="@drawable/module_share_title_icon"
|
||||
android:drawableRight="@drawable/module_share_title_icon"
|
||||
android:drawableLeft="@drawable/module_share_title_icon_left"
|
||||
android:drawableRight="@drawable/module_share_title_icon_right"
|
||||
android:drawablePadding="@dimen/dp_40"
|
||||
android:textSize="@dimen/share_module_title_content"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.service.share;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* 分享框管理接口
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoShareManager extends IProvider {
|
||||
public interface IMogoShareManager extends IMogoModuleProvider {
|
||||
/**
|
||||
* 显示分享框
|
||||
*/
|
||||
|
||||
@@ -168,7 +168,9 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
|
||||
@Override
|
||||
public void setMainPageResumeStatus( String tag, boolean resume ) {
|
||||
final long start = System.currentTimeMillis();
|
||||
doSetStatus( tag, StatusDescriptor.MAIN_PAGE_RESUME, resume );
|
||||
Logger.i( TAG, "setMainPageResumeStatus " + resume + " cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -191,7 +193,7 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
doSetStatus( tag, StatusDescriptor.UPLOADING, uploading );
|
||||
}
|
||||
|
||||
private void doSetStatus(String tag, StatusDescriptor target, boolean value){
|
||||
private void doSetStatus( String tag, StatusDescriptor target, boolean value ) {
|
||||
mStatus.put( target, value );
|
||||
invokeStatusChangedListener( target, value );
|
||||
recordStatusModifier( tag, target );
|
||||
|
||||