Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -91,7 +91,6 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
2
.idea/inspectionProfiles/Project_Default.xml
generated
2
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -30,7 +30,7 @@
|
||||
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||
<option name="myAdditionalJavadocTags" value="description,since:" />
|
||||
<option name="myAdditionalJavadocTags" value="description,since:,date" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
@@ -27,13 +27,10 @@ import com.mogo.module.main.service.MogoMainService;
|
||||
import com.mogo.module.push.base.PushUIConstants;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.service.map.IMogoSmallMapProvider;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.utils.ObuConfig;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.passport.IMogoTicketCallback;
|
||||
import com.mogo.test.crashreport.ITestCrashReportProvider;
|
||||
import com.mogo.utils.ProcessUtils;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
@@ -59,100 +56,103 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
public void onCreate() {
|
||||
initDebugConfig();
|
||||
super.onCreate();
|
||||
if ( !shouldInit() ) {
|
||||
if (!shouldInit()) {
|
||||
return;
|
||||
}
|
||||
// Crash 日志收集
|
||||
final long start = System.currentTimeMillis();
|
||||
CrashSystem crashSystem = CrashSystem.getInstance( this );
|
||||
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
||||
crashSystem.init();
|
||||
//设置debug模式,日志不上传
|
||||
crashSystem.setDebug( BuildConfig.DEBUG );
|
||||
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
|
||||
crashSystem.setDebug(BuildConfig.DEBUG);
|
||||
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
|
||||
|
||||
if( DebugConfig.isNeedLoadGuideModule() ){
|
||||
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_GUIDE, MogoModulePaths.PATH_GUIDE ) );
|
||||
if (DebugConfig.isNeedLoadGuideModule()) {
|
||||
MogoModulePaths.addModule(new MogoModule(MogoModulePaths.PATH_GUIDE, MogoModulePaths.PATH_GUIDE));
|
||||
}
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME));
|
||||
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MEDIA, MogoModulePaths.PATH_MEDIA ) );
|
||||
if (DebugConfig.isLauncher()) {
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoModulePaths.PATH_MEDIA, MogoModulePaths.PATH_MEDIA));
|
||||
}
|
||||
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG ) );
|
||||
MogoModulePaths.addModule(new MogoModule(ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG));
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
|
||||
if ( DebugConfig.isMapBased() ) {
|
||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS));
|
||||
if (DebugConfig.isMapBased()) {
|
||||
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
}
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( ShareConstants.TAG, ShareConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_TANLU_API, "TanluApi" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_TRAFFIC_UPLOAD, "TrafficUpload" ) );
|
||||
MogoModulePaths.addBaseModule(new MogoModule(ShareConstants.TAG, ShareConstants.MODEL_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TANLU_API, "TanluApi"));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TRAFFIC_UPLOAD, "TrafficUpload"));
|
||||
|
||||
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule(new MogoModule(LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME));
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare" ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GAODE_AIMLESS_SHARE, "GaoDeAimlessShare" ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
|
||||
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare"));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GAODE_AIMLESS_SHARE, "GaoDeAimlessShare"));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor"));
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, PushUIConstants.NAME));
|
||||
// 碰撞报警模块
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_CRASH_WARNING, "CrashWarning" ) );
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "CrashWarning"));
|
||||
// MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) );
|
||||
|
||||
// 小地图模块
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider" ) );
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider"));
|
||||
//前方碰撞预警
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider" ) );
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider"));
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake" ) );
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake"));
|
||||
|
||||
if ( !DebugConfig.isLauncher() ) {
|
||||
PersistentManager.getInstance().initManager( this );
|
||||
Intent intent = new Intent( this, MogoMainService.class );
|
||||
startService( intent );
|
||||
if (!DebugConfig.isLauncher()) {
|
||||
PersistentManager.getInstance().initManager(this);
|
||||
Intent intent = new Intent(this, MogoMainService.class);
|
||||
startService(intent);
|
||||
}
|
||||
|
||||
LeakCanary.install( this );
|
||||
LeakCanary.install(this);
|
||||
|
||||
// debug 下初始化 bugly 上报
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
ARouter.getInstance().navigation( ITestCrashReportProvider.class );
|
||||
if (DebugConfig.isDebug()) {
|
||||
ARouter.getInstance().navigation(ITestCrashReportProvider.class);
|
||||
}
|
||||
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldInit() {
|
||||
Logger.w( TAG, "evaluate shouldInit() with: %s", ProcessUtils.getProcessName( Process.myPid() ) );
|
||||
return ProcessUtils.isMainProcess( this );
|
||||
Logger.w(TAG, "evaluate shouldInit() with: %s", ProcessUtils.getProcessName(Process.myPid()));
|
||||
return ProcessUtils.isMainProcess(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* BuildConfig中渠道配置赋值
|
||||
*/
|
||||
private void initDebugConfig() {
|
||||
DebugConfig.setNetMode( BuildConfig.NET_ENV );
|
||||
DebugConfig.setDebug( BuildConfig.DEBUG );
|
||||
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
|
||||
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
|
||||
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
|
||||
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
|
||||
DebugConfig.setUseMockObuData( false );
|
||||
DebugConfig.setNetMode(BuildConfig.NET_ENV);
|
||||
DebugConfig.setDebug(BuildConfig.DEBUG);
|
||||
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE);
|
||||
DebugConfig.setUseCustomNavi(BuildConfig.USE_CUSTOM_NAVI);
|
||||
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
|
||||
DebugConfig.setActiveAIAssistFlag(BuildConfig.AI_ASSIST_ACTIVE_STAUTS);
|
||||
DebugConfig.setUseMockObuData(false);
|
||||
ObuConfig.useObuLocation = false;
|
||||
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
|
||||
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
|
||||
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
|
||||
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
|
||||
DebugConfig.setSkinSupported( BuildConfig.IS_SKIN_SUPPORTED );
|
||||
DebugConfig.setSupportedSearchDestinationOnlineCarList( BuildConfig.IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST );
|
||||
DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush( BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH );
|
||||
DebugConfig.setSupportLauncherCardRefreshStrategy( BuildConfig.IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY );
|
||||
DebugConfig.setMapBased( BuildConfig.IS_MAP_BASED );
|
||||
DebugConfig.setNeedLoadGuideModule( BuildConfig.IS_NEED_LOAD_GUIDE_MODULE );
|
||||
DebugConfig.setNeedHideAdasWhenShare( BuildConfig.IS_NEED_HIDE_ADAS_WHEN_SHARE );
|
||||
DebugConfig.setNeedUploadCoordinatesInTime( BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME );
|
||||
DebugConfig.setUseAdasRtkLocationInfo( BuildConfig.IS_USE_ADAS_RTK_LOCATION_INFO );
|
||||
DebugConfig.setCarMachineType(BuildConfig.CAR_MACHINE_TYPE);
|
||||
DebugConfig.setProductFlavor(BuildConfig.FLAVOR_product);
|
||||
DebugConfig.setSocketAppId(BuildConfig.SOCKET_APP_ID);
|
||||
DebugConfig.setRoadEventAnimated(BuildConfig.ROAD_EVENT_ANIMATED);
|
||||
DebugConfig.setSkinSupported(BuildConfig.IS_SKIN_SUPPORTED);
|
||||
DebugConfig.setSupportedSearchDestinationOnlineCarList(BuildConfig.IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST);
|
||||
DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush(BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH);
|
||||
DebugConfig.setSupportLauncherCardRefreshStrategy(BuildConfig.IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY);
|
||||
DebugConfig.setMapBased(BuildConfig.IS_MAP_BASED);
|
||||
DebugConfig.setNeedLoadGuideModule(BuildConfig.IS_NEED_LOAD_GUIDE_MODULE);
|
||||
DebugConfig.setNeedHideAdasWhenShare(BuildConfig.IS_NEED_HIDE_ADAS_WHEN_SHARE);
|
||||
DebugConfig.setNeedUploadCoordinatesInTime(BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME);
|
||||
DebugConfig.setUseAdasRtkLocationInfo(BuildConfig.IS_USE_ADAS_RTK_LOCATION_INFO);
|
||||
DebugConfig.setObuType(SharedPrefsMgr.getInstance(this).getInt("OBU_TYPE", DebugConfig.OBU_TYPE_CIDI));
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
protected void init() {
|
||||
super.init();
|
||||
final IMogoServiceApis apis = MogoApisHandler.getInstance().getApis();
|
||||
prepareBaseService( apis, 0L );
|
||||
prepareBaseService(apis, 0L);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -173,7 +173,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoLocation location = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(this).getLastKnowLocation();
|
||||
if (location == null) {
|
||||
return null;
|
||||
}else {
|
||||
} else {
|
||||
return new HttpSimpleLocation(location.getCityCode(), location.getLatitude(), location.getLongitude());
|
||||
}
|
||||
}
|
||||
@@ -181,26 +181,26 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
/**
|
||||
* 基础服务:passport、location、socket
|
||||
*/
|
||||
private void prepareBaseService( IMogoServiceApis apis, long delay ) {
|
||||
private void prepareBaseService(IMogoServiceApis apis, long delay) {
|
||||
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
// 第三方平台的sn是服务端生成的,所以必须在返回后才能开启
|
||||
if ( TextUtils.isEmpty( Utils.getSn() ) ) {
|
||||
preparePassportEnvironment( apis, () -> {
|
||||
prepareSocketAndLocationServices( apis );
|
||||
} );
|
||||
if (TextUtils.isEmpty(Utils.getSn())) {
|
||||
preparePassportEnvironment(apis, () -> {
|
||||
prepareSocketAndLocationServices(apis);
|
||||
});
|
||||
} else {
|
||||
preparePassportEnvironment( apis, null );
|
||||
prepareSocketAndLocationServices( apis );
|
||||
preparePassportEnvironment(apis, null);
|
||||
prepareSocketAndLocationServices(apis);
|
||||
}
|
||||
}, delay );
|
||||
}, delay);
|
||||
}
|
||||
|
||||
private void preparePassportEnvironment( IMogoServiceApis apis, Runnable after ) {
|
||||
private void preparePassportEnvironment(IMogoServiceApis apis, Runnable after) {
|
||||
// 配置云服务API
|
||||
MoGoAiCloudClientConfig clientConfig = MoGoAiCloudClientConfig.getInstance();
|
||||
// 设置网络环境:HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
|
||||
switch ( DebugConfig.getNetMode() ) {
|
||||
switch (DebugConfig.getNetMode()) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_DEV);
|
||||
break;
|
||||
@@ -256,19 +256,19 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MoGoAiCloudClient.getInstance().init(this, clientConfig);
|
||||
}
|
||||
|
||||
private void prepareSocketAndLocationServices( IMogoServiceApis apis ) {
|
||||
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() );
|
||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
|
||||
private void prepareSocketAndLocationServices(IMogoServiceApis apis) {
|
||||
apis.getSocketManagerApi(getApplicationContext()).init(getApplicationContext(), DebugConfig.getSocketAppId());
|
||||
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
|
||||
apis.getLocationInfoApi().start();
|
||||
apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
|
||||
apis.getLocationInfoApi().provideLocation( location );
|
||||
} );
|
||||
apis.getMapServiceApi().getSingletonLocationClient(getApplicationContext()).addLocationListener(location -> {
|
||||
apis.getLocationInfoApi().provideLocation(location);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext( Context base ) {
|
||||
super.attachBaseContext( base );
|
||||
BoostMultiDex.install( base );
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
BoostMultiDex.install(base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public abstract class AbsMogoApplication extends Application {
|
||||
/**
|
||||
* 忽略 https 验证
|
||||
*
|
||||
* @return
|
||||
* @return {@link SSLContext}
|
||||
* @throws Exception
|
||||
*/
|
||||
private static SSLContext getSslContext() throws Exception {
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public
|
||||
/**
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/6/8
|
||||
*
|
||||
|
||||
@@ -12,11 +12,11 @@ import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
public class SpStorage {
|
||||
|
||||
public static String getTicket() {
|
||||
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "ticket" );
|
||||
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "token" );
|
||||
}
|
||||
|
||||
public static void setTicket( String ticket ) {
|
||||
SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).putString( "ticket", ticket );
|
||||
SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).putString( "token", ticket );
|
||||
}
|
||||
|
||||
public static String getNavigationTarget(){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.utils;
|
||||
|
||||
/**
|
||||
/*
|
||||
* 2016/1/1 by congtaowang
|
||||
*
|
||||
* @Version 1.0
|
||||
@@ -28,7 +28,7 @@ public final class TipToast {
|
||||
private static final String TAG = "TipToast";
|
||||
|
||||
private static Toast sToast = null;
|
||||
private static final Object sSyncObject = new Object();
|
||||
private static final byte[] sSyncObject = new byte[0];
|
||||
private static Handler sHandler = null;
|
||||
private static Context sContext;
|
||||
private static ToastViewGenerator sGenerator;
|
||||
|
||||
@@ -155,21 +155,21 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.63
|
||||
MOGO_NETWORK_VERSION=1.0.67
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.63
|
||||
MOGO_PASSPORT_VERSION=1.0.67
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.63
|
||||
MOGO_SOCKET_VERSION=1.0.67
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.63
|
||||
MOGO_REALTIME_VERSION=1.0.67
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.63
|
||||
MOGO_TANLU_VERSION=1.0.67
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.63
|
||||
MOGO_LIVE_VERSION=1.0.67
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.63
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.67
|
||||
|
||||
######## Foundation MogoAiCloud Moduletruetr
|
||||
######## Foundation MogoAiCloud Module
|
||||
# mogoAiCloud apk services
|
||||
MOGO_AICLOUD_SERVICES_APK_VERSION=1.0.0-SNAPSHOT
|
||||
# mogoAiCloud sdk services
|
||||
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.2'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.5'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public
|
||||
* @author congtaowang
|
||||
* @since 2020/6/9
|
||||
*
|
||||
* 如果已经激活设备,则按照正常流程打开语音,否则需要连续点击5下才能打开
|
||||
* 如果已经激活设备,则按照正常流程打开语音,否则需要连续点击5下小智才能激活语音功能
|
||||
*/
|
||||
class OnAiAssistClickListener implements View.OnClickListener {
|
||||
|
||||
|
||||
@@ -126,6 +126,14 @@ public class V2XWarningEntity implements Serializable {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public long getShowTime() {
|
||||
return showTime;
|
||||
}
|
||||
|
||||
public void setShowTime(long showTime) {
|
||||
this.showTime = showTime;
|
||||
}
|
||||
|
||||
|
||||
public void setStopLineDistance(double stopLineDistance) {
|
||||
this.stopLineDistance = stopLineDistance;
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.mogo.module.extensions.utils;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.os.Handler;
|
||||
import android.transition.Transition;
|
||||
import android.util.ArrayMap;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -36,15 +33,18 @@ public class TopViewNoLinkageAnimHelper {
|
||||
private ConstraintLayout topMotionLayout;
|
||||
private TopView topContainerNoLinkage;
|
||||
|
||||
private float topHeight = 0f;
|
||||
private volatile boolean isTopViewOut = true;
|
||||
private final List<View> viewCaches = new ArrayList<>();
|
||||
private final Map<View, IMogoTopViewStatusListener> statusListenerMap = new ArrayMap<>();
|
||||
|
||||
private Handler handler = new Handler();
|
||||
private View currentAnimatingView = null;
|
||||
|
||||
private IMogoMapUIController mogoMapUIController;
|
||||
private volatile static TopViewNoLinkageAnimHelper instance = null;
|
||||
|
||||
private TopViewNoLinkageAnimHelper() {
|
||||
}
|
||||
|
||||
private volatile static TopViewNoLinkageAnimHelper instance = null;
|
||||
|
||||
public static TopViewNoLinkageAnimHelper getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (TopViewNoLinkageAnimHelper.class) {
|
||||
@@ -56,8 +56,6 @@ public class TopViewNoLinkageAnimHelper {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private IMogoMapUIController mogoMapUIController;
|
||||
|
||||
public void setIMogoMapUIController(IMogoMapUIController mogoMapUIController) {
|
||||
this.mogoMapUIController = mogoMapUIController;
|
||||
}
|
||||
@@ -73,12 +71,6 @@ public class TopViewNoLinkageAnimHelper {
|
||||
topContainerNoLinkage.setSlideListener(this::startLatestTopOutAnim);
|
||||
}
|
||||
|
||||
private volatile boolean isTopViewOut = true;
|
||||
private List<View> viewCaches = new ArrayList<>();
|
||||
private Map<View, IMogoTopViewStatusListener> statusListenerMap = new ArrayMap<>();
|
||||
|
||||
private View currentAnimatingView = null;
|
||||
|
||||
public void startTopInAnim(View view, LayoutParams params,
|
||||
IMogoTopViewStatusListener statusListener) {
|
||||
|
||||
@@ -258,12 +250,12 @@ public class TopViewNoLinkageAnimHelper {
|
||||
topContainerNoLinkage = null;
|
||||
}
|
||||
|
||||
public void enterVrMode(){
|
||||
public void enterVrMode() {
|
||||
removeAllView();
|
||||
topContainerNoLinkage.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_no_link_width_in_vr_mode);
|
||||
}
|
||||
|
||||
public void exitVrMode(){
|
||||
public void exitVrMode() {
|
||||
removeAllView();
|
||||
topContainerNoLinkage.getLayoutParams().width = LayoutParams.MATCH_PARENT;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<!-- module_map_layout_navi_info_panel.xml-->
|
||||
<dimen name="module_ext_top_view_width">1058px</dimen>
|
||||
<dimen name="module_ext_top_view_width_in_vr_mode">822px</dimen>
|
||||
<dimen name="module_ext_top_view_no_link_width_in_vr_mode">615px</dimen>
|
||||
<dimen name="module_ext_top_view_no_link_width_in_vr_mode">583px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel_width">544px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel_height">117px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel_small_height">80px</dimen>
|
||||
|
||||
@@ -54,7 +54,7 @@ public class V2XStatusManager {
|
||||
if (mLocation == null) {
|
||||
mLocation = new MogoLocation();
|
||||
}
|
||||
//Logger.d(V2XConst.MODULE_NAME, "当前车辆位置:" + mLocation.toString());
|
||||
Logger.d(V2XConst.MODULE_NAME, "当前车辆位置:" + mLocation.toString());
|
||||
return mLocation;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.module.v2x.entity.net;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 4/8/21 4:52 PM
|
||||
* 最优路线推荐
|
||||
*/
|
||||
public class V2XRouteRes {
|
||||
private String sn;//车机SN
|
||||
private String roadId;//当前道路唯一标识
|
||||
private int laneNum;//当前车道唯一标识
|
||||
private int mostLaneNum;//最优车道号
|
||||
private double mostSpeed;//最优车道平均速度
|
||||
private List locusList;//线性经纬度轨迹列表
|
||||
private double locusLat;
|
||||
private double locusLon;
|
||||
|
||||
private double heading;// 车头朝向
|
||||
private long satelliteTime;//定位卫星时间
|
||||
private long showTime;//展示时间
|
||||
|
||||
private int warningType;// 1-最优车道,2-安全距离,3-交通预警
|
||||
|
||||
|
||||
}
|
||||
@@ -23,6 +23,8 @@ import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.alarm.V2XAlarmServer;
|
||||
import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.observer.CarLocationSubject;
|
||||
import com.mogo.module.v2x.observer.V2XOptimalRouteObserver;
|
||||
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
|
||||
import com.mogo.module.v2x.scenario.scene.obu.V2XObuEventScenario;
|
||||
import com.mogo.module.v2x.utils.ADASUtils;
|
||||
@@ -50,7 +52,10 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* desc : V2X中用到的位置监听。处理刷新频率,以及位置改变是否触发道路事件警报
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XLocationListener implements IMogoLocationListener, CarStatusListener, IMogoCarLocationChangedListener2 {
|
||||
public class V2XLocationListener
|
||||
implements IMogoLocationListener,
|
||||
CarStatusListener,
|
||||
IMogoCarLocationChangedListener2 {
|
||||
private String TAG = "V2XLocationListener";
|
||||
|
||||
private MogoLocation mLastCarLocation;
|
||||
@@ -61,7 +66,14 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
|
||||
private static V2XLocationListener mV2XLocationListener;
|
||||
|
||||
private CarLocationSubject mCarLocationSubject;
|
||||
|
||||
private V2XLocationListener() {
|
||||
mCarLocationSubject = new CarLocationSubject();
|
||||
// 注册最优路线的推荐观察者
|
||||
mCarLocationSubject.registerObserver(
|
||||
V2XOptimalRouteObserver.TYPE,
|
||||
V2XOptimalRouteObserver.getInstance());
|
||||
}
|
||||
|
||||
public synchronized static V2XLocationListener getInstance() {
|
||||
@@ -74,22 +86,22 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged( MogoLatLng latLng ) {
|
||||
public void onCarLocationChanged(MogoLatLng latLng) {
|
||||
// do not impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location location ) {
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
MogoLocation loc = new MogoLocation();
|
||||
loc.setTime( loc.getTime());
|
||||
loc.setAccuracy( location.getAccuracy() );
|
||||
loc.setSpeed( location.getSpeed());
|
||||
loc.setLongitude( location.getLongitude() );
|
||||
loc.setLatitude( location.getLatitude() );
|
||||
loc.setAltitude( location.getAltitude() );
|
||||
loc.setBearing( location.getBearing() );
|
||||
loc.setProvider( location.getProvider() );
|
||||
onLocationChangedImpl( loc );
|
||||
loc.setTime(loc.getTime());
|
||||
loc.setAccuracy(location.getAccuracy());
|
||||
loc.setSpeed(location.getSpeed());
|
||||
loc.setLongitude(location.getLongitude());
|
||||
loc.setLatitude(location.getLatitude());
|
||||
loc.setAltitude(location.getAltitude());
|
||||
loc.setBearing(location.getBearing());
|
||||
loc.setProvider(location.getProvider());
|
||||
onLocationChangedImpl(loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,8 +109,9 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
// onLocationChangedImpl(location);
|
||||
}
|
||||
|
||||
private void onLocationChangedImpl(MogoLocation location){
|
||||
private void onLocationChangedImpl(MogoLocation location) {
|
||||
try {
|
||||
mCarLocationSubject.setCarLocation(location);
|
||||
//Logger.d(V2XConst.MODULE_NAME, "V2X预警--onLocationChanged: " + GsonUtil.jsonFromObject(location));
|
||||
// 刷新角度
|
||||
getCurrentCarAngle(location);
|
||||
@@ -143,8 +156,12 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
if (mMogoPolyline != null && (V2XServiceManager.getMoGoV2XStatusManager().isRoadEventPOIShow()
|
||||
|| V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpPOIShow())
|
||||
&& V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng() != null) {
|
||||
mMogoPolyline.setPoints(Arrays.asList(new MogoLatLng(location.getLatitude(), location.getLongitude()),
|
||||
V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng()));
|
||||
|
||||
// 取出原有的绘制线的经纬度点
|
||||
List<MogoLatLng> pointsOdl = mMogoPolyline.getPoints();
|
||||
// 重新设置第一个坐标,也就是当前车辆位置
|
||||
pointsOdl.set(0, new MogoLatLng(location.getLatitude(), location.getLongitude()));
|
||||
mMogoPolyline.setPoints(pointsOdl);
|
||||
|
||||
float zoomLevel = V2XServiceManager.getMapUIController().getZoomLevel();
|
||||
//Logger.d(V2XConst.MODULE_NAME, "当前地图的缩放比例为:" + zoomLevel);
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
package com.mogo.module.v2x.manager.impl;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
@@ -23,15 +24,18 @@ import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XCloundDataManager;
|
||||
import com.mogo.module.v2x.marker.V2XFrontTargetMarkerView;
|
||||
import com.mogo.module.v2x.utils.LocationUtils;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
|
||||
import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER;
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
@@ -44,7 +48,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
private boolean isSelfLineClear;
|
||||
private List fillPoints = new ArrayList();//停止线经纬度合集
|
||||
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
|
||||
@@ -66,21 +69,20 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "direction = " + cloundWarningInfo.getDirection());
|
||||
if (cloundWarningInfo.getDirection() == 1) { //前方
|
||||
//停止线前方画线
|
||||
MogoLatLng newLocation = LocationUtils.getNewLocation((MogoLatLng) fillPoints.get(0), 80, cloundWarningInfo.heading);
|
||||
MogoLatLng newLocation = LocationUtils.getNewLocation((MogoLatLng) fillPoints.get(0), 80, cloundWarningInfo.getAngle());
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//添加停止线marker
|
||||
drawStopLineWith2Resource();
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawStopLine(cloundWarningInfo, newLocation);
|
||||
//添加停止线marker
|
||||
handleStopLine();
|
||||
}, 0);
|
||||
}, 200);
|
||||
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
V2XServiceManager.getMoGoStopPolylineManager().clearLine();
|
||||
|
||||
isSelfLineClear = true;
|
||||
}, 8000);
|
||||
|
||||
@@ -90,7 +92,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
}, 0);
|
||||
}, 200);
|
||||
|
||||
//延迟3秒清理线
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
@@ -118,6 +120,39 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 2D资源绘制停止线
|
||||
* */
|
||||
private void drawStopLineWith2Resource() {
|
||||
|
||||
//自车位置39.97665425796924--116.41769983329762
|
||||
mCloundWarningInfo.setCarLocation(new MogoLatLng(39.97665425796924,116.41769983329762));//测试数据
|
||||
|
||||
MogoLatLng carlo = mCloundWarningInfo.getCarLocation();
|
||||
if (carlo == null) {
|
||||
double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
|
||||
double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
|
||||
carlo = new MogoLatLng(lat, lon);
|
||||
}
|
||||
//自车行驶方向的前方*米的经纬度,该经纬度在停止线上
|
||||
MogoLatLng drawStopLineLon = LocationUtils.getNewLocation(carlo, mCloundWarningInfo.getStopLineDistance(), mCloundWarningInfo.getAngle());
|
||||
Log.d(TAG, "2D资源绘制停止线"+drawStopLineLon);
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.latitude(drawStopLineLon.getLat())
|
||||
.longitude(drawStopLineLon.getLon())
|
||||
.anchor(0.5f, 0.5f)
|
||||
.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
|
||||
|
||||
optionsRipple
|
||||
.icon(ViewUtils.fromView(new EmptyMarkerView(V2XServiceManager.getContext())));
|
||||
IMogoMarker stopLine = V2XServiceManager.getMarkerManager().addMarker(TYPE_MARKER_CLOUD_STOP_LINE_DATA, optionsRipple);
|
||||
stopLine.setInfoWindowAdapter(new SimpleWindow3DAdapter(new V2XFrontTargetMarkerView(V2XServiceManager.getContext())));
|
||||
stopLine.showInfoWindow();
|
||||
// UiThreadHandler.postDelayed(() -> {
|
||||
// stopLine.hideInfoWindow();
|
||||
// }, 8000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制停止线前方线 TODO 需要实时给行人当前位置
|
||||
*/
|
||||
@@ -193,8 +228,21 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
*/
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
// Log.d(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear);
|
||||
//当行人经纬度交点 经纬度不为空,开始画线,否则清理
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear);
|
||||
//当行人经纬度交点 开始画线,否则清理
|
||||
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
|
||||
drawSlefCarLine(latLng);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制自车连线
|
||||
*/
|
||||
private void drawSlefCarLine(Location latLng) {
|
||||
if (!isSelfLineClear) {
|
||||
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
if (mCloundWarningInfo != null) {
|
||||
@@ -223,12 +271,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 补点后的停止线经纬度合集
|
||||
*/
|
||||
@@ -261,7 +303,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
private MogoLatLng getMogoLat(MogoLatLng latlng) {
|
||||
MogoLatLng newLocation = LocationUtils.getNewLocation(latlng, mCloundWarningInfo.getDistance(), mCloundWarningInfo.getDirection());
|
||||
|
||||
return newLocation;
|
||||
return newLocation;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.v2x.MoGoV2XServicePaths;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.MoGoV2XServicePaths;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -66,7 +66,7 @@ public class MoGoV2XPolylineManager implements IMoGoV2XPolylineManager {
|
||||
} else {
|
||||
options.add(V2XServiceManager.getV2XStatusManager().getLocation());
|
||||
}
|
||||
// 目标车辆位置
|
||||
// 目标车辆、道路事件位置
|
||||
options.add(V2XServiceManager.getV2XStatusManager().getTargetMoGoLatLng());
|
||||
|
||||
// 绘制线的对象
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.mogo.module.v2x.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerBaseView;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 前方预警目标物2D资源实现,目前只有停止线,可以按需添加其他类型
|
||||
* @since: 2021/4/9
|
||||
*/
|
||||
public class V2XFrontTargetMarkerView extends MapMarkerBaseView {
|
||||
private String TAG = "V2XFrontTargetMarkerView";
|
||||
|
||||
|
||||
public V2XFrontTargetMarkerView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public V2XFrontTargetMarkerView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public V2XFrontTargetMarkerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(Context context) {
|
||||
LayoutInflater.from( context ).inflate(R.layout.v2x_front_target_info_view, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView(MarkerShowEntity markerShowEntity) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.module.v2x.observer;
|
||||
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 4/9/21 2:14 PM
|
||||
* 当前车辆位置观察者接口
|
||||
*/
|
||||
public abstract class CarLocationObserver {
|
||||
// 更新状态
|
||||
public abstract void update(MogoLocation carLocation);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.mogo.module.v2x.observer;
|
||||
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 4/9/21 2:12 PM
|
||||
* 当前车辆订阅
|
||||
*/
|
||||
public class CarLocationSubject {
|
||||
|
||||
// 车辆位置
|
||||
public MogoLocation carLocation;
|
||||
// 观察者集合
|
||||
private HashMap<String, CarLocationObserver> observers = new HashMap<String, CarLocationObserver>();
|
||||
|
||||
|
||||
/**
|
||||
* 设置新的车辆位置
|
||||
*
|
||||
* @param carLocation 车辆位置
|
||||
*/
|
||||
public void setCarLocation(MogoLocation carLocation) {
|
||||
this.carLocation = carLocation;
|
||||
notifyAllObservers();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加观察者
|
||||
*
|
||||
* @param observerType 观察者类型
|
||||
* @param observer 新的观察者
|
||||
*/
|
||||
public void registerObserver(String observerType, CarLocationObserver observer) {
|
||||
observers.put(observerType, observer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除指定类型的观察者
|
||||
*
|
||||
* @param observerType 观察者类型
|
||||
*/
|
||||
public void removeObserver(String observerType) {
|
||||
observers.remove(observerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有观察者更新
|
||||
*/
|
||||
private void notifyAllObservers() {
|
||||
Set<String> keySet = observers.keySet();
|
||||
for (String s : keySet) {
|
||||
CarLocationObserver observer = observers.get(s);
|
||||
if (observer != null) {
|
||||
observer.update(carLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.mogo.module.v2x.observer;
|
||||
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.v2x.overlay.V2XOptimalRouteOverlay;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 4/9/21 2:38 PM
|
||||
* 最优路线推荐
|
||||
*/
|
||||
public class V2XOptimalRouteObserver extends CarLocationObserver {
|
||||
public static String TYPE = "V2XOptimalRouteObserver";
|
||||
|
||||
private static V2XOptimalRouteObserver v2XOptimalRouteObserver;
|
||||
//最优路线覆盖物绘制
|
||||
private V2XOptimalRouteOverlay mV2XOptimalRouteOverlay;
|
||||
// 要绘制的数据
|
||||
private List<double[]> polylinePoint;
|
||||
|
||||
public static V2XOptimalRouteObserver getInstance() {
|
||||
if (v2XOptimalRouteObserver == null) {
|
||||
synchronized (V2XOptimalRouteObserver.class) {
|
||||
if (v2XOptimalRouteObserver == null) {
|
||||
v2XOptimalRouteObserver = new V2XOptimalRouteObserver();
|
||||
}
|
||||
}
|
||||
}
|
||||
return v2XOptimalRouteObserver;
|
||||
}
|
||||
|
||||
private V2XOptimalRouteObserver() {
|
||||
mV2XOptimalRouteOverlay = new V2XOptimalRouteOverlay();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置推荐路线
|
||||
*
|
||||
* @param polylinePoint 推荐的路线
|
||||
*/
|
||||
public void setPolylinePoint(List<double[]> polylinePoint) {
|
||||
this.polylinePoint = polylinePoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(MogoLocation carLocation) {
|
||||
mV2XOptimalRouteOverlay.draw(carLocation, polylinePoint);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.module.v2x.overlay;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.utils.LocationUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 最优路线推荐的图覆盖物
|
||||
*
|
||||
* @author donghongyu
|
||||
* @date 4/8/21 6:06 PM
|
||||
*/
|
||||
public class V2XOptimalRouteOverlay {
|
||||
private IMogoPolyline mMoGoPolyline;
|
||||
// 连接线参数
|
||||
private MogoPolylineOptions mPolylineOptions;
|
||||
// 线路径集合
|
||||
private List<MogoLatLng> mPolylinePointList;
|
||||
|
||||
public V2XOptimalRouteOverlay() {
|
||||
mPolylineOptions = new MogoPolylineOptions();
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(0xFFF95959);
|
||||
// 线条粗细,渐变,渐变色值
|
||||
mPolylineOptions.width(25).useGradient(true).colorValues(colors);
|
||||
// 绘制路径集合
|
||||
mPolylinePointList = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制最优路线
|
||||
*
|
||||
* @param polylinePoint 要绘制的经纬度度集合
|
||||
*/
|
||||
public IMogoPolyline draw(MogoLocation carLocal, List<double[]> polylinePoint) {
|
||||
if (mMoGoPolyline != null) {
|
||||
mMoGoPolyline.remove();
|
||||
mPolylinePointList.clear();
|
||||
}
|
||||
if (polylinePoint != null) {
|
||||
// 将当前车辆位置放进去
|
||||
mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
|
||||
// 过滤后台推送的推荐路线集合
|
||||
for (double[] polyline : polylinePoint) {
|
||||
MogoLatLng pointMoGoLatLng = new MogoLatLng(polyline[1], polyline[0]);
|
||||
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
|
||||
if (LocationUtils.isPointOnCarFront(carLocal, pointMoGoLatLng)) {
|
||||
mPolylinePointList.add(pointMoGoLatLng);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 替换路径集合
|
||||
mPolylineOptions.points(mPolylinePointList);
|
||||
// 绘制线
|
||||
mMoGoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(mPolylineOptions);
|
||||
return mMoGoPolyline;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,11 +104,12 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
mV2XScenario = new V2XRecommendRouteScenario();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW:
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
mV2XScenario = new V2XOptimalRouteVREventScenario();
|
||||
} else {
|
||||
mV2XScenario = null;
|
||||
}
|
||||
// if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
//
|
||||
// } else {
|
||||
// mV2XScenario = null;
|
||||
// }
|
||||
mV2XScenario = new V2XOptimalRouteVREventScenario();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP:
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_LEFT:
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.mogo.utils.TipToast;
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/5/15 5:37 PM
|
||||
* desc : TODO 演示使用的推送单车机直播场景
|
||||
* desc : TODO 推送直播场景 非演示
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XPushLiveCarScenario extends AbsV2XScenario<V2XPushMessageEntity> implements IMogoTopViewStatusListener {
|
||||
@@ -44,11 +44,9 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario<V2XPushMessageEntity>
|
||||
show();
|
||||
} else {
|
||||
TipToast.shortTip("附近没有可直播车机");
|
||||
//Logger.e(V2XConst.MODULE_NAME, "直播地址为null");
|
||||
}
|
||||
} else {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
//Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,9 +63,15 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario<V2XPushMessageEntity>
|
||||
int height = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_see_live_window_height_vr : R.dimen.module_v2x_event_see_live_window_height);
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(width, height);
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
|
||||
} else {
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addView(getV2XWindow().getView(), layoutParams, this);
|
||||
}
|
||||
getV2XWindow().show(getV2XMessageEntity().getContent());
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setLiveCarWindowShow(TAG, true);
|
||||
}
|
||||
@@ -111,23 +115,19 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario<V2XPushMessageEntity>
|
||||
|
||||
@Override
|
||||
public void onViewAdded(View view) {
|
||||
//Logger.d(MODULE_NAME, "展示 Window 动画结束");
|
||||
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), getV2XMessageEntity().getContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRemoved(View view) {
|
||||
//Logger.d(MODULE_NAME, "关闭 Window 动画结束");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeViewAddAnim(View view) {
|
||||
//Logger.d(MODULE_NAME, "展示 Window 开始");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeViewRemoveAnim(View view) {
|
||||
//Logger.d(MODULE_NAME, "关闭 Window 开始");
|
||||
// 重置场景提示的消息
|
||||
setV2XMessageEntity(null);
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setLiveCarWindowShow(TAG, false);
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@@ -19,7 +20,6 @@ import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.module.v2x.view.V2XLiveGSYVideoView;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
@@ -27,20 +27,18 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/4/24 11:34 AM
|
||||
* desc : TODO 演示使用的推送单车机直播场景
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XPushLiveCarWindow extends V2XBasWindow implements IV2XWindow<V2XPushMessageEntity> {
|
||||
|
||||
private Context mContext;
|
||||
private V2XLiveGSYVideoView mV2XLiveGSYVideoView;
|
||||
private MogoImageView mIvReportHead;
|
||||
private ImageView pushVideoClose;
|
||||
|
||||
// 弹窗状态监听
|
||||
private V2XWindowStatusListener mV2XWindowStatusListener;
|
||||
|
||||
// 直播30秒自动关闭
|
||||
private static Handler handlerV2XEvent = new Handler();
|
||||
private static final Handler handlerV2XEvent = new Handler();
|
||||
private static Runnable runnableV2XEvent;
|
||||
|
||||
public V2XPushLiveCarWindow() {
|
||||
@@ -57,17 +55,18 @@ public class V2XPushLiveCarWindow extends V2XBasWindow implements IV2XWindow<V2X
|
||||
|
||||
public V2XPushLiveCarWindow(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mContext = context;
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public void initView(Context context) {
|
||||
//Logger.w(MODULE_NAME, "初始化直播小窗口View。。。。。");
|
||||
LayoutInflater.from(context).inflate(R.layout.item_v2x_push_live_video, this);
|
||||
LayoutInflater.from(context).inflate(V2XServiceManager.getMoGoStatusManager().isVrMode()
|
||||
? R.layout.item_v2x_push_live_video_vr
|
||||
: R.layout.item_v2x_push_live_video, this);
|
||||
// 详情列表
|
||||
mV2XLiveGSYVideoView = findViewById(R.id.videoPlayer);
|
||||
mIvReportHead = findViewById(R.id.ivReportHead);
|
||||
pushVideoClose = findViewById(R.id.pushVideoClose);
|
||||
ImageView pushVideoClose = findViewById(R.id.pushVideoClose);
|
||||
pushVideoClose.setOnClickListener(v -> {
|
||||
//移除窗体
|
||||
V2XServiceManager
|
||||
@@ -114,7 +113,7 @@ public class V2XPushLiveCarWindow extends V2XBasWindow implements IV2XWindow<V2X
|
||||
mV2XWindowStatusListener.onViewClose();
|
||||
}
|
||||
// 停止倒计时
|
||||
if (handlerV2XEvent != null && runnableV2XEvent != null) {
|
||||
if (runnableV2XEvent != null) {
|
||||
handlerV2XEvent.removeCallbacks(runnableV2XEvent);
|
||||
runnableV2XEvent = null;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.utils.ToastUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
@@ -52,7 +53,6 @@ public class V2XVoiceCallLiveBiz {
|
||||
}
|
||||
|
||||
private Context mContext;
|
||||
private V2XVoiceCallLiveScenario mV2XVoiceCallLiveScenario;
|
||||
|
||||
//语音词指令 查看前车视频回调
|
||||
private final V2XVoiceCallbackListener v2XVoiceCallbackFrontLiveCarListener = (command, intent) -> {
|
||||
@@ -106,8 +106,7 @@ public class V2XVoiceCallLiveBiz {
|
||||
LiveStreamManagerImpl.getInstance(AbsMogoApplication.getApp(),
|
||||
MoGoAiCloudClientConfig.getInstance().getThirdPartyDeviceId());
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = buildCallLiveParams(null, null);
|
||||
mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario();
|
||||
mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCallLiveCarWindow());
|
||||
V2XVoiceCallLiveScenario mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario();
|
||||
mV2XVoiceCallLiveScenario.init(v2XMessageEntity);
|
||||
}
|
||||
|
||||
@@ -121,17 +120,18 @@ public class V2XVoiceCallLiveBiz {
|
||||
public void liveUrlResult(String liveUrl) {
|
||||
if (!TextUtils.isEmpty(liveUrl)) {
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = buildCallLiveParams(null, liveUrl);
|
||||
mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario();
|
||||
mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCrossRoadLiveWindow());
|
||||
mV2XVoiceCallLiveScenario.init(v2XMessageEntity);
|
||||
V2XPushLiveCarScenario pushLiveCarScenario = new V2XPushLiveCarScenario();
|
||||
pushLiveCarScenario.init(v2XMessageEntity);
|
||||
} else {
|
||||
Logger.d(MODULE_NAME, "getOpenRoadCameraLive 路口实况直播地址为空");
|
||||
ToastUtils.showShort(R.string.v2x_front_live_url_null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String errorMsg) {
|
||||
Logger.d(MODULE_NAME, "getOpenRoadCameraLive : " + errorMsg);
|
||||
ToastUtils.showShort(R.string.v2x_front_live_url_null);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -148,6 +148,7 @@ public class V2XVoiceCallLiveBiz {
|
||||
v2XPushMessageEntity.setVideoSn(sn);
|
||||
v2XPushMessageEntity.setVideoUrl(liveUrl);
|
||||
v2XPushMessageEntity.setShowWindow(true);
|
||||
v2XPushMessageEntity.setExpireTime(1000 * 30);
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = new V2XMessageEntity<>();
|
||||
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW);
|
||||
v2XMessageEntity.setContent(v2XPushMessageEntity);
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -24,7 +23,10 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
public class V2XVoiceCallLiveCarWindow extends V2XBasWindow
|
||||
implements IV2XWindow<V2XPushMessageEntity> {
|
||||
|
||||
private CarZegoLiveVideoView mV2XCarLiveVideoView;
|
||||
private static final int COUNT_DOWN_TIMER = 1_000;
|
||||
private static final int ALL_EXPIRE_TIMER = 1_000 * 30;
|
||||
private static int EXPIRE_TIMER = ALL_EXPIRE_TIMER;
|
||||
|
||||
private TextView tvCountDown;
|
||||
private ImageView ivVideoPlayingSign;
|
||||
private boolean isVideoPlay = false;
|
||||
@@ -32,13 +34,9 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow
|
||||
// 处理道路事件,30秒倒计时
|
||||
private final Handler handlerV2XEvent = new Handler();
|
||||
private Runnable runnableV2XEvent;
|
||||
private static final int COUNT_DOWN_TIMER = 1_000;
|
||||
private static final int ALL_EXPIRE_TIMER = 1_000 * 30;
|
||||
private static int EXPIRE_TIMER = ALL_EXPIRE_TIMER;
|
||||
|
||||
public V2XVoiceCallLiveCarWindow() {
|
||||
this(V2XServiceManager.getContext(), null);
|
||||
Logger.d(MODULE_NAME, "V2XVoiceCallLiveCarWindow INIT");
|
||||
}
|
||||
|
||||
public V2XVoiceCallLiveCarWindow(Context context, AttributeSet attrs) {
|
||||
@@ -52,8 +50,10 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow
|
||||
|
||||
private void initView(Context context) {
|
||||
Logger.w(MODULE_NAME, "V2X===初始化语音呼叫直播视图");
|
||||
LayoutInflater.from(context).inflate(R.layout.window_see_carlive_video, this);
|
||||
mV2XCarLiveVideoView = findViewById(R.id.videoPlayer);
|
||||
LayoutInflater.from(context).inflate(V2XServiceManager.getMoGoStatusManager().isVrMode()
|
||||
? R.layout.window_see_carlive_video_vr
|
||||
: R.layout.window_see_carlive_video, this);
|
||||
CarZegoLiveVideoView mV2XCarLiveVideoView = findViewById(R.id.videoPlayer);
|
||||
tvCountDown = findViewById(R.id.tvCountDown);
|
||||
ivVideoPlayingSign = findViewById(R.id.ivVideoPlayingSign);
|
||||
mV2XCarLiveVideoView.addOnVideoStatusChangeListener(videoPlaying -> {
|
||||
@@ -86,13 +86,10 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow
|
||||
public void close() {
|
||||
// 停止倒计时
|
||||
stopCountDown();
|
||||
if (V2XServiceManager
|
||||
.getMogoTopViewManager().isViewAdded(this)) {
|
||||
//移除窗体
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.removeView(this);
|
||||
}
|
||||
//移除窗体
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.removeView(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,7 +110,6 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow
|
||||
if (runnableV2XEvent == null) {
|
||||
runnableV2XEvent = () -> {
|
||||
EXPIRE_TIMER = EXPIRE_TIMER - COUNT_DOWN_TIMER;
|
||||
Logger.d(MODULE_NAME, "V2X=== Window 30秒倒计时开始,当前 :" + EXPIRE_TIMER / COUNT_DOWN_TIMER + " 秒");
|
||||
tvCountDown.setVisibility(View.VISIBLE);
|
||||
ivVideoPlayingSign.setVisibility(View.VISIBLE);
|
||||
tvCountDown.setText(String.valueOf(EXPIRE_TIMER / COUNT_DOWN_TIMER));
|
||||
@@ -126,12 +122,10 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow
|
||||
} else {
|
||||
handlerV2XEvent.removeCallbacks(runnableV2XEvent);
|
||||
}
|
||||
Logger.d(MODULE_NAME, "V2X=== Window 展示开始倒计时");
|
||||
handlerV2XEvent.postDelayed(runnableV2XEvent, COUNT_DOWN_TIMER);
|
||||
}
|
||||
|
||||
private void stopCountDown() {
|
||||
Logger.d(MODULE_NAME, "V2X=== Window 倒计时停止。。。");
|
||||
if (handlerV2XEvent != null && runnableV2XEvent != null) {
|
||||
handlerV2XEvent.removeCallbacks(runnableV2XEvent);
|
||||
runnableV2XEvent = null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.v2x.scenario.scene.livecar;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -20,27 +20,26 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
* author : unknown
|
||||
* desc : 语音呼叫查看直播场景,包括车辆直播 或者 路口实况 window,区分不同页面window逻辑实现
|
||||
* desc : 语音呼叫查看直播场景,包括车辆直播 或者 路口实况 window,区分不同页面window逻辑实现,前方直播车辆由AICloudSdk中实现,上层仅传入SurfaceView和经纬度
|
||||
*/
|
||||
public class V2XVoiceCallLiveScenario extends AbsV2XScenario<V2XPushMessageEntity> implements IMogoTopViewStatusListener {
|
||||
|
||||
public V2XVoiceCallLiveScenario() {
|
||||
setV2XWindow(new V2XVoiceCallLiveCarWindow());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(@Nullable V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity) {
|
||||
if (v2XMessageEntity == null) {
|
||||
TipToast.shortTip("附近没有可直播车机");
|
||||
return;
|
||||
}
|
||||
if (v2XMessageEntity.isShowState()) {
|
||||
if (!isSameScenario(v2XMessageEntity)
|
||||
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
Logger.d(V2XConst.MODULE_NAME, "v2XMessageEntity : " + v2XMessageEntity + " getVideoSn : " + v2XMessageEntity.getContent().getVideoSn());
|
||||
if (v2XMessageEntity != null) {
|
||||
Logger.d(V2XConst.MODULE_NAME, "准备展示直播窗口");
|
||||
show();
|
||||
} else {
|
||||
TipToast.shortTip("附近没有可直播车机");
|
||||
Logger.e(V2XConst.MODULE_NAME, "直播地址为null");
|
||||
}
|
||||
Logger.d(V2XConst.MODULE_NAME, "v2XMessageEntity : " + v2XMessageEntity);
|
||||
show();
|
||||
} else {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化");
|
||||
@@ -64,11 +63,7 @@ public class V2XVoiceCallLiveScenario extends AbsV2XScenario<V2XPushMessageEntit
|
||||
R.dimen.module_v2x_event_window_width_vr : R.dimen.module_v2x_event_window_width);
|
||||
int height = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_see_live_window_height_vr : R.dimen.module_v2x_event_see_live_window_height);
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(width, height);
|
||||
layoutParams.topMargin = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_window_top_margin_vr : R.dimen.module_v2x_event_window_top_margin);
|
||||
layoutParams.rightMargin = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_window_right_margin_vr : R.dimen.module_v2x_event_window_right_margin);
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(width, height);
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package com.mogo.module.v2x.scenario.scene.route;
|
||||
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.observer.V2XOptimalRouteObserver;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
@@ -22,8 +18,6 @@ import java.util.List;
|
||||
public class V2XOptimalRouteVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
private final String TAG = "V2XPushVREventMarker";
|
||||
|
||||
private static IMogoPolyline mMogoPolyline;
|
||||
|
||||
@Override
|
||||
public void drawPOI(V2XPushMessageEntity entity) {
|
||||
Logger.w(V2XConst.MODULE_NAME + "_" + TAG, "drawPOI 绘制VR Marker");
|
||||
@@ -32,10 +26,6 @@ public class V2XOptimalRouteVREventMarker implements IV2XMarker<V2XPushMessageEn
|
||||
// 清除道路事件
|
||||
V2XServiceManager
|
||||
.getMoGoV2XMarkerManager().clearALLPOI();
|
||||
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
}
|
||||
// 绘制引导线
|
||||
drawableRecommendPolyline(entity);
|
||||
} catch (Exception e) {
|
||||
@@ -49,23 +39,7 @@ public class V2XOptimalRouteVREventMarker implements IV2XMarker<V2XPushMessageEn
|
||||
* @param entity
|
||||
*/
|
||||
void drawableRecommendPolyline(V2XPushMessageEntity entity) {
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
|
||||
colors.add(0xFFF95959);
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(20).useGradient(true).colorValues(colors);
|
||||
|
||||
for (double[] doubles : entity.getRecommendPolyline()) {
|
||||
options.add(doubles[0], doubles[1]);
|
||||
}
|
||||
|
||||
// 绘制线的对象
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
V2XOptimalRouteObserver.getInstance().setPolylinePoint(entity.getRecommendPolyline());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,10 +53,6 @@ public class V2XOptimalRouteVREventMarker implements IV2XMarker<V2XPushMessageEn
|
||||
}
|
||||
|
||||
public void clearLine() {
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
mMogoPolyline = null;
|
||||
V2XServiceManager.getV2XStatusManager().setAlarmInfo(null);
|
||||
}
|
||||
V2XOptimalRouteObserver.getInstance().setPolylinePoint(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
private Button mBtnTriggerRoadEvent;
|
||||
private Button mBtnClearRoadEvent;
|
||||
private Button mBtnTriggerPushEvent;
|
||||
private Button mBtnTriggerWarningEvent;
|
||||
private Button mBtnTriggerPushLiveCarEvent;
|
||||
private Button mBtnTriggerAnimationEvent;
|
||||
private Button mBtnbtnFrontCarLiveEvent;
|
||||
@@ -67,6 +68,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
private ToggleButton nBtnTriggerVR;
|
||||
private Button mBtnAdasDataWarn;
|
||||
|
||||
|
||||
private Button btnTriggerRearVIPCarTip,
|
||||
btnTriggerVehicleBrakes,
|
||||
btnTriggerRearDangerousVehicles,
|
||||
@@ -114,6 +116,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
flTestPanelShunYi = findViewById(R.id.flTestPanelShunYi);
|
||||
flTestPanelVR = findViewById(R.id.flTestPanelVR);
|
||||
mBtnTriggerOpen = findViewById(R.id.btnTriggerOpen);
|
||||
mBtnTriggerWarningEvent = findViewById(R.id.btnTriggerWarningEvent);
|
||||
mBtnClearRoadEvent = findViewById(R.id.btnClearRoadEvent);
|
||||
mBtnTriggerRoadEvent = findViewById(R.id.btnTriggerRoadEvent);
|
||||
mBtnTriggerPushEvent = findViewById(R.id.btnTriggerPushEvent);
|
||||
@@ -220,6 +223,16 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
|
||||
});
|
||||
|
||||
//车路云—场景预警-V1.0 碰撞预警
|
||||
mBtnTriggerWarningEvent.setOnClickListener(v -> {
|
||||
V2XMessageEntity<V2XWarningEntity> v2XMessageEntity =
|
||||
TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData();
|
||||
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
|
||||
});
|
||||
|
||||
mBtnTriggerPushEvent.setOnClickListener(v -> {
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity =
|
||||
TestOnLineCarUtils.getV2XScenarioPushEventData();
|
||||
|
||||
@@ -8,21 +8,31 @@ import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.marker.OptimalSpeedMarkerView;
|
||||
import com.mogo.module.v2x.marker.V2XFrontTargetMarkerView;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.utils.LocationUtils;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER;
|
||||
import static com.mogo.module.v2x.V2XConst.V2X_OPTIMAL_SPEED_MARKER;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 前方预警marker打点 绘制安全线和预警线
|
||||
@@ -33,7 +43,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
private V2XWarningEntity mMarkerEntity;
|
||||
private MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
private Context mContext = V2XServiceManager.getContext();
|
||||
private List fillPoints = new ArrayList();//停止线经纬度合集
|
||||
private IMogoMarker optimalMarker = null;
|
||||
|
||||
@Override
|
||||
public void drawPOI(Object entity) {
|
||||
@@ -45,16 +55,16 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
|
||||
markerShowEntity.setMarkerLocation(location);
|
||||
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
pointsBetween();
|
||||
//绘制停止线
|
||||
// drawStopLines(fillPoints);
|
||||
drawSafeLine();
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_FRONT_STOP_LINE);
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
}, 6_000);
|
||||
}
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.latitude(mMarkerEntity.getLat())
|
||||
.longitude(mMarkerEntity.getLon())
|
||||
.anchor(0.5f, 0.5f)
|
||||
.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
|
||||
optionsRipple
|
||||
.icon(ViewUtils.fromView(new EmptyMarkerView(mContext)));
|
||||
optimalMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_FRONT_WARNING_MARKER, optionsRipple);
|
||||
optimalMarker.setInfoWindowAdapter(new SimpleWindow3DAdapter(new V2XFrontTargetMarkerView(mContext)));
|
||||
optimalMarker.showInfoWindow();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -62,117 +72,10 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
|
||||
}
|
||||
|
||||
//绘制安全距离
|
||||
private void drawSafeLine() {
|
||||
clearPOI();
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//自车位置
|
||||
MogoLatLng car = V2XServiceManager.getNavi().getCarLocation();
|
||||
if (car != null) {
|
||||
//根据到停止线的距离和方向角获取经纬度
|
||||
MogoLatLng
|
||||
stopLineLo = LocationUtils.getNewLocation(car, mMarkerEntity.getStopLineDistance(), mMarkerEntity.getAngle());
|
||||
// if (mMarkerEntity.getCollisionLat() > 0 && mMarkerEntity.getCollisionLon() > 0) {
|
||||
// drawLine(car, stopLineLo);
|
||||
// }
|
||||
} else {
|
||||
Log.d(TAG, "自车位置没有拿到");
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
//补点后的停止线经纬度合集
|
||||
public void pointsBetween() {
|
||||
try {
|
||||
fillPoints.clear();
|
||||
List stopLines = mMarkerEntity.getStopLines();
|
||||
if (stopLines.size() > 1) {
|
||||
MogoLatLng x = mMarkerEntity.getStopLines().get(0);
|
||||
MogoLatLng y = mMarkerEntity.getStopLines().get(1);
|
||||
//两点间的距离
|
||||
float distance = CoordinateUtils.calculateLineDistance(x.lon, x.lat, y.lon, y.lat);
|
||||
float average = distance / 3;
|
||||
//两点间的角度
|
||||
double angle = LocationUtils.getAngle(x.lon, x.lat, y.lon, y.lat);
|
||||
//根据距离和角度获取下个点的经纬度
|
||||
fillPoints.add(x);
|
||||
for (int i = 1; i < 3; i++) {
|
||||
MogoLatLng newLocation = LocationUtils.getNewLocation(x, average * i, angle);
|
||||
fillPoints.add(newLocation);
|
||||
}
|
||||
fillPoints.add(y);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//绘制停止线-通过打点的方式实现
|
||||
private void drawStopLines(List points) {
|
||||
clearPOI();
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_FRONT_STOP_LINE);
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
MogoLatLng latLng = (MogoLatLng) points.get(i);
|
||||
drawMarkerWithLocation(latLng, V2XConst.V2X_FRONT_STOP_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawMarkerWithLocation(MogoLatLng latLng, String tag) {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(latLng.lat)
|
||||
.longitude(latLng.lon);
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(com.mogo.module.service.R.raw.people);
|
||||
options.anchor(0.5f, 0.5f);
|
||||
options.anchorColor("#FF4040");
|
||||
IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(tag, options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
}
|
||||
|
||||
//绘制并返回marker
|
||||
public IMogoMarker drawMarkerAndReturn(MarkerShowEntity markerShowEntity) {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(com.mogo.module.service.R.raw.people);
|
||||
options.anchorColor("#FF4040");
|
||||
IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(V2XConst.V2X_FRONT_WARNING_MARKER, options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
return marker;
|
||||
}
|
||||
|
||||
//绘制线
|
||||
public void drawLine(MogoLatLng s, MogoLatLng e) {
|
||||
DrawLineInfo drawLineInfo = new DrawLineInfo();
|
||||
drawLineInfo.setStartLocation(s);
|
||||
drawLineInfo.setEndLocation(e);
|
||||
drawLineInfo.setWidth(60);
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(mContext, drawLineInfo);
|
||||
}
|
||||
|
||||
//平移
|
||||
public void smooth(IMogoMarker marker) {
|
||||
List<MogoLatLng> latLngs = new ArrayList<>();
|
||||
MogoLatLng sLocation = new MogoLatLng(mMarkerEntity.getLat(), mMarkerEntity.getLon());
|
||||
MogoLatLng endLocation = new MogoLatLng(mMarkerEntity.getCollisionLat(), mMarkerEntity.getCollisionLon());
|
||||
latLngs.add(sLocation);
|
||||
latLngs.add(endLocation);
|
||||
marker.startSmoothInMs(latLngs, 3000);
|
||||
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
clearLine();
|
||||
}, 3_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_FRONT_WARNING_MARKER);
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(V2X_FRONT_WARNING_MARKER);
|
||||
}
|
||||
|
||||
public void clearLine() {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.mogo.module.v2x.utils;
|
||||
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeResult;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
@@ -69,6 +68,11 @@ public class LocationUtils {
|
||||
poiSearch.searchPOIAsyn();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前位置
|
||||
*
|
||||
* @return 当前位置
|
||||
*/
|
||||
public static MogoLatLng getCurrentLatLon() {
|
||||
MogoLatLng latLon = V2XServiceManager.getNavi().getCarLocation();
|
||||
if (latLon == null) {
|
||||
@@ -89,9 +93,9 @@ public class LocationUtils {
|
||||
return latLon;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 计算两点间的角度
|
||||
* */
|
||||
*/
|
||||
public static double getAngle(double lon1, double lat1, double lon2,
|
||||
double lat2) {
|
||||
double fLat = Math.PI * (lat1) / 180.0;
|
||||
@@ -108,9 +112,9 @@ public class LocationUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 根据角度获取指定距离点的经纬度
|
||||
* */
|
||||
*/
|
||||
public static MogoLatLng getNewLocation(MogoLatLng st, double distance, double angle) {
|
||||
mRadLo = st.getLon() * Math.PI / 180.;
|
||||
mRadLa = st.getLat() * Math.PI / 180.;
|
||||
@@ -124,4 +128,31 @@ public class LocationUtils {
|
||||
return new MogoLatLng(lat_new, lon_new);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取传入的经纬度在车辆的什么位置
|
||||
*
|
||||
* @return 顺时针,true-前,false-后
|
||||
*/
|
||||
public static boolean isPointOnCarFront(MogoLocation carLocal, MogoLatLng pointLocal) {
|
||||
double carLon = carLocal.getLongitude();
|
||||
double carLat = carLocal.getLatitude();
|
||||
double poiLon = pointLocal.getLon();
|
||||
double poiLat = pointLocal.getLat();
|
||||
float carAngle = carLocal.getBearing();
|
||||
|
||||
// 计算车辆与点之间的夹角
|
||||
int diffAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
carLon, carLat, poiLon, poiLat, (int) carAngle);
|
||||
|
||||
if (diffAngle <= 90) {
|
||||
Log.i(TAG, "目标点在车辆--前方");
|
||||
return true;
|
||||
} else {
|
||||
Log.i(TAG, "目标点在车辆--后方");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ import android.widget.TextView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.cloud.live.manager.LiveStreamManagerImpl;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
@@ -38,7 +36,6 @@ public class CarZegoLiveVideoView extends RoundLayout {
|
||||
private SurfaceView mSurfaceView;
|
||||
private ProgressBar mLoading;
|
||||
private ConstraintLayout mClLoadError;
|
||||
private TextView mTvRefreshButton;
|
||||
private String liveSn;
|
||||
|
||||
// 重新刷新直播流
|
||||
@@ -73,7 +70,7 @@ public class CarZegoLiveVideoView extends RoundLayout {
|
||||
mLoading.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(context, R.color.live_video_progress_bar_loading_color), PorterDuff.Mode.MULTIPLY);
|
||||
|
||||
mClLoadError = findViewById(R.id.clLoadError);
|
||||
mTvRefreshButton = findViewById(R.id.tvRefreshButton);
|
||||
TextView mTvRefreshButton = findViewById(R.id.tvRefreshButton);
|
||||
mTvRefreshButton.setOnClickListener(v -> {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
|
||||
@@ -57,7 +57,6 @@ public class V2XCrossRoadVideoView extends RoundLayout {
|
||||
private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
|
||||
private ProgressBar mLoading;
|
||||
private ConstraintLayout mClLoadError;
|
||||
private TextView mTvRefreshButton;
|
||||
private boolean init = false;
|
||||
|
||||
private MarkerCarInfo.CarLiveInfo mCarLiveInfo;
|
||||
@@ -83,6 +82,7 @@ public class V2XCrossRoadVideoView extends RoundLayout {
|
||||
|
||||
public V2XCrossRoadVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
Logger.d(TAG, "constructor invoke initView");
|
||||
initView(context);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class V2XCrossRoadVideoView extends RoundLayout {
|
||||
mLoading.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(context, R.color.live_video_progress_bar_loading_color), PorterDuff.Mode.MULTIPLY);
|
||||
|
||||
mClLoadError = findViewById(R.id.clLoadError);
|
||||
mTvRefreshButton = findViewById(R.id.tvRefreshButton);
|
||||
TextView mTvRefreshButton = findViewById(R.id.tvRefreshButton);
|
||||
mTvRefreshButton.setOnClickListener(v -> {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
@@ -152,7 +152,6 @@ public class V2XCrossRoadVideoView extends RoundLayout {
|
||||
* @param carLiveInfo 要直播的设备信息,如果没有直播的地址需要重新获取最新的直播地址
|
||||
*/
|
||||
public void startLive(MarkerCarInfo.CarLiveInfo carLiveInfo) {
|
||||
initView(this.getContext());
|
||||
// 进行直播播放
|
||||
if (mTxcVideoView != null
|
||||
&& carLiveInfo != null) {
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -18,8 +17,6 @@ import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.common.entity.MarkerCarInfo;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XLivePushVoRes;
|
||||
import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
@@ -50,16 +47,14 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
private ProgressBar mLoading;
|
||||
private TXLivePlayer mLivePlayer;
|
||||
private ConstraintLayout mClLoadError;
|
||||
private TextView mTvRefreshButton;
|
||||
|
||||
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
private final MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
|
||||
private MarkerCarInfo.CarLiveInfo mCarLiveInfo;
|
||||
// 重新刷新直播流
|
||||
private V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() {
|
||||
private final V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() {
|
||||
@Override
|
||||
public void onCallback(String command, Intent intent) {
|
||||
//startHeartLive(mCarLiveInfo);
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
if (mCarLiveInfo != null) {
|
||||
@@ -87,7 +82,7 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
private void initView(Context context) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_video_layout_normal, this);
|
||||
//mPlayerView 即 step1 中添加的界面 view
|
||||
//mPlayerView 即 step1 中添加的界面 view
|
||||
mTxcVideoView = findViewById(R.id.txcVideoView);
|
||||
//创建 player 对象
|
||||
mLivePlayer = new TXLivePlayer(context);
|
||||
@@ -106,15 +101,12 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
mLoading.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(context, R.color.live_video_progress_bar_loading_color), PorterDuff.Mode.MULTIPLY);
|
||||
|
||||
mClLoadError = findViewById(R.id.clLoadError);
|
||||
mTvRefreshButton = findViewById(R.id.tvRefreshButton);
|
||||
mTvRefreshButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
if (mCarLiveInfo != null) {
|
||||
startLive(mCarLiveInfo);
|
||||
}
|
||||
TextView mTvRefreshButton = findViewById(R.id.tvRefreshButton);
|
||||
mTvRefreshButton.setOnClickListener(v -> {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
if (mCarLiveInfo != null) {
|
||||
startLive(mCarLiveInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -141,33 +133,33 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
}
|
||||
// 根据SN重新获取直播流地址
|
||||
else {
|
||||
V2XServiceManager
|
||||
.getV2XRefreshModel()
|
||||
.livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
@Override
|
||||
public void onSuccess(V2XLivePushVoRes result) {
|
||||
Logger.e(MODULE_NAME, "从服务端获取最新直播信息:" + GsonUtil.jsonFromObject(result));
|
||||
mClLoadError.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
try {
|
||||
MarkerCarInfo.CarLiveInfo carRealLiveInfo = new MarkerCarInfo.CarLiveInfo();
|
||||
carRealLiveInfo.setVideoUrl(result.getResult().getPlayUrl().getRtmp());
|
||||
carRealLiveInfo.setVideoSn(carLiveInfo.getVideoSn());
|
||||
carRealLiveInfo.setVideoChannel(result.getResult().getVideoChannel());
|
||||
setCarLiveInfo(carLiveInfo);
|
||||
playLiveVideo(carRealLiveInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
Logger.e(MODULE_NAME, "播放器:" + msg);
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
}
|
||||
}, carLiveInfo.getVideoSn(), 0);
|
||||
// V2XServiceManager
|
||||
// .getV2XRefreshModel()
|
||||
// .livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
// @Override
|
||||
// public void onSuccess(V2XLivePushVoRes result) {
|
||||
// Logger.e(MODULE_NAME, "从服务端获取最新直播信息:" + GsonUtil.jsonFromObject(result));
|
||||
// mClLoadError.setVisibility(GONE);
|
||||
// mClLoadError.setVisibility(GONE);
|
||||
// try {
|
||||
// MarkerCarInfo.CarLiveInfo carRealLiveInfo = new MarkerCarInfo.CarLiveInfo();
|
||||
// carRealLiveInfo.setVideoUrl(result.getResult().getPlayUrl().getRtmp());
|
||||
// carRealLiveInfo.setVideoSn(carLiveInfo.getVideoSn());
|
||||
// carRealLiveInfo.setVideoChannel(result.getResult().getVideoChannel());
|
||||
// setCarLiveInfo(carLiveInfo);
|
||||
// playLiveVideo(carRealLiveInfo);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFail(String msg) {
|
||||
// Logger.e(MODULE_NAME, "播放器:" + msg);
|
||||
// mLoading.setVisibility(GONE);
|
||||
// mClLoadError.setVisibility(VISIBLE);
|
||||
// }
|
||||
// }, carLiveInfo.getVideoSn(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -223,7 +215,7 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
/**
|
||||
* 刷新直播心跳
|
||||
*
|
||||
* @param carLiveInfo
|
||||
* @param carLiveInfo 直播info
|
||||
*/
|
||||
private void startHeartLive(MarkerCarInfo.CarLiveInfo carLiveInfo) {
|
||||
try {
|
||||
@@ -248,20 +240,25 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
// true 代表清除最后一帧画面
|
||||
mLivePlayer.stopPlay(true);
|
||||
mTxcVideoView.onDestroy();
|
||||
// 停止推流
|
||||
V2XServiceManager
|
||||
.getV2XRefreshModel()
|
||||
.livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
@Override
|
||||
public void onSuccess(V2XLivePushVoRes result) {
|
||||
Logger.d(MODULE_NAME, "播放器:" + result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
Logger.e(MODULE_NAME, "播放器:" + msg);
|
||||
}
|
||||
}, carLiveInfo.getVideoSn(), 1);
|
||||
// if (carLiveInfo.getVideoUrl() != null) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 停止推流
|
||||
// V2XServiceManager
|
||||
// .getV2XRefreshModel()
|
||||
// .livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
// @Override
|
||||
// public void onSuccess(V2XLivePushVoRes result) {
|
||||
// Logger.d(MODULE_NAME, "播放器:" + result);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFail(String msg) {
|
||||
// Logger.e(MODULE_NAME, "播放器:" + msg);
|
||||
// }
|
||||
// }, carLiveInfo.getVideoSn(), 1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -10,7 +10,7 @@
|
||||
<com.mogo.module.v2x.view.V2XLiveGSYVideoView
|
||||
android:id="@+id/videoPlayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/v2x_video_window_height_content"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<com.mogo.module.v2x.view.V2XLiveGSYVideoView
|
||||
android:id="@+id/videoPlayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/v2x_video_window_height_content"
|
||||
android:layout_height="@dimen/module_v2x_event_window_height_vr_for_item"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/rlRoadEventDetail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/v2x_video_window_height_content"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include
|
||||
@@ -16,7 +15,7 @@
|
||||
android:id="@+id/pushVideoClose"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:src="@drawable/module_common_close_selector" />
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/rlRoadEventDetail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height_vr"
|
||||
android:layout_marginTop="@dimen/module_v2x_event_window_top_margin_vr"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include
|
||||
android:id="@+id/liveVideo"
|
||||
layout="@layout/item_v2x_live_video_vr"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pushVideoClose"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:src="@drawable/module_common_close_selector" />
|
||||
</RelativeLayout>
|
||||
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.module.v2x.view.RoundLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height"
|
||||
android:background="#3D4053"
|
||||
android:gravity="center"
|
||||
app:roundLayoutRadius="@dimen/dp_30"
|
||||
tools:layout_height="@dimen/module_v2x_event_see_live_window_height">
|
||||
app:roundLayoutRadius="@dimen/dp_30">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_110"
|
||||
@@ -39,9 +37,9 @@
|
||||
android:id="@+id/tvCountDown"
|
||||
android:layout_width="@dimen/dp_76"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:background="@drawable/v2x_shape_bg_count_down_corner_14"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.module.v2x.view.RoundLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#3D4053"
|
||||
android:gravity="center"
|
||||
app:roundLayoutRadius="@dimen/dp_30">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/v2x_icon_live_logo" />
|
||||
|
||||
<com.mogo.module.v2x.view.CarZegoLiveVideoView
|
||||
android:id="@+id/videoPlayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_v2x_event_window_height_vr_for_item"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_20" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivVideoPlayingSign"
|
||||
android:layout_width="@dimen/dp_130"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:src="@drawable/v2x_icon_event_live_top"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCountDown"
|
||||
android:layout_width="@dimen/dp_76"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:background="@drawable/v2x_shape_bg_count_down_corner_14"
|
||||
android:gravity="center"
|
||||
android:text="s"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:visibility="gone" />
|
||||
|
||||
</com.mogo.module.v2x.view.RoundLayout>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/topResource"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@drawable/v2x_stop_line" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottomBg"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.module.v2x.view.RoundLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.module.v2x.view.V2XCrossRoadVideoView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -7,7 +7,7 @@
|
||||
android:background="@color/live_video_background_color"
|
||||
app:roundLayoutRadius="@dimen/dp_20">
|
||||
|
||||
<com.mogo.module.v2x.view.SimpleCoverVideoPlayer
|
||||
<com.mogo.module.v2x.view.SimpleLiveVideoPlayer
|
||||
android:id="@+id/txcVideoView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height"
|
||||
@@ -67,4 +67,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivErrorIcon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.module.v2x.view.RoundLayout>
|
||||
</com.mogo.module.v2x.view.V2XCrossRoadVideoView>
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rlRoadEventList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/v2x_video_window_height_content"
|
||||
android:layout_margin="@dimen/dp_15">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.module.v2x.view.RoundLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
android:id="@+id/rlRoadEventDetail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/rlRoadEventDetail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_v2x_event_see_live_window_height_vr"
|
||||
android:layout_marginTop="@dimen/module_v2x_event_window_top_margin_vr"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include
|
||||
android:id="@+id/liveVideo"
|
||||
layout="@layout/item_v2x_see_frontcar_live_video_vr"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -237,6 +237,19 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textStyle="bold" />
|
||||
<Button
|
||||
android:id="@+id/btnTriggerWarningEvent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="#FF0606"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="前方碰撞预警"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTriggerPushEvent"
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
],
|
||||
[
|
||||
116.424272,39.983397
|
||||
],
|
||||
[
|
||||
116.425948,39.983465
|
||||
],
|
||||
[
|
||||
116.42628,39.983399
|
||||
]
|
||||
],
|
||||
"recommendPolyline": [
|
||||
@@ -54,6 +60,12 @@
|
||||
],
|
||||
[
|
||||
116.424272,39.983397
|
||||
],
|
||||
[
|
||||
116.425948,39.983465
|
||||
],
|
||||
[
|
||||
116.42628,39.983399
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -2,10 +2,12 @@
|
||||
<resources>
|
||||
<dimen name="module_main_v2x_animation_width">800px</dimen>
|
||||
|
||||
<dimen name="module_ext_top_view_no_link_width_in_vr_mode">615px</dimen>
|
||||
<dimen name="module_v2x_search_marginLeft">32px</dimen>
|
||||
<dimen name="module_v2x_operation_panel_share_goneMarginRight">32px</dimen>
|
||||
<dimen name="module_v2x_event_window_width">1060px</dimen>
|
||||
<dimen name="module_v2x_event_window_width_vr">583px</dimen>
|
||||
<dimen name="module_v2x_event_window_height_vr_for_item">366px</dimen>
|
||||
<dimen name="module_v2x_event_window_top_margin_vr">160px</dimen>
|
||||
<dimen name="module_v2x_event_window_top_margin">0px</dimen>
|
||||
<dimen name="module_v2x_event_window_right_margin_vr">32px</dimen>
|
||||
@@ -14,7 +16,7 @@
|
||||
<dimen name="module_v2x_push_img_container_height">410px</dimen>
|
||||
|
||||
<dimen name="module_v2x_event_see_live_window_height">670px</dimen>
|
||||
<dimen name="module_v2x_event_see_live_window_height_vr">366px</dimen>
|
||||
<dimen name="module_v2x_event_see_live_window_height_vr">526px</dimen>
|
||||
<dimen name="module_v2x_event_icon_size">147px</dimen>
|
||||
<dimen name="module_v2x_event_distance_text">60px</dimen>
|
||||
<dimen name="module_v2x_event_distance_title">40px</dimen>
|
||||
@@ -120,7 +122,7 @@
|
||||
|
||||
<!--适配直播框-->
|
||||
<dimen name="v2x_right_context_margin">830px</dimen>
|
||||
<dimen name="v2x_video_window_height_content">664px</dimen>
|
||||
<dimen name="v2x_video_window_height_content">662px</dimen>
|
||||
<dimen name="v2x_video_window_height">674px</dimen>
|
||||
<dimen name="v2x_driving_width">150px</dimen>
|
||||
<dimen name="v2x_driving_heigt">46px</dimen>
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
<string name="recommended_Parking">停车场推荐</string>
|
||||
<string name="recommended_route">线路推荐</string>
|
||||
<string name="v2x_recommond_route_size">26px</string>
|
||||
<string name="v2x_front_live_url_null">前方路口暂无直播</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user