Merge branch 'dev_1.1' into dev_1.1.2
# Conflicts: # gradle.properties
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -25,7 +25,7 @@ android {
|
||||
externalNativeBuild {
|
||||
ndk {
|
||||
// 设置支持的SO库架构
|
||||
abiFilters "armeabi", "armeabi-v7a"
|
||||
abiFilters "armeabi-v7a"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,7 @@ android {
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
|
||||
// 是否作为 launcher 运行
|
||||
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
|
||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||
}
|
||||
// launcher app
|
||||
launcher{
|
||||
@@ -98,6 +99,7 @@ android {
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
|
||||
// 是否作为 launcher 运行
|
||||
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
|
||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||
}
|
||||
// f系列-分体机全系列,未细分
|
||||
f8xx{
|
||||
|
||||
29
app/proguard-rules.pro
vendored
@@ -177,30 +177,34 @@
|
||||
-keep @kotlin.Metadata class *
|
||||
-keepclasseswithmembers @kotlin.Metadata class * { *; }
|
||||
|
||||
-dontwarn android.telephony.TelephonyManager.**
|
||||
-keep class android.telephony.TelephonyManager.**{*;}
|
||||
|
||||
#----------------------------------------第三方库----------------------------------------------
|
||||
#-----高德地图-----
|
||||
|
||||
#内置语音 V5.6.0之后
|
||||
-keep class com.alibaba.idst.nls.**{*;}
|
||||
-keep class com.google.**{*;}
|
||||
-keep class com.nlspeech.nlscodec.** {*;}
|
||||
-keep public class com.alibaba.mit.alitts.*{*;}
|
||||
-keep class com.alibaba.mit.alitts.** {*;}
|
||||
-dontwarn com.alibaba.mit.alitts.ICallback
|
||||
|
||||
#3D 地图 V5.0.0之后:
|
||||
-keep class com.amap.api.maps.**{*;}
|
||||
-keep class com.autonavi.**{*;}
|
||||
-keep class com.amap.api.trace.**{*;}
|
||||
-keep class com.amap.api.maps.**{*;}
|
||||
-keep class com.autonavi.**{*;}
|
||||
-keep class com.amap.api.trace.**{*;}
|
||||
#定位
|
||||
-keep class com.loc.** {*;}
|
||||
-keep class com.amap.api.location.**{*;}
|
||||
-keep class com.amap.api.fence.**{*;}
|
||||
-keep class com.loc.**{*;}
|
||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||
#搜索
|
||||
-keep class com.amap.api.services.**{*;}
|
||||
#导航
|
||||
-keep class com.amap.api.navi.**{*;}
|
||||
|
||||
#内置语音 V5.6.0之后
|
||||
-keep class com.alibaba.idst.nls.**{*;}
|
||||
-keep class com.google.**{*;}
|
||||
-keep class com.nlspeech.nlscodec.** {*;}
|
||||
-keep class com.alibaba.mit.alitts.** {*;}
|
||||
|
||||
-dontwarn android.telephony.**
|
||||
-keep class android.telephony.TelephonyManager$CellInfoCallback
|
||||
|
||||
#-----Gson-----
|
||||
-dontwarn sun.misc.**
|
||||
@@ -340,6 +344,7 @@
|
||||
-keep class com.zhidao.autopilot.support.**{*;}
|
||||
-keep class com.zhidao.voice.library.**{*;}
|
||||
-keep class com.zhidao.voicesdk.**{*;}
|
||||
-dontwarn com.elegant.network.**
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.launcher;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
@@ -10,6 +10,8 @@ import com.auto.zhidao.logsdk.CrashSystem;
|
||||
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
@@ -53,7 +55,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
|
||||
|
||||
// MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
|
||||
MogoModulePaths.addModule( new MogoModule( AuthorizeConstant.PATH_AGREEMENT_FRAGMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||
|
||||
//运营位卡片,需要默认显示,放在第一个加载
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
@@ -91,30 +93,60 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
|
||||
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
|
||||
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
|
||||
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
prepareBaseService(2_000L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础服务:passport、location、socket
|
||||
*/
|
||||
private void prepareBaseService(long delay) {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
||||
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), "com.mogo.launcher" );
|
||||
apis.getPassportManagerApi().requestTicket( new IMogoTicketCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
Logger.d( TAG, "ticket = %s", ticket );
|
||||
}
|
||||
// 第三方平台的sn是服务端生成的,所以必须在返回后才能开启
|
||||
if ( TextUtils.isEmpty( Utils.getSn() ) ) {
|
||||
preparePassportEnvironment( apis, () -> {
|
||||
prepareSocketAndLocationServices( apis );
|
||||
} );
|
||||
} else {
|
||||
preparePassportEnvironment( apis, null );
|
||||
prepareSocketAndLocationServices( apis );
|
||||
}
|
||||
}, delay );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( int code, String msg ) {
|
||||
Logger.w( TAG, "code = %s, msg = %s", code, msg );
|
||||
private void preparePassportEnvironment( IMogoServiceApis apis, Runnable after ) {
|
||||
apis.getPassportManagerApi().requestTicket( new IMogoTicketCallback() {
|
||||
@Override
|
||||
public void onTicketGot( String ticket ) {
|
||||
Logger.d( TAG, "ticket = %s", ticket );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( int code, String msg ) {
|
||||
Logger.w( TAG, "code = %s, msg = %s", code, msg );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoginSuccess( String token, String sn ) {
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
} );
|
||||
apis.getLocationInfoApi().start();
|
||||
apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
|
||||
apis.getLocationInfoApi().provideLocation( location );
|
||||
} );
|
||||
}, 2_000L );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
private void prepareSocketAndLocationServices( IMogoServiceApis apis ) {
|
||||
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() );
|
||||
apis.getLocationInfoApi().start();
|
||||
apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
|
||||
apis.getLocationInfoApi().provideLocation( location );
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
3
app/src/main/res/values-xhdpi-1920x1000/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_shell_name">蘑菇知途</string>
|
||||
</resources>
|
||||
@@ -101,8 +101,8 @@ targetSdkVersion : 22,
|
||||
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
|
||||
carcall : "com.mogo.module.carchatting:module-carchatting:${CARCHATTING_VERSION}",
|
||||
carcallprovider : "com.mogo.module.carchatting:module-carchatting-provider:${CARCHATTINGPROVIDER_VERSION}",
|
||||
guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
|
||||
guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
|
||||
// guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
|
||||
// guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
|
||||
// 在线车辆
|
||||
moduleonlinecar : "com.mogo.module:module-onlinecar:${MOGO_MODULE_ONLINECAR_VERSION}",
|
||||
// V2X
|
||||
@@ -120,7 +120,7 @@ targetSdkVersion : 22,
|
||||
mogomoduleauth : "com.mogo.module:module-authorize:${MOGO_MODULE_AUTHORIZE_VERSION}",
|
||||
mogomoduleguide : "com.mogo.module:module-guide:${MOGO_MODULE_GUIDE_VERSION}",
|
||||
// 长链
|
||||
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.1',
|
||||
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.4',
|
||||
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
|
||||
socketsdkprotobufjava : 'com.google.protobuf:protobuf-java:3.5.1',
|
||||
// OBU
|
||||
|
||||
@@ -53,7 +53,7 @@ class PassportManager implements IMogoPassportManager {
|
||||
Logger.d( TAG, "success" );
|
||||
SpStorage.setTicket( ticket );
|
||||
if ( callback != null ) {
|
||||
callback.onSuccess( ticket );
|
||||
callback.onTicketGot( ticket );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,10 @@ public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallbac
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived( byte[] content ) {
|
||||
onMessageReceived( content, 0);
|
||||
}
|
||||
|
||||
public void onMessageReceived( byte[] content, long msgId ) {
|
||||
try {
|
||||
MogoConnsvr.Payload payload = MogoConnsvr.Payload.parseFrom( content );
|
||||
|
||||
@@ -30,11 +30,11 @@ dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
// 上报位置
|
||||
implementation 'com.zhidao.locupload:loc-upload-sdk:1.0.9'
|
||||
implementation 'com.zhidao.locupload:loc-upload-sdk:1.1.2'
|
||||
// 长链
|
||||
implementation 'com.zhidao.socket:built-in-socket:1.0.13'
|
||||
implementation 'com.zhidao.socket:built-in-socket:1.0.15'
|
||||
// passport
|
||||
implementation 'com.zhidao.loginsdk:external:1.0.0'
|
||||
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.0'
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mogo.base.services;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/7/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface BaseServicesConstants {
|
||||
|
||||
/**
|
||||
* 建立长链的通道ID
|
||||
*/
|
||||
String SOCKET_CHANNEL_ID = "dataCrawler";
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
@@ -12,8 +11,6 @@ import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.locupload.LocEnvironment;
|
||||
import com.zhidao.locupload.LocUploadConfig;
|
||||
import com.zhidao.locupload.LocUploadManager;
|
||||
import com.zhidao.locupload.Platform;
|
||||
import com.zhidao.locupload.location.LocationServiceProvider;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -52,7 +49,7 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
@Override
|
||||
public void provideLocation( MogoLocation location ) {
|
||||
mLocation = location;
|
||||
Logger.d(TAG, "sdk - provideLocation");
|
||||
Logger.d( TAG, "sdk - provideLocation" );
|
||||
}
|
||||
|
||||
public MogoLocation getLocation() {
|
||||
@@ -62,37 +59,22 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
@Override
|
||||
public void start() {
|
||||
LocUploadManager.getInstance().startUpload();
|
||||
Logger.d(TAG, "sdk - start");
|
||||
Logger.d( TAG, "sdk - start" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
LocUploadManager.getInstance().stopUpload();
|
||||
Logger.d(TAG, "sdk - stop");
|
||||
Logger.d( TAG, "sdk - stop" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
LocUploadConfig.instance().
|
||||
setAppId( "dataCrawler" ).
|
||||
setAppId( DebugConfig.getSocketAppId() ).
|
||||
setContext( context.getApplicationContext() ).
|
||||
setLocEnvironment( getEnvironment() ).
|
||||
setLoggable( DebugConfig.isDebug() ).
|
||||
setPlatform( Platform.car ).
|
||||
setLocInterval( 2000L );
|
||||
Logger.d(TAG, "sdk - init");
|
||||
}
|
||||
|
||||
private LocEnvironment getEnvironment() {
|
||||
switch ( DebugConfig.getNetMode() ) {
|
||||
case 1:
|
||||
return LocEnvironment.dev;
|
||||
case 2:
|
||||
case 4:
|
||||
return LocEnvironment.qa;
|
||||
case 3:
|
||||
default:
|
||||
return LocEnvironment.release;
|
||||
}
|
||||
Logger.d( TAG, "sdk - init" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import com.mogo.service.passport.IMogoTicketCallback;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.accountsdk.manager.CarPadClientManagerImpl;
|
||||
import com.zhidao.accountsdk.manager.TicketInfoCallback;
|
||||
import com.zhidao.accountsdk.network.NetEnvironManager;
|
||||
import com.zhidao.tcloginsdk.LoginManagerImpl;
|
||||
import com.zhidao.tcloginsdk.ToCLoginManagerImpl;
|
||||
import com.zhidao.tcloginsdk.LoginManager;
|
||||
import com.zhidao.tcloginsdk.model.TokenData;
|
||||
import com.zhidao.tcloginsdk.network.LoginCallback;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -30,13 +30,14 @@ class PassportManager implements IMogoPassportManager {
|
||||
|
||||
private static volatile PassportManager sInstance;
|
||||
|
||||
private PassportManager(){}
|
||||
private PassportManager() {
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static PassportManager getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( PassportManager.class ) {
|
||||
if( sInstance == null ){
|
||||
public static PassportManager getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( PassportManager.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new PassportManager();
|
||||
}
|
||||
}
|
||||
@@ -44,30 +45,46 @@ class PassportManager implements IMogoPassportManager {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestTicket( final IMogoTicketCallback callback ) {
|
||||
getTicket( new TicketInfoCallback() {
|
||||
LoginManager.getInstance( mContext ).login( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE, DebugConfig.getProductFlavor(), new LoginCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
Logger.d( TAG, "success" );
|
||||
SpStorage.setTicket( ticket );
|
||||
public void onSuccess( TokenData.TokenResult result ) {
|
||||
if ( callback != null ) {
|
||||
callback.onSuccess( ticket );
|
||||
callback.onLoginSuccess( result.token, result.sn );
|
||||
}
|
||||
getTicket( new TicketInfoCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
Logger.d( TAG, "success" );
|
||||
SpStorage.setTicket( ticket );
|
||||
if ( callback != null ) {
|
||||
callback.onTicketGot( ticket );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( int code ) {
|
||||
Logger.d( TAG, "fail" );
|
||||
if ( callback != null ) {
|
||||
callback.onError( code, "getTicket error." );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( int code ) {
|
||||
Logger.d( TAG, "fail" );
|
||||
public void onFailure( int code, String msg ) {
|
||||
if ( callback != null ) {
|
||||
callback.onError( code, "error." );
|
||||
callback.onError( code, "login: " + msg );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
private void getTicket( TicketInfoCallback callback ) {
|
||||
@@ -96,8 +113,6 @@ class PassportManager implements IMogoPassportManager {
|
||||
// 演示环境用 qa 的
|
||||
mode = DebugConfig.NET_MODE_QA;
|
||||
}
|
||||
LoginManagerImpl.getInstance(mContext).setClientType(DebugConfig.getProductFlavor());
|
||||
LoginManagerImpl.getInstance( context ).setNetEnviron( mode );
|
||||
LoginManagerImpl.getInstance( context ).showLoginView();
|
||||
LoginManager.getInstance( context ).setNetEnviron( mode );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.mogo.base.services.BaseServicesConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.service.connection.IMogoMsgAckListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
@@ -86,8 +88,9 @@ class SocketManager implements IMogoSocketManager, Callback {
|
||||
.setAppContext( context.getApplicationContext() )
|
||||
.setEnvironment( getEnvironment() )
|
||||
.setClient( Platform.getClient( Platform.car ) )
|
||||
.setAppId( appId )
|
||||
.setChannelId( BaseServicesConstants.SOCKET_CHANNEL_ID )
|
||||
.setOpenAnalytics( true )
|
||||
.setSn( Utils.getSn() )
|
||||
.setDebug( DebugConfig.isDebug() );
|
||||
SocketMessageDispatcher.getInstance().start( context );
|
||||
}
|
||||
|
||||
@@ -110,35 +110,6 @@ public class AbsMogoApplication extends Application {
|
||||
|
||||
}
|
||||
|
||||
// private static void initAccountSdk() {
|
||||
// int mode = DebugConfig.getNetMode();
|
||||
// if ( mode == DebugConfig.NET_MODE_DEMO ) {
|
||||
// // 演示环境用 qa 的
|
||||
// mode = DebugConfig.NET_MODE_QA;
|
||||
// }
|
||||
// AccountClientManager.init( sApp, mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
|
||||
// getTicket( new TicketInfoCallback() {
|
||||
// @Override
|
||||
// public void onSuccess( String ticket ) {
|
||||
// SpStorage.setTicket( ticket );
|
||||
// Logger.w( TAG, "request ticket success" );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure( int code, String msg ) {
|
||||
// Logger.w( TAG, "request ticket error code = %d, msg = %s", code, msg );
|
||||
// }
|
||||
// } );
|
||||
// }
|
||||
//
|
||||
// private static void getTicket( TicketInfoCallback callback ) {
|
||||
// if ( DebugConfig.isLauncher() ) {
|
||||
// AccountClientManager.getTicket( callback );
|
||||
// } else {
|
||||
// AccountClientManager.getAppTicket( callback );
|
||||
// }
|
||||
// }
|
||||
|
||||
private static void initNetConfig() {
|
||||
|
||||
try {
|
||||
|
||||
@@ -227,4 +227,14 @@ public class DebugConfig {
|
||||
public static void setProductFlavor( String sProductFlavor ) {
|
||||
DebugConfig.sProductFlavor = sProductFlavor;
|
||||
}
|
||||
|
||||
private static String sSocketAppId;
|
||||
|
||||
public static void setSocketAppId( String sSocketAppId ) {
|
||||
DebugConfig.sSocketAppId = sSocketAppId;
|
||||
}
|
||||
|
||||
public static String getSocketAppId() {
|
||||
return sSocketAppId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.commons.network;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.telephony.CellLocation;
|
||||
import android.telephony.TelephonyManager;
|
||||
@@ -9,6 +10,10 @@ import android.telephony.cdma.CdmaCellLocation;
|
||||
import android.telephony.gsm.GsmCellLocation;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -61,11 +66,11 @@ public class Utils {
|
||||
public static final String PROPERTIES = "android.os.SystemProperties";
|
||||
|
||||
public static String getSn() {
|
||||
String sn = getSystemProperties( GSM_SERIAL );
|
||||
if ( TextUtils.isEmpty( sn ) ) {
|
||||
sn = getSystemProperties( BYD_SERIAL );
|
||||
|
||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
|
||||
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "allocated_sn" );
|
||||
}
|
||||
return sn;
|
||||
return getSystemProperties( GSM_SERIAL );
|
||||
}
|
||||
|
||||
public static String getFotaVersion() {
|
||||
|
||||
@@ -60,7 +60,7 @@ MOGO_MODULE_V2X_VERSION=1.2.1.20
|
||||
|
||||
## 工程外部模块
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.1.1
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.1.6
|
||||
# 车聊聊
|
||||
CARCHATTING_VERSION=1.4.6
|
||||
# 车聊聊接口
|
||||
@@ -78,7 +78,7 @@ MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6
|
||||
# 广告资源位
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=1.3.1.1
|
||||
TANLULIB_VERSION=1.3.1.6
|
||||
MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
#左侧面板模块
|
||||
|
||||
@@ -131,6 +131,7 @@ open class IMogoAuthorizeController {
|
||||
}
|
||||
}
|
||||
onError {
|
||||
//todo
|
||||
Logger.d(TAG, it.message ?: "checkIfNeedAuthorize onError, message is null")
|
||||
setAuthorizeStatus(agreementType, true)
|
||||
}
|
||||
|
||||
@@ -9,22 +9,24 @@ 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.Companion.PATH_AGREEMENT_FRAGMENT
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.auth.IMogoAuthManager
|
||||
import com.mogo.service.module.IMogoModuleLifecycle
|
||||
import com.mogo.service.module.IMogoModuleProvider
|
||||
import com.mogo.service.module.ModuleType
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
@Route(path = PATH_AGREEMENT_FRAGMENT)
|
||||
class MogoAuthorizeProvider : IMogoModuleProvider {
|
||||
@Route(path = MogoServicePaths.PATH_AGREEMENT)
|
||||
class MogoAuthorizeProvider : IMogoAuthManager {
|
||||
|
||||
companion object {
|
||||
const val TAG = "MogoAuthorizeProvider"
|
||||
}
|
||||
|
||||
private var mContext:Context? = null
|
||||
|
||||
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
|
||||
return null
|
||||
}
|
||||
@@ -46,7 +48,7 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
|
||||
}
|
||||
|
||||
override fun getType(): Int {
|
||||
return ModuleType.TYPE_SERVICE
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun getNaviListener(): IMogoNaviListener? {
|
||||
@@ -61,12 +63,10 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
//todo 引导判断暂时去掉 后续引导流程更改完再放开
|
||||
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
|
||||
// todo F系列暂时没有授权功能 1.1需求中添加 全量上
|
||||
override fun resetContext(context: Context?) {
|
||||
mContext = context
|
||||
if (mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
|
||||
mogoAuthShow.invokeAuthorizeForShow(context)
|
||||
mogoAuthShow.invokeAuthorizeForShow(mContext!!)
|
||||
} else {
|
||||
//首次进入Launcher同步一下授权状态,防止由于用户清除数据造成首次加载还会出现授权状态不同步问题
|
||||
mogoAuthShow.updateAuthorizeStatus(AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
@@ -74,6 +74,13 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
|
||||
}
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
//todo 引导判断暂时去掉 后续引导流程更改完再放开
|
||||
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
|
||||
// todo F系列暂时没有授权功能 1.1需求中添加 全量上
|
||||
|
||||
}
|
||||
|
||||
override fun getAppPackage(): String? {
|
||||
return null
|
||||
}
|
||||
@@ -81,4 +88,5 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
|
||||
override fun getAppName(): String? {
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,11 +6,6 @@ class AuthorizeConstant {
|
||||
const val PROVIDER_MODULE = "/authorize/biz"
|
||||
const val PROVIDER_LAUNCHER = "/authorize/showbiz"
|
||||
|
||||
/**
|
||||
* 展示用户协议模块地址
|
||||
*/
|
||||
const val PATH_AGREEMENT_FRAGMENT = "/agreement/showFragment"
|
||||
|
||||
/**
|
||||
* provider模块实例名称(暂时仅有卡片用到)
|
||||
*/
|
||||
|
||||
@@ -2,15 +2,12 @@ package com.mogo.module.authorize.authprovider.launcher
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Looper
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
import com.mogo.module.authorize.layout.AuthorizeLayout
|
||||
import com.mogo.module.authorize.layout.AuthorizeDialog
|
||||
import com.mogo.module.authorize.model.proxy.toAuthorizeType
|
||||
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth
|
||||
import com.mogo.module.common.wm.WindowManagerView
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeMainProvider {
|
||||
@@ -24,7 +21,9 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
}
|
||||
}
|
||||
|
||||
private var windowManagerView: WindowManagerView? = null
|
||||
private var mContext: Context? = null
|
||||
|
||||
private var authorizeDialog: AuthorizeDialog? = null
|
||||
|
||||
override fun hasRegister(tag: String): Boolean {
|
||||
if (tag.isNullOrBlank()) return false
|
||||
@@ -41,7 +40,8 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
}
|
||||
|
||||
fun invokeAuthorizeForShow(context: Context) {
|
||||
pushLayoutToMainWindow(context, AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
mContext = context
|
||||
pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
}
|
||||
|
||||
fun showAuthorizeView(tag: String, forbiddenVoice: (() -> Unit), onError: ((String) -> Unit)) {
|
||||
@@ -64,25 +64,26 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
Logger.d(TAG, "ready to forbidden voice")
|
||||
forbiddenVoice.invoke()
|
||||
Logger.d(TAG, "ready to push fragment")
|
||||
pushLayoutToMainWindow(AbsMogoApplication.getApp().applicationContext,tag)
|
||||
pushLayoutToMainWindow(tag)
|
||||
}
|
||||
|
||||
fun hideAuthorizeView() {
|
||||
windowManagerView?.dismiss()
|
||||
authorizeDialog?.dismiss()
|
||||
}
|
||||
|
||||
private fun pushLayoutToMainWindow(context: Context,tag: String) {
|
||||
if (windowManagerView == null) {
|
||||
val authorizeLayout = AuthorizeLayout(tag)
|
||||
val view = authorizeLayout.getLayoutView()
|
||||
windowManagerView = WindowManagerView.Builder(context).contentView(view).build()
|
||||
private fun pushLayoutToMainWindow(tag: String) {
|
||||
if (authorizeDialog == null) {
|
||||
authorizeDialog = AuthorizeDialog(tag, mContext!!)
|
||||
authorizeDialog!!.setOnDismissListener {
|
||||
authorizeDialog = null
|
||||
}
|
||||
}
|
||||
if (windowManagerView!!.isShowing) {
|
||||
if (authorizeDialog!!.isShowing) {
|
||||
Logger.d(TAG, "User is operation authorization, do not repeat invoke")
|
||||
return
|
||||
} else {
|
||||
Logger.d(TAG, "pushLayoutToMainWindow")
|
||||
windowManagerView!!.show()
|
||||
authorizeDialog!!.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.mogo.module.authorize.layout
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Html
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.module.authorize.R
|
||||
import com.mogo.module.authorize.util.AnalyticsUtil
|
||||
import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener
|
||||
import com.mogo.module.authorize.voice.IVoiceCommandListener
|
||||
import com.mogo.module.authorize.voice.VoiceUtil
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.utils.TipToast
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandListener, IVoiceAuthorizeIntentListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AuthorizeDialog"
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private var invokeTag: String? = null
|
||||
|
||||
private var agreementId: Long = 0L
|
||||
|
||||
private var clTopParent: ConstraintLayout? = null
|
||||
private var clErrorContainer: ConstraintLayout? = null
|
||||
private var clLoadAuthorizeContainer: ConstraintLayout? = null
|
||||
private var clContainer: ConstraintLayout? = null
|
||||
private var clAuthorizeLoading: ConstraintLayout? = null
|
||||
private var btnAgree: Button? = null
|
||||
private var btnDisAgree: Button? = null
|
||||
private var btnLoadingError: Button? = null
|
||||
private var tvTitle: TextView? = null
|
||||
private var tvContent: TextView? = null
|
||||
private var tvButtonContent: TextView? = null
|
||||
private var tvLastContent: TextView? = null
|
||||
|
||||
private var authorizeController: AuthorizeController? = null
|
||||
|
||||
constructor(invokeTag: String, context: Context) : super(context) {
|
||||
mContext = context
|
||||
this.invokeTag = invokeTag
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
setContentView(R.layout.module_authorize_fragment)
|
||||
setWrapContent()
|
||||
initViews()
|
||||
}
|
||||
|
||||
private fun setWrapContent() {
|
||||
val mWindow = window
|
||||
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
|
||||
if (mWindow != null) {
|
||||
val lp = mWindow.attributes
|
||||
lp.width = 1024
|
||||
lp.height = 600
|
||||
mWindow.attributes = lp
|
||||
}
|
||||
}else{
|
||||
if (mWindow != null) {
|
||||
val lp = mWindow.attributes
|
||||
lp.width = 1920
|
||||
lp.height = 1000
|
||||
mWindow.attributes = lp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun initViews() {
|
||||
Logger.d(TAG, "initView ")
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW)
|
||||
init()
|
||||
Logger.d(TAG, "invokeTag :$invokeTag")
|
||||
authorizeController = AuthorizeController(invokeTag!!)
|
||||
invokeAuthorizationContent()
|
||||
VoiceUtil.registerAll(this, this)
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
clTopParent = findViewById(R.id.clAuthorizeTopParent)
|
||||
clErrorContainer = findViewById(R.id.clLoadingErrorContainer)
|
||||
clLoadAuthorizeContainer = findViewById(R.id.clLoadingAuthorizeContainer)
|
||||
clContainer = findViewById(R.id.clAuthorizeContainer)
|
||||
clAuthorizeLoading = findViewById(R.id.clAuthorizeLoading)
|
||||
btnAgree = findViewById(R.id.btnAuthorizeAgree)
|
||||
btnDisAgree = findViewById(R.id.btnAuthorizeDisAgree)
|
||||
btnLoadingError = findViewById(R.id.btnAuthorizeLoadingError)
|
||||
tvTitle = findViewById(R.id.tvAuthorizeTitle)
|
||||
tvContent = findViewById(R.id.tvAuthorizeContent)
|
||||
tvButtonContent = findViewById(R.id.tvAuthorizeButtonContent)
|
||||
tvLastContent = findViewById(R.id.tvAuthorizeLastContent)
|
||||
btnAgree?.setOnClickListener(this)
|
||||
btnDisAgree?.setOnClickListener(this)
|
||||
btnLoadingError?.setOnClickListener(this)
|
||||
clTopParent?.setOnClickListener(this)
|
||||
clContainer?.setOnClickListener(this)
|
||||
clErrorContainer?.setOnClickListener(this)
|
||||
clLoadAuthorizeContainer?.setOnClickListener(this)
|
||||
clAuthorizeLoading?.setOnClickListener(this)
|
||||
}
|
||||
|
||||
private fun readyToAuthorize() {
|
||||
clErrorContainer?.visibility = View.GONE
|
||||
clLoadAuthorizeContainer?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
private fun showAuthorizationAgreementContent(
|
||||
agreementId: Long,
|
||||
agreementContent: String,
|
||||
agreementTitle: String,
|
||||
agreementBottom: String,
|
||||
agreementLast: String) {
|
||||
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.resources.getString(R.string.module_authorize_agreement_tip), AbsMogoApplication.getApp().applicationContext, this)
|
||||
this.agreementId = agreementId
|
||||
clLoadAuthorizeContainer?.visibility = View.GONE
|
||||
clContainer?.visibility = View.VISIBLE
|
||||
tvTitle?.text = Html.fromHtml(agreementTitle)
|
||||
GlobalScope.async(Dispatchers.IO) {
|
||||
val spannable = Html.fromHtml(agreementContent)
|
||||
withContext(Dispatchers.Main) {
|
||||
tvContent?.text = spannable
|
||||
}
|
||||
}
|
||||
tvButtonContent?.text = Html.fromHtml(agreementBottom)
|
||||
tvLastContent?.text = Html.fromHtml(agreementLast)
|
||||
}
|
||||
|
||||
private fun showAuthorizationError() {
|
||||
clLoadAuthorizeContainer?.visibility = View.GONE
|
||||
clErrorContainer?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
private fun voiceAuthorizeError() {
|
||||
TipToast.shortTip("授权失败,请稍后重试")
|
||||
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.getString(R.string.module_authorize_failed), AbsMogoApplication.getApp().applicationContext, this)
|
||||
Logger.d(TAG, "onDestroy")
|
||||
VoiceUtil.unregisterAll(AbsMogoApplication.getApp().applicationContext, this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.btnAuthorizeAgree -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 1))
|
||||
agreeAuthorize()
|
||||
}
|
||||
R.id.btnAuthorizeDisAgree -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 2))
|
||||
disAgreeAuthorize()
|
||||
}
|
||||
R.id.clLoadingErrorContainer, R.id.btnAuthorizeLoadingError -> {
|
||||
invokeAuthorizationContent()
|
||||
}
|
||||
R.id.clAuthorizeTopParent -> {
|
||||
Logger.i(TAG, "dismiss authorizeView")
|
||||
authorizeController?.onDestroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onVoiceCmdAgree() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 1))
|
||||
agreeAuthorize()
|
||||
}
|
||||
|
||||
override fun onVoiceCmdDisAgree() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 2))
|
||||
disAgreeAuthorize()
|
||||
}
|
||||
|
||||
private fun agreeAuthorize() {
|
||||
authorizeController?.agreeAuthorize(invokeTag!!, agreementId) {
|
||||
voiceAuthorizeError()
|
||||
}
|
||||
}
|
||||
|
||||
private fun disAgreeAuthorize() {
|
||||
authorizeController?.disAgreeAuthorize(invokeTag!!, agreementId) {
|
||||
voiceAuthorizeError()
|
||||
}
|
||||
}
|
||||
|
||||
private fun invokeAuthorizationContent() {
|
||||
authorizeController?.invokeAuthorizationContent(invokeTag!!, {
|
||||
readyToAuthorize()
|
||||
}, { id: Long, content: String, title: String, bottomContent: String, lastContent: String ->
|
||||
showAuthorizationAgreementContent(id, content, title, bottomContent, lastContent)
|
||||
}, {
|
||||
showAuthorizationError()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -50,11 +50,11 @@ class AuthorizeLayout(private val invokeTag: String) : View.OnClickListener, IVo
|
||||
return layoutInflater
|
||||
}
|
||||
|
||||
private fun getLayoutId(): Int {
|
||||
fun getLayoutId(): Int {
|
||||
return R.layout.module_authorize_fragment
|
||||
}
|
||||
|
||||
private fun initViews(mRootView: View) {
|
||||
fun initViews(mRootView: View) {
|
||||
Logger.d(TAG, "initView ")
|
||||
AnalyticsUtil.track(INVOKE_TRACK_AUTHORIZE_SHOW)
|
||||
init(mRootView)
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
android:layout_height="0px"
|
||||
android:layout_marginBottom="@dimen/dp_139"
|
||||
android:scrollbarSize="@dimen/dp_442"
|
||||
android:layout_marginTop="@dimen/dp_139"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
|
||||
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.module.common.wm;
|
||||
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* 采用Dialog实现接口
|
||||
*/
|
||||
class DialogImpl implements IWindowManagerView {
|
||||
private Dialog dialog;
|
||||
private View contentView;
|
||||
|
||||
@Override
|
||||
public void init(WindowManagerView.WMViewParams params) {
|
||||
Logger.d("DialogImpl", "init====");
|
||||
dialog = new BaseFloatDialog(params.mContext);
|
||||
contentView = params.mContentView;
|
||||
Logger.d("DialogImpl", "params view : " + contentView);
|
||||
dialog.setContentView(contentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowing() {
|
||||
return dialog.isShowing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hide() {
|
||||
/*
|
||||
* 取得view的父组件,然后移除view
|
||||
*/
|
||||
if (contentView != null) {
|
||||
((ViewGroup) contentView.getParent()).removeView(contentView);
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.module.common.wm;
|
||||
|
||||
interface IWindowManagerView {
|
||||
/**
|
||||
* 初始化
|
||||
* @param params contentView包装类
|
||||
*/
|
||||
void init(WindowManagerView.WMViewParams params);
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
* @return true - 显示中
|
||||
*/
|
||||
boolean isShowing();
|
||||
|
||||
/**
|
||||
* 显示
|
||||
*/
|
||||
void show();
|
||||
|
||||
/**
|
||||
* 隐藏
|
||||
*/
|
||||
void hide();
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mogo.module.common.wm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
/**
|
||||
* 采用windowManager实现接口
|
||||
*/
|
||||
class WindowManagerImpl implements IWindowManagerView {
|
||||
private WindowManager mWindowManager;
|
||||
private WindowManager.LayoutParams mLayoutParams;
|
||||
private WindowManagerView.WMViewParams mParams;
|
||||
private boolean isShowing;
|
||||
@Override
|
||||
public void init(WindowManagerView.WMViewParams params) {
|
||||
mParams = params;
|
||||
mWindowManager = (WindowManager) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
mLayoutParams = new WindowManager.LayoutParams();
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
}
|
||||
mLayoutParams.format = PixelFormat.TRANSLUCENT;
|
||||
mLayoutParams.gravity = Gravity.CENTER;
|
||||
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
mLayoutParams.width = 1920;
|
||||
mLayoutParams.height = 1080;
|
||||
} else {
|
||||
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
|
||||
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
|
||||
}
|
||||
mLayoutParams.dimAmount = 0.5f;
|
||||
mLayoutParams.x = 0;
|
||||
mLayoutParams.y = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowing() {
|
||||
return isShowing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
if(!isShowing){
|
||||
isShowing = true;
|
||||
mWindowManager.addView(mParams.mContentView,mLayoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hide() {
|
||||
if (isShowing && mParams != null) {
|
||||
mWindowManager.removeView(mParams.mContentView);
|
||||
isShowing = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import android.view.WindowManager;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.LayoutRes;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
@@ -23,89 +24,57 @@ import com.mogo.utils.WindowUtils;
|
||||
public class WindowManagerView {
|
||||
|
||||
private WMViewParams mParams;
|
||||
private boolean mIsShowing;
|
||||
private WindowManager mWindowManager;
|
||||
private WindowManager.LayoutParams mLayoutParams;
|
||||
|
||||
private WindowManagerView( WMViewParams params ) {
|
||||
private IWindowManagerView managerView;
|
||||
|
||||
private WindowManagerView(WMViewParams params) {
|
||||
this.mParams = params;
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
mLayoutParams = new WindowManager.LayoutParams();
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
}
|
||||
mLayoutParams.format = PixelFormat.TRANSLUCENT;
|
||||
mLayoutParams.gravity = Gravity.CENTER;
|
||||
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
mLayoutParams.width = 1920;
|
||||
mLayoutParams.height = 1080;
|
||||
} else {
|
||||
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
|
||||
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
|
||||
}
|
||||
mLayoutParams.dimAmount = 0.5f;
|
||||
mLayoutParams.x = 0;
|
||||
mLayoutParams.y = 0;
|
||||
managerView = new DialogImpl();
|
||||
managerView.init(params);
|
||||
// init();
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mIsShowing;
|
||||
return managerView.isShowing();
|
||||
}
|
||||
|
||||
public < T extends View > T findViewById( @IdRes int id ) {
|
||||
return mParams.mContentView.findViewById( id );
|
||||
public <T extends View> T findViewById(@IdRes int id) {
|
||||
return mParams.mContentView.findViewById(id);
|
||||
}
|
||||
|
||||
public void show() {
|
||||
if ( mIsShowing ) {
|
||||
return;
|
||||
}
|
||||
mIsShowing = true;
|
||||
mWindowManager.addView( mParams.mContentView, mLayoutParams );
|
||||
managerView.show();
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
if ( !mIsShowing ) {
|
||||
return;
|
||||
}
|
||||
if ( mParams != null ) {
|
||||
mWindowManager.removeViewImmediate( mParams.mContentView );
|
||||
}
|
||||
mIsShowing = false;
|
||||
managerView.hide();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private WMViewParams mParams = null;
|
||||
|
||||
public Builder( Context context ) {
|
||||
public Builder(Context context) {
|
||||
mParams = new WMViewParams();
|
||||
mParams.mContext = context;
|
||||
}
|
||||
|
||||
public Builder contentView( View contentView ) {
|
||||
public Builder contentView(View contentView) {
|
||||
mParams.mContentView = contentView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder contentView( @LayoutRes int contentViewId ) {
|
||||
mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
|
||||
public Builder contentView(@LayoutRes int contentViewId) {
|
||||
mParams.mContentView = LayoutInflater.from(mParams.mContext).inflate(contentViewId,
|
||||
null);
|
||||
return this;
|
||||
}
|
||||
|
||||
public WindowManagerView build() {
|
||||
if ( mParams.mContentView == null ) {
|
||||
throw new NullPointerException( "WMViewParams#mContentView must not be null." );
|
||||
if (mParams.mContentView == null) {
|
||||
throw new NullPointerException("WMViewParams#mContentView must not be null.");
|
||||
}
|
||||
return new WindowManagerView( mParams );
|
||||
return new WindowManagerView(mParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,9 @@
|
||||
<dimen name="dp_997">997px</dimen>
|
||||
<dimen name="dp_998">998px</dimen>
|
||||
<dimen name="dp_999">999px</dimen>
|
||||
<dimen name="dp_1000">1000px</dimen>
|
||||
<dimen name="dp_1300">1300px</dimen>
|
||||
<dimen name="dp_1920">1920px</dimen>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.module.extensions.net.UserInfoNetApiServices;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoConstant;
|
||||
@@ -23,7 +24,6 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
|
||||
import com.mogo.utils.digest.DigestUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.auto.platform.util.DeviceUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
|
||||
private UserInfo userInfo;
|
||||
public void requestUserInfo() {
|
||||
Map<String, String> params = new ArrayMap<>();
|
||||
params.put("sn", DeviceUtil.getSn());
|
||||
params.put("sn", Utils.getSn());
|
||||
params.put("source", "2");
|
||||
String sign = createSign(params, "JGqZw9");
|
||||
params.put("sig", sign);
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.net.UserInfoNetApiServices;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
@@ -25,7 +26,6 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
|
||||
import com.mogo.utils.digest.DigestUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.auto.platform.util.DeviceUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -113,7 +113,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
|
||||
private UserInfo userInfo;
|
||||
public void requestUserInfo() {
|
||||
Map<String, String> params = new ArrayMap<>();
|
||||
params.put("sn", DeviceUtil.getSn());
|
||||
params.put("sn", Utils.getSn());
|
||||
params.put("source", "2");
|
||||
String sign = createSign(params, "JGqZw9");
|
||||
params.put("sig", sign);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.mogo.module.gps.simulator;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -15,6 +19,9 @@ class Utils {
|
||||
public static final String PROPERTIES = "android.os.SystemProperties";
|
||||
|
||||
public static String getSn() {
|
||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
|
||||
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "allocated_sn" );
|
||||
}
|
||||
return getSystemProperties( GSM_SERIAL );
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public class EventDispatchCenter implements
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void setMapLoadedCallback( Runnable callback ){
|
||||
void setMapLoadedCallback( Runnable callback ) {
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
@@ -162,6 +162,21 @@ public class EventDispatchCenter implements
|
||||
mMapLoadedCallback.run();
|
||||
mMapLoadedCallback = null;
|
||||
}
|
||||
|
||||
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if ( listener != null ) {
|
||||
try {
|
||||
listener.onMapLoaded();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -466,46 +481,46 @@ public class EventDispatchCenter implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCarLocationInfo(CarLocationInfo info) {
|
||||
public void showCarLocationInfo( CarLocationInfo info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showCarLocationInfo(info);
|
||||
iterator.next().showCarLocationInfo( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showOtherInfo(String info) {
|
||||
public void showOtherInfo( String info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showOtherInfo(info);
|
||||
iterator.next().showOtherInfo( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showTrafficLightInfo(TrafficLightInfo info) {
|
||||
public void showTrafficLightInfo( TrafficLightInfo info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showTrafficLightInfo(info);
|
||||
iterator.next().showTrafficLightInfo( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCarEventInfo(CarEventInfo info) {
|
||||
public void showCarEventInfo( CarEventInfo info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showCarEventInfo(info);
|
||||
iterator.next().showCarEventInfo( info );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.module.main.service.MogoMainService;
|
||||
import com.mogo.module.main.windowview.FloatingViewHandler;
|
||||
@@ -30,7 +31,6 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.obu.IMogoObuManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
@@ -115,6 +115,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext(this);
|
||||
mServiceApis.getAuthManagerApi().resetContext(this);
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
|
||||
AutopilotServiceManage.getInstance().init( getContext() );
|
||||
@@ -244,12 +245,21 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
super.onPause();
|
||||
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
|
||||
if ( !mIsHomeKeyDown || !DebugConfig.isLauncher() ) {
|
||||
if ( shouldCloseADASPanel() ) {
|
||||
mServiceApis.getAdasControllerApi().closeADAS();
|
||||
}
|
||||
mIsHomeKeyDown = false;
|
||||
}
|
||||
|
||||
private boolean shouldCloseADASPanel(){
|
||||
// m4 系列因为按home键会造成页面pause后resume,造成adas panel 闪烁
|
||||
// f 系列加上上滑返回桌面后会走 mIsHomeKeyDown = true,但是不会造成页面pause
|
||||
// 独立 app 任何情况下都需要隐藏 adas
|
||||
return !mIsHomeKeyDown
|
||||
|| CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X
|
||||
|| !DebugConfig.isLauncher();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
|
||||
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 60 KiB |
@@ -14,7 +14,6 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import cn.kuwo.autosdk.api.KWAPI;
|
||||
import cn.kuwo.autosdk.api.OnGetSongImgUrlListener;
|
||||
@@ -43,14 +42,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
kwapi = KWAPI.createKWAPI(context, "auto");
|
||||
|
||||
kwapi.registerConnectedListener(b -> {
|
||||
Logger.d(TAG, "onConnected: " + b);
|
||||
Log.d(TAG, "onConnected: " + b);
|
||||
Log.d(TAG, "onConnected: " + b);
|
||||
isBind = b;
|
||||
if (!isBind) {
|
||||
mView.onMusicStopped();
|
||||
}else{
|
||||
PlayerStatus currentState = kwapi.getPlayerStatus();
|
||||
Logger.d(TAG, "check current status: " + currentState);
|
||||
Log.d(TAG, "check current status: " + currentState);
|
||||
Log.d(TAG, "check current status: " + currentState);
|
||||
if(currentState == PlayerStatus.BUFFERING||currentState == PlayerStatus.PLAYING){
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
@@ -62,13 +61,16 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
});
|
||||
|
||||
kwapi.registerExitListener(() -> {
|
||||
Logger.d(TAG, "onExit===");
|
||||
Log.d(TAG, "onExit===");
|
||||
Log.d(TAG, "onExit===");
|
||||
mView.onAppExit();
|
||||
});
|
||||
|
||||
kwapi.registerPlayerStatusListener((playerStatus, music) -> {
|
||||
Logger.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
|
||||
if ( music == null ) {
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
|
||||
switch (playerStatus) {
|
||||
case BUFFERING:
|
||||
if (currentMedia.getMediaName() == null || !currentMedia.getMediaName().equals(music.name)) {
|
||||
@@ -113,7 +115,7 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (isTrue) {
|
||||
Logger.d(TAG, "onResume, isBind: " + isBind);
|
||||
Log.d(TAG, "onResume, isBind: " + isBind);
|
||||
Log.d(TAG, "onResume, isBind: " + isBind);
|
||||
// 需要在resume时候判断绑定关系是否正常
|
||||
if (!isBind) {
|
||||
@@ -125,14 +127,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
// 当前处于绑定状态,且有音乐信息,需判断是否正在播放,进行界面刷新
|
||||
Log.d(TAG, "step1==" + currentMusic.name);
|
||||
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=1=" + currentMusic.name);
|
||||
Log.d(TAG, "当前可能正在播放音乐,需要更新=1=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicPlaying();
|
||||
kwapi.getSongPicUrl(currentMusic, onGetSongImgUrlListener);
|
||||
} else if (kwapi.getPlayerStatus() == PlayerStatus.INIT) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=3=" + currentMusic.name);
|
||||
Log.d(TAG, "当前可能正在播放音乐,需要更新=3=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
@@ -142,14 +144,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
Log.d(TAG, "step2==media: " + currentMedia.getMediaName() + " " +
|
||||
"musicName: " + currentMusic.name + " status: " + kwapi.getPlayerStatus());
|
||||
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=2=" + currentMusic.name);
|
||||
Log.d(TAG, "当前可能正在播放音乐,需要更新=2=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicPlaying();
|
||||
kwapi.getSongPicUrl(currentMusic, onGetSongImgUrlListener);
|
||||
}else if (kwapi.getPlayerStatus() == PlayerStatus.INIT) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=4=" + currentMusic.name);
|
||||
Log.d(TAG, "当前可能正在播放音乐,需要更新=4=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
@@ -237,16 +239,18 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
private OnGetSongImgUrlListener onGetSongImgUrlListener = new OnGetSongImgUrlListener() {
|
||||
@Override
|
||||
public void onGetSongImgUrlSucessed(Music music, String s) {
|
||||
currentMedia.setMediaName(music.name);
|
||||
currentMedia.setMediaImg(s);
|
||||
Logger.d(TAG,
|
||||
"onGetSongImgUrlSucessed: " + currentMedia);
|
||||
handler.post(() -> mView.onMediaInfoChanged(currentMedia));
|
||||
if(currentMedia.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) {
|
||||
currentMedia.setMediaName(music.name);
|
||||
currentMedia.setMediaImg(s);
|
||||
Log.d(TAG,
|
||||
"onGetSongImgUrlSucessed: " + currentMedia);
|
||||
handler.post(() -> mView.onMediaInfoChanged(currentMedia));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetSongImgUrlFailed(Music music, int i) {
|
||||
Logger.e(TAG, "onGetSongImgUrlFailed: " + i);
|
||||
Log.e(TAG, "onGetSongImgUrlFailed: " + i);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.media.window;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -101,6 +102,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
|
||||
Logger.d(TAG,
|
||||
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
|
||||
Log.d(TAG, "addMediaWindoView");
|
||||
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;
|
||||
@@ -204,6 +206,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
@Override
|
||||
public void onMusicPlaying() {
|
||||
Logger.d(TAG, "onMusicPlaying===" + mMediaInfoData);
|
||||
Log.d(TAG, "onMusicPlaying===" + mMediaInfoData);
|
||||
isFirstPlay = false;
|
||||
updateWindowUI(false);
|
||||
if (mWindowPlayPause != null) {
|
||||
@@ -218,6 +221,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
@Override
|
||||
public void onMusicPause() {
|
||||
Logger.d(TAG, "onMusicPause: ===" + mMediaInfoData);
|
||||
Log.d(TAG, "onMusicPause: ===" + mMediaInfoData);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
@@ -230,6 +234,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
@Override
|
||||
public void onMusicStopped() {
|
||||
Logger.d(TAG, "onMusicStopped===" + mMediaInfoData);
|
||||
Log.d(TAG, "onMusicStopped===" + mMediaInfoData);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
@@ -244,6 +249,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
@Override
|
||||
public void onMediaInfoChanged(MediaInfoData mediaInfoData) {
|
||||
Logger.d(TAG, "onMediaInfoChanged: " + mediaInfoData);
|
||||
Log.d(TAG, "onMediaInfoChanged:" + mediaInfoData);
|
||||
mMediaInfoData = mediaInfoData;
|
||||
addWindowView();
|
||||
updateWindowUI();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@@ -111,6 +112,7 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
|
||||
@Override
|
||||
public void dismissShareDialog() {
|
||||
if (mShareDialog != null) {
|
||||
Logger.d(TAG,"dismissShareDialog");
|
||||
mShareDialog.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -122,7 +124,14 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
|
||||
|
||||
private void realShowDialog() {
|
||||
if (mShareDialog == null) {
|
||||
Logger.d(TAG,"realShowDialog context : " + mContext);
|
||||
mShareDialog = new LaucherShareDialog(mContext);
|
||||
mShareDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
mShareDialog = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
mShareDialog.show();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import android.os.SystemClock
|
||||
import com.mogo.commons.data.BaseData
|
||||
import com.mogo.commons.network.SubscribeImpl
|
||||
import com.mogo.commons.network.Utils
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.module.share.bean.SeekRecord
|
||||
@@ -16,7 +17,6 @@ import com.mogo.utils.TipToast
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.mogo.utils.network.RequestOptions
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
import com.zhidao.auto.platform.util.DeviceUtil
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
|
||||
@@ -152,7 +152,7 @@ object SeekHelpManager {
|
||||
private fun realSeekHelp() {
|
||||
Logger.d(TAG, "realSeekHelp")
|
||||
// 请求故障求助接口
|
||||
val seekRequest = SeekRequest(DeviceUtil.getSn())
|
||||
val seekRequest = SeekRequest(Utils.getSn())
|
||||
val param = mutableMapOf("data" to seekRequest.getJson())
|
||||
|
||||
ServiceApisManager.serviceApis.networkApi.create(ShareApiService::class.java, HttpConstant.getNetHost()).sendHelpSignal(param).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(object : SubscribeImpl<BaseData>(RequestOptions.create(context)) {
|
||||
@@ -209,7 +209,7 @@ object SeekHelpManager {
|
||||
}
|
||||
|
||||
fun debugCancelSeek() {
|
||||
val seekRequest = SeekRequest(DeviceUtil.getSn(), 0)
|
||||
val seekRequest = SeekRequest(Utils.getSn(), 0)
|
||||
val param = mutableMapOf("data" to seekRequest.getJson())
|
||||
ServiceApisManager.serviceApis.networkApi.create(ShareApiService::class.java, HttpConstant.getNetHost()).sendHelpSignal(param).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(object : SubscribeImpl<BaseData>(RequestOptions.create(context)) {
|
||||
override fun onSuccess(o: BaseData?) {
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@@ -42,7 +42,7 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation 'com.tencent.liteavsdk:LiteAVSDK_Smart:7.2.8927'
|
||||
implementation 'com.tencent.liteavsdk:LiteAVSDK_Smart:7.4.9211'
|
||||
implementation 'ch.hsr:geohash:1.4.0'
|
||||
implementation rootProject.ext.dependencies.flexbox
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -11,11 +12,14 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
@@ -53,7 +57,8 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
@Route(path = V2XConst.PATH_V2X_UI)
|
||||
public class V2XModuleProvider implements
|
||||
IMogoModuleProvider,
|
||||
IMogoStatusChangedListener {
|
||||
IMogoStatusChangedListener,
|
||||
IMogoMapListener {
|
||||
private final String TAG = "V2XMocduleProvider";
|
||||
|
||||
private Context mContext;
|
||||
@@ -125,6 +130,9 @@ public class V2XModuleProvider implements
|
||||
handleAdas();
|
||||
initData();
|
||||
|
||||
|
||||
V2XServiceManager.getMogoRegisterCenter().registerMogoMapListener(V2XConst.MODULE_NAME, this);
|
||||
|
||||
// 注册广播接收场景弹窗使用的
|
||||
SceneBroadcastReceiver localReceiver = new SceneBroadcastReceiver();
|
||||
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
|
||||
@@ -145,16 +153,12 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
//初始化获得自车求助状态
|
||||
initCarForHelpStatus();
|
||||
|
||||
try {
|
||||
// 查询ACC状态
|
||||
SharedPrefsMgr.getInstance(V2XUtils.getApp()).putBoolean("descriptor_ACC_STATUS", isAccOn());
|
||||
if (isAccOn()) {
|
||||
// 记录开机时间
|
||||
FatigueDrivingUtils.refreshAccOnTime();
|
||||
initCarForHelpStatus();
|
||||
// 刷新配置文件
|
||||
refreshStrategyConfig();
|
||||
} else {
|
||||
@@ -293,4 +297,40 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
//初始化获得自车求助状态
|
||||
initCarForHelpStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap(boolean isLock) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
|
||||
clearAlarmPOI();
|
||||
clearSpecialCarPOI();
|
||||
// 锁车
|
||||
V2XServiceManager.getMapUIController().recoverLockMode();
|
||||
// 开启主Launcher刷新
|
||||
V2XServiceManager.getIMogoRefreshStrategyController().restartAutoRefreshAtTime(500);
|
||||
}
|
||||
@@ -220,7 +222,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
@Override
|
||||
public void drawableSpecialCarPOI(Context context, V2XMarkerEntity v2XMarkerEntity, IMogoMarkerClickListener clickListener) {
|
||||
try {
|
||||
MarkerUtils.resetMapZoom(15);
|
||||
V2XServiceManager.getMapUIController().changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setOtherSeekHelpPOIShow(TAG, true);
|
||||
|
||||
@@ -256,11 +257,13 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
// 当前Marker设置为最上面
|
||||
mAlarmInfoMarker.setToTop();
|
||||
// if (clickListener != null) {
|
||||
// mAlarmInfoMarker.setOnMarkerClickListener(clickListener);
|
||||
// }
|
||||
// 绘制连接线
|
||||
V2XServiceManager.getMoGoV2XPolylineManager().drawablePolyline(context, roadEventEntity);
|
||||
// 缩放地图
|
||||
MarkerUtils.zoomMap(
|
||||
new MogoLatLng(roadEventEntity.getLocation().getLat(),
|
||||
roadEventEntity.getLocation().getLon()
|
||||
), context);
|
||||
} else {
|
||||
Logger.e(MODULE_NAME, "Location 必须进行初始化!!!!!");
|
||||
}
|
||||
@@ -512,7 +515,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
@Override
|
||||
public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) {
|
||||
try {
|
||||
MarkerUtils.resetMapZoom(15);
|
||||
V2XServiceManager.getMapUIController().changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setRoadEventPOIShow(TAG, true);
|
||||
//Logger.i(MODULE_NAME, "绘制道路事件====drawableAlarmPOI:");
|
||||
@@ -532,11 +534,13 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
// 当前Marker设置为最上面
|
||||
mAlarmInfoMarker.setToTop();
|
||||
// if (clickListener != null) {
|
||||
// mAlarmInfoMarker.setOnMarkerClickListener(clickListener);
|
||||
// }
|
||||
// 绘制连接线
|
||||
V2XServiceManager.getMoGoV2XPolylineManager().drawablePolyline(context, roadEventEntity);
|
||||
// 缩放地图
|
||||
MarkerUtils.zoomMap(
|
||||
new MogoLatLng(roadEventEntity.getLocation().getLat(),
|
||||
roadEventEntity.getLocation().getLon()
|
||||
), context);
|
||||
} else {
|
||||
Logger.e(MODULE_NAME, "Location 必须进行初始化!!!!!");
|
||||
}
|
||||
|
||||
@@ -218,7 +218,6 @@ public class V2XRoadLiveCarWindow extends RelativeLayout
|
||||
// 倒计时
|
||||
if (runnableV2XEvent == null) {
|
||||
runnableV2XEvent = () -> {
|
||||
Logger.d(MODULE_NAME, "V2X=== Window 30秒倒计时结束。。。");
|
||||
// 移出Window详细信息
|
||||
mTvEventStubClose.setText((countDownTime--) + "s");
|
||||
handlerV2XEvent.postDelayed(runnableV2XEvent, 1000);
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
@@ -83,16 +81,12 @@ public class V2XIllegalParkMarker implements IV2XMarker<List<MarkerExploreWay>>
|
||||
|
||||
countDownV2XEvent();
|
||||
} catch (Exception e) {
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
// 移动回原来的中心点
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(V2XServiceManager.getMapUIController(), Scene.AIMLESS);
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
// 移除违章停车点
|
||||
|
||||
@@ -3,12 +3,10 @@ package com.mogo.module.v2x.scenario.scene.push;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerExploreWayItem;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.listener.V2XMarkerClickListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
@@ -62,16 +60,12 @@ public class V2XPushEventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
V2XMarkerClickListener.getInstance());
|
||||
|
||||
} catch (Exception e) {
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
// 移动回原来的中心点
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(V2XServiceManager.getMapUIController(), Scene.AIMLESS);
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
// 移除线
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.mogo.module.v2x.scenario.scene.road;
|
||||
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
|
||||
@@ -31,16 +29,12 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
.drawableAlarmPOI(V2XServiceManager.getContext(), entity, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
// 移动回原来的中心点
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(V2XServiceManager.getMapUIController(), Scene.AIMLESS);
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
// 移除线
|
||||
|
||||
@@ -86,7 +86,6 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
V2XServiceManager.getContext(),
|
||||
mV2XMessageEntity.getContent());
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
drawPOI();
|
||||
showWindow();
|
||||
}
|
||||
}
|
||||
@@ -183,6 +182,9 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
@Override
|
||||
public void onViewAdded(View view) {
|
||||
Logger.d(MODULE_NAME, "展示 Window 动画结束");
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
drawPOI();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,15 +50,19 @@ public class V2XSeekHelpButton implements IV2XButton {
|
||||
@Override
|
||||
public void show() {
|
||||
registerVoice();
|
||||
tv = V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2);
|
||||
tv.setText("取消\n求助");
|
||||
tv.setVisibility(View.VISIBLE);
|
||||
tv.setBackgroundResource(R.drawable.bg_v2x_event_live_show);
|
||||
tv.setOnClickListener(v -> {
|
||||
//调用取消求助接口
|
||||
// TODO: 2020/5/18 回调,显示对话框
|
||||
doAction();
|
||||
});
|
||||
try {
|
||||
tv = V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2);
|
||||
tv.setText("取消\n求助");
|
||||
tv.setVisibility(View.VISIBLE);
|
||||
tv.setBackgroundResource(R.drawable.bg_v2x_event_live_show);
|
||||
tv.setOnClickListener(v -> {
|
||||
//调用取消求助接口
|
||||
// TODO: 2020/5/18 回调,显示对话框
|
||||
doAction();
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,24 +2,22 @@ package com.mogo.module.v2x.scenario.scene.seek;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -81,35 +79,24 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
void onClickRight();
|
||||
}
|
||||
|
||||
boolean isShown;
|
||||
WindowManager windowManager;
|
||||
private boolean isShown;
|
||||
private WindowManagerView windowManager;
|
||||
|
||||
public void show() {
|
||||
Logger.d(TAG, "使用windowManager实现");
|
||||
if (!isShown) {
|
||||
windowManager = (WindowManager) mContext.getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
|
||||
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
try {
|
||||
Logger.d(TAG, "使用windowManager实现");
|
||||
if (!isShown) {
|
||||
windowManager = new WindowManagerView.Builder(
|
||||
V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
|
||||
).contentView(this).build();
|
||||
windowManager.show();
|
||||
isShown = true;
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
|
||||
unRegisterVoiceCmd();
|
||||
registerVoiceCmd();
|
||||
}
|
||||
layoutParams.format = PixelFormat.TRANSLUCENT;
|
||||
layoutParams.gravity = Gravity.START | Gravity.TOP;
|
||||
// mWindowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
// FLAG_LAYOUT_IN_SCREEN:将window放置在整个屏幕之内,无视其他的装饰(比如状态栏); FLAG_NOT_TOUCH_MODAL:不阻塞事件传递到后面的窗口
|
||||
layoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
layoutParams.width = WindowUtils.getScreenWidth(mContext);
|
||||
layoutParams.height = WindowUtils.getScreenHeight(mContext);
|
||||
//后面变暗区域透明...
|
||||
layoutParams.dimAmount = 0;
|
||||
layoutParams.x = 0;
|
||||
layoutParams.y = 0;
|
||||
windowManager.addView(this, layoutParams);
|
||||
isShown = true;
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
|
||||
unRegisterVoiceCmd();
|
||||
registerVoiceCmd();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,19 +112,16 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
|
||||
public void dismiss() {
|
||||
if (isShown && windowManager != null) {
|
||||
windowManager.removeViewImmediate(this);
|
||||
windowManager = null;
|
||||
windowManager.dismiss();
|
||||
isShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//放弃求助
|
||||
private void handleLeft() {
|
||||
if (mListener != null) {
|
||||
mListener.onClickLeft();
|
||||
}
|
||||
|
||||
unRegisterVoiceCmd();
|
||||
}
|
||||
|
||||
@@ -147,7 +131,6 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
mListener.onClickRight();
|
||||
}
|
||||
unRegisterVoiceCmd();
|
||||
|
||||
}
|
||||
|
||||
private void registerVoiceCmd() {
|
||||
|
||||
@@ -7,12 +7,12 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.module.v2x.utils.ADASUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
@@ -79,7 +79,6 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
@Override
|
||||
public void show() {
|
||||
showWindow();
|
||||
drawPOI();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,7 +144,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
(int) V2XUtils.getApp().getResources().getDimension(R.dimen.module_v2x_fatigue_driving_window_height_ground));
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addView(mV2XWindow.getView(), layoutParams,this);
|
||||
.addView(mV2XWindow.getView(), layoutParams, this);
|
||||
mV2XWindow.show(mMarkerEntity);
|
||||
} else {
|
||||
blockingQueue.offer(mMarkerEntity);
|
||||
@@ -197,6 +196,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
@Override
|
||||
public void onViewAdded(View view) {
|
||||
Logger.d(MODULE_NAME, "展示 Window 动画结束");
|
||||
drawPOI();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,5 +213,8 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
@Override
|
||||
public void beforeViewRemoveAnim(View view) {
|
||||
Logger.d(MODULE_NAME, "关闭 Window 开始");
|
||||
// 重置场景提示的消息
|
||||
setV2XMessageEntity(null);
|
||||
clearPOI();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -75,12 +74,12 @@ public class MarkerUtils {
|
||||
final int paddingRight;
|
||||
final int paddingLeft;
|
||||
if (CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X) {
|
||||
paddingTop = WindowUtils.dip2px(context, 150);
|
||||
paddingTop = WindowUtils.dip2px(context, 250);
|
||||
paddingBottom = WindowUtils.dip2px(context, 100);
|
||||
paddingRight = WindowUtils.dip2px(context, 100);
|
||||
paddingLeft = WindowUtils.dip2px(context, 475);
|
||||
} else {
|
||||
paddingTop = WindowUtils.dip2px(context, 170);
|
||||
paddingTop = WindowUtils.dip2px(context, 370);
|
||||
paddingBottom = WindowUtils.dip2px(context, 100);
|
||||
paddingRight = WindowUtils.dip2px(context, 100);
|
||||
paddingLeft = WindowUtils.dip2px(context, 575);
|
||||
@@ -110,32 +109,10 @@ public class MarkerUtils {
|
||||
* @param zoomScale 缩放级别
|
||||
*/
|
||||
public static void resetMapZoom(float zoomScale) {
|
||||
V2XServiceManager.getMapUIController().changeZoom(zoomScale);
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
V2XServiceManager.getMapUIController().setLockZoom((int) zoomScale);
|
||||
V2XServiceManager.getMapUIController().recoverLockMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据距离调整地图的缩放比例
|
||||
*
|
||||
* @param distance 距离
|
||||
*/
|
||||
public static void changeMapZoomWithDistance(double distance) {
|
||||
Logger.d(V2XConst.MODULE_NAME, "根据距离调整地图的缩放比例:" + distance);
|
||||
if (distance <= 500 && distance > 400) {
|
||||
resetMapZoom(15);
|
||||
} else if (distance <= 400 && distance > 300) {
|
||||
resetMapZoom(16);
|
||||
} else if (distance <= 300 && distance > 200) {
|
||||
resetMapZoom(16.5f);
|
||||
} else if (distance <= 200 && distance > 100) {
|
||||
resetMapZoom(17f);
|
||||
} else if (distance <= 100 && distance >= 0) {
|
||||
resetMapZoom(17.5f);
|
||||
} else if (distance >= 500) {
|
||||
resetMapZoom(12);
|
||||
}
|
||||
// V2XServiceManager.getMapUIController().changeZoom(zoomScale);
|
||||
// // 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
// V2XServiceManager.getMapUIController().setLockZoom((int) zoomScale);
|
||||
V2XServiceManager.getMapUIController().loseLockMode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,10 @@ import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
import com.tencent.rtmp.TXLiveConstants;
|
||||
import com.tencent.rtmp.TXLivePlayConfig;
|
||||
import com.tencent.rtmp.TXLivePlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
|
||||
@@ -53,6 +55,7 @@ public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
private V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() {
|
||||
@Override
|
||||
public void onCallback(String command, Intent intent) {
|
||||
//startHeartLive(mCarLiveInfo);
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
if (mCarLiveInfo != null) {
|
||||
@@ -84,6 +87,12 @@ public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
//关键 player 对象与界面 view
|
||||
mLivePlayer.setPlayerView(mTxcVideoView);
|
||||
mLivePlayer.setMute(true);
|
||||
|
||||
TXLivePlayConfig txLivePlayConfig = new TXLivePlayConfig();
|
||||
// 增加重试次数
|
||||
txLivePlayConfig.setConnectRetryCount(30);
|
||||
mLivePlayer.setConfig(txLivePlayConfig);
|
||||
|
||||
mLivePlayer.enableHardwareDecode(true);
|
||||
|
||||
mLoading = findViewById(R.id.loading);
|
||||
@@ -130,6 +139,7 @@ public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
.livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
@Override
|
||||
public void onSuccess(V2XLivePushVoRes result) {
|
||||
Logger.e(MODULE_NAME, "从服务端获取最新直播信息:" + GsonUtil.jsonFromObject(result));
|
||||
mClLoadError.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
try {
|
||||
@@ -159,45 +169,58 @@ public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
* 播放直播流,且开始心跳
|
||||
*/
|
||||
private void playLiveVideo(MarkerCarInfo.CarLiveInfo carLiveInfo) {
|
||||
startHeartLive(carLiveInfo);
|
||||
if (mLivePlayer != null) {
|
||||
mLivePlayer.startPlay(carLiveInfo.getVideoUrl(), TXLivePlayer.PLAY_TYPE_LIVE_RTMP);
|
||||
mLivePlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle bundle) {
|
||||
Logger.w(MODULE_NAME, "播放器:onPlayEvent==" + event + "===bundle===" + bundle);
|
||||
if (event == TXLiveConstants.PLAY_EVT_PLAY_LOADING) {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
} else if (event == TXLiveConstants.PLAY_EVT_PLAY_BEGIN) {
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
} else if (event < 0) {
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("直播获取识别,可以对我说重试", null);
|
||||
stopLive(mCarLiveInfo);
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_REFRESH_CAR_LIVE,
|
||||
v2XVoiceCallbackRefreshListener)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_REFRESH_LIVE_UN_WAKEUP,
|
||||
v2XVoiceCallbackRefreshListener);
|
||||
try {
|
||||
if (mLivePlayer != null) {
|
||||
mLivePlayer.startPlay(carLiveInfo.getVideoUrl(), TXLivePlayer.PLAY_TYPE_LIVE_RTMP);
|
||||
mLivePlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle bundle) {
|
||||
Logger.w(MODULE_NAME,
|
||||
"直播信息= " + GsonUtil.jsonFromObject(carLiveInfo) +
|
||||
"\n播放器:onPlayEvent==" + event +
|
||||
"\nbundle===" + bundle);
|
||||
if (event == TXLiveConstants.PLAY_EVT_PLAY_LOADING) {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
} else if (event == TXLiveConstants.PLAY_EVT_PLAY_BEGIN) {
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
} else if (event < 0) {
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("直播获取失败,可以对我说重试", null);
|
||||
stopLive(mCarLiveInfo);
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_REFRESH_CAR_LIVE,
|
||||
v2XVoiceCallbackRefreshListener)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_REFRESH_LIVE_UN_WAKEUP,
|
||||
v2XVoiceCallbackRefreshListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
//Logger.w(MODULE_NAME, "播放器:onNetStatus===bundle===" + bundle);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
Logger.w(MODULE_NAME, "播放器:onNetStatus===bundle===" + bundle);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
Logger.e(MODULE_NAME, "直播发生异常:carLiveInfo= " + GsonUtil.jsonFromObject(carLiveInfo));
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新直播心跳
|
||||
/**
|
||||
* 刷新直播心跳
|
||||
*
|
||||
* @param carLiveInfo
|
||||
*/
|
||||
private void startHeartLive(MarkerCarInfo.CarLiveInfo carLiveInfo) {
|
||||
try {
|
||||
if (!TextUtils.isEmpty(carLiveInfo.getVideoSn())
|
||||
if (carLiveInfo != null && !TextUtils.isEmpty(carLiveInfo.getVideoSn())
|
||||
&& !TextUtils.isEmpty(carLiveInfo.getVideoChannel())) {
|
||||
V2XServiceManager
|
||||
.getV2XRefreshModel()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_75"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintEnd_toEndOf="@id/ivDialogBg"
|
||||
app:layout_constraintStart_toStartOf="@id/ivDialogBg"
|
||||
@@ -35,7 +35,7 @@
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:background="@drawable/v2x_dialog_left_bg"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivDialogBg"
|
||||
app:layout_constraintEnd_toStartOf="@id/tvDialogRight"
|
||||
@@ -48,7 +48,7 @@
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:background="@drawable/v2x_dialog_right_bg"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivDialogBg"
|
||||
app:layout_constraintEnd_toEndOf="@id/ivDialogBg"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
app:alignContent="flex_start"
|
||||
app:alignItems="center"
|
||||
app:flexDirection="row"
|
||||
android:paddingStart="@dimen/dp_150"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start">
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"zoom": true,
|
||||
"zoomScale": 15,
|
||||
"location": {
|
||||
"lat": 39.9754100000,
|
||||
"lat": 39.9554100000,
|
||||
"lon": 116.4178276100
|
||||
},
|
||||
"userHead": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png",
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
"zoom": true,
|
||||
"zoomScale": 15,
|
||||
"location": {
|
||||
"lat": 39.9754100000,
|
||||
"lon": 116.4178276100
|
||||
"lat": 39.971417,
|
||||
"lon": 116.415853
|
||||
},
|
||||
"userHead": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png",
|
||||
"msgImgUrl": "https://upload.jianshu.io/users/upload_avatars/7663825/7c28763e-002b-4e89-8dea-5b8da210ef2c.jpg"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"location":{
|
||||
"address":"北五环(测试位置不准确)",
|
||||
"angle":270,
|
||||
"lat":39.96155,
|
||||
"lat":39.971417,
|
||||
"lon":116.415853
|
||||
},
|
||||
"noveltyInfo":{
|
||||
@@ -27,7 +27,7 @@
|
||||
"location":{
|
||||
"address":"北五环(测试位置不准确)",
|
||||
"angle":270,
|
||||
"lat":39.968155,
|
||||
"lat":39.971417,
|
||||
"lon":116.415853
|
||||
},
|
||||
"poiType":"10002",
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
{
|
||||
"createTime":1593678359872,
|
||||
"distance":100,
|
||||
"lat":39.96911187,
|
||||
"lon":116.41777396,
|
||||
"lat":39.968678,
|
||||
"lon":116.405467,
|
||||
"sn":"E841CC2018PZD20466",
|
||||
"targetId":20007,
|
||||
"targetName":"故障车",
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.auth.IMogoAuthManager;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.datamanager.IMogoDataManager;
|
||||
@@ -236,4 +237,10 @@ public interface IMogoServiceApis extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
IMogoPassportManager getPassportManagerApi();
|
||||
|
||||
/**
|
||||
* 获取授权服务
|
||||
* @return
|
||||
*/
|
||||
IMogoAuthManager getAuthManagerApi();
|
||||
}
|
||||
|
||||
@@ -220,4 +220,10 @@ public class MogoServicePaths {
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_PASSPORT = "/passport/api";
|
||||
|
||||
/**
|
||||
* 授权服务
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_AGREEMENT = "/agreement/showFragment";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.service.auth;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
public interface IMogoAuthManager extends IMogoModuleProvider {
|
||||
|
||||
/**
|
||||
* 重置授权页面弹起时展示View Context
|
||||
*/
|
||||
void resetContext(Context context);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public interface IMogoSocketManager extends IProvider {
|
||||
* 初始化,各模块不用关心
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param appId 一般为包名
|
||||
* @param appId 一般为包名,不参与通道的建立,一般用于发消息
|
||||
*/
|
||||
void init( Context context, String appId );
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoMapListener getMapListener();
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,9 @@ public
|
||||
*/
|
||||
interface IMogoTicketCallback {
|
||||
|
||||
void onSuccess( String ticket );
|
||||
void onTicketGot( String ticket );
|
||||
|
||||
void onError( int code, String msg );
|
||||
|
||||
void onLoginSuccess(String token, String sn);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.auth.IMogoAuthManager;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.datamanager.IMogoDataManager;
|
||||
@@ -200,6 +201,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance( IMogoPassportManager.class, MogoServicePaths.PATH_PASSPORT );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoAuthManager getAuthManagerApi() {
|
||||
return getApiInstance( IMogoAuthManager.class, MogoServicePaths.PATH_AGREEMENT );
|
||||
}
|
||||
|
||||
private static < T extends IProvider > T getApiInstance( Class< T > clazz, String path ) {
|
||||
T inst = SingletonsHolder.get( clazz );
|
||||
if ( inst == null ) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
import com.zhidao.autopilot.support.api.IAutopilotServiceStatusListener;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -69,11 +70,23 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void showADAS() {
|
||||
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
if ( !isProcessRunning( AbsMogoApplication.getApp(), getPackageUid( AbsMogoApplication.getApp(), "com.zhidiao.autopilot" ) )
|
||||
|| mIsReleased ) {
|
||||
init( AbsMogoApplication.getApp() );
|
||||
}
|
||||
init( AbsMogoApplication.getApp() );
|
||||
AutopilotServiceManage.getInstance().registerAutopilotServiceStatusListener( new IAutopilotServiceStatusListener() {
|
||||
@Override
|
||||
public void onServiceConnected() {
|
||||
invokeShowADASOperation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected() {
|
||||
|
||||
}
|
||||
} );
|
||||
invokeShowADASOperation();
|
||||
|
||||
}
|
||||
|
||||
private void invokeShowADASOperation() {
|
||||
int delay = CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ? 0 : 100;
|
||||
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
|
||||