This commit is contained in:
unknown
2020-09-28 15:38:25 +08:00
12 changed files with 64 additions and 15 deletions

View File

@@ -86,7 +86,6 @@ public class MogoApplication extends AbsMogoApplication {
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_MOGO_MONITOR, "MogoMonitor" ) );
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
if ( !DebugConfig.isLauncher() ) {

View File

@@ -48,6 +48,7 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
@@ -163,7 +164,9 @@ public class AMapViewWrapper implements IMogoMapView,
// mMapView.setRouteOverlayVisible( false );
// mMapView.setCarOverlayVisible( false );
changeMapMode( EnumMapUI.CarUp_2D );
setTrafficEnabled( true );
if ( NetworkUtils.isConnected( mMapView.getContext() ) ) {
setTrafficEnabled( true );
}
mMapView.getMap().moveCamera( CameraUpdateFactory.zoomTo( mDefaultZoomLevel ) );
}
@@ -309,6 +312,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void setTrafficEnabled( boolean visible ) {
if ( checkMapView() ) {
Logger.d( TAG, "setTrafficEnabled" );
mMapView.getMap().setTrafficEnabled( true );
}
}

View File

@@ -400,10 +400,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
long guideRecordTime = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getLong(getSPGuideRecord(), 0);
Logger.d(TAG, " isGreaterThanOneDay interval = " + (System.currentTimeMillis() - guideRecordTime) + "---currentTime = " + System.currentTimeMillis() + "---guideRecordTime =" + guideRecordTime);
if ((System.currentTimeMillis() - guideRecordTime) > ONE_DAY_TIME) {
Logger.d(TAG, "--------1------");
isGreaterThanOneDay = true;
} else {
Logger.d(TAG, "--------2------");
isGreaterThanOneDay = false;
}

View File

@@ -146,7 +146,7 @@
<dimen name="module_entrance_id_uploading_height">58px</dimen>
<dimen name="module_map_id_navi_next_info_distance_marginTop">3dp</dimen>
<dimen name="module_map_id_navi_next_info_road_marginBottom">10px</dimen>
<dimen name="module_map_id_navi_next_info_road_marginBottom_small">4px</dimen>
<dimen name="module_map_id_navi_next_info_road_marginBottom_small">6px</dimen>
<dimen name="module_map_id_navi_next_info_distance_marginStart">6px</dimen>
<dimen name="module_ext_display_overview_icon_marginTop">10px</dimen>

View File

@@ -17,7 +17,7 @@
<dimen name="cards_container_shadow_dp_margin_top">319px</dimen>
<dimen name="module_main_apps_fragment_container_width">110px</dimen>
<dimen name="module_main_apps_fragment_container_padding">10px</dimen>
<dimen name="module_main_apps_fragment_container_padding">6px</dimen>
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>

View File

@@ -17,7 +17,7 @@
<dimen name="cards_container_shadow_dp_margin_top">319px</dimen>
<dimen name="module_main_apps_fragment_container_width">110px</dimen>
<dimen name="module_main_apps_fragment_container_padding">10px</dimen>
<dimen name="module_main_apps_fragment_container_padding">6px</dimen>
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>

View File

@@ -5,6 +5,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -64,6 +66,7 @@ import com.mogo.service.module.MogoAction;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
@@ -408,6 +411,7 @@ public class MogoServices implements IMogoMapListener,
mIntentManager.registerIntentListener( MogoReceiver.ACTION_AUTO_NAVI_SEND, this );
mIntentManager.registerIntentListener( MogoReceiver.ACTION_MOGO, this );
mIntentManager.registerIntentListener( ServiceConst.COMMAND_ONLINE_CAR_PANEL, this );
mIntentManager.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, this );
mADASController = MarkerServiceHandler.getADASController();
mLauncher = MarkerServiceHandler.getLauncher();
@@ -503,6 +507,7 @@ public class MogoServices implements IMogoMapListener,
filter.addAction( MogoReceiver.ACTION_AUTO_NAVI_SEND );
filter.addAction( MogoReceiver.ACTION_MOGO );
filter.addAction( MogoReceiver.ACTION_TXZ_BLOCK_SEARCH );
filter.addAction( ConnectivityManager.CONNECTIVITY_ACTION );
try {
context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter );
Logger.i( TAG, "register voice receiver." );
@@ -865,6 +870,10 @@ public class MogoServices implements IMogoMapListener,
} else if ( ServiceConst.COMMAND_PREVIOUS.equals( command ) ) {
onActionDone( MogoAction.Prev );
} else {
if ( TextUtils.equals( command, ConnectivityManager.CONNECTIVITY_ACTION )
&& NetworkUtils.isConnected( mContext ) ) {
mIntentManager.unregisterIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, this );
}
IntentHandlerFactory.getInstance().handle( mContext, command, intent );
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.module.service.intent;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.receiver.AccStatusReceiver;
@@ -39,6 +40,7 @@ public class IntentHandlerFactory {
mHandlers.put( ServiceConst.COMMAND_BACK, WholeVoiceCommandIntentHandler.getInstance() );
mHandlers.put( MogoReceiver.ACTION_MOGO, new MogoControllerIntentHandler() );
mHandlers.put( ServiceConst.COMMAND_ONLINE_CAR_PANEL, new OnlineCarPanelIntentHandler() );
mHandlers.put( ConnectivityManager.CONNECTIVITY_ACTION, new NetworkChangedIntentHandler() );
}
private static final class InstanceHolder {

View File

@@ -345,6 +345,9 @@ public class MockIntentHandler implements IntentHandler {
intent3.putExtra( "EXTRA_REQUEST_AUTO_STATE", 0 );
context.sendBroadcast( intent3 );
break;
case 32:
MarkerServiceHandler.getMapService().getMapUIController().setTrafficEnabled( true );
break;
}
}

View File

@@ -0,0 +1,38 @@
package com.mogo.module.service.intent;
import android.content.Context;
import android.content.Intent;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.NetConfig;
public
/**
* @author congtaowang
* @since 2020/8/17
*
* 描述
*/
class NetworkChangedIntentHandler implements IntentHandler {
private static final String TAG = "NetworkChangedIntentHandler";
@Override
public void handle( Context context, Intent intent ) {
if ( NetworkUtils.isConnected( context ) ) {
try {
Logger.d( TAG, "setTrafficEnabled" );
MogoApisHandler.getInstance()
.getApis()
.getMapServiceApi()
.getMapUIController()
.setTrafficEnabled( true );
} catch ( Exception e ) {
e.printStackTrace();
}
}
}
}

View File

@@ -72,34 +72,27 @@ public class V2XScenarioManager implements IV2XScenarioManager {
if (mV2XScenario == null) {
switch (v2XMessageEntity.getType()) {
case V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING:
hidOtherPanel();
mV2XScenario = V2XRoadEventScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
hidOtherPanel();
mV2XScenario = V2XSeekHelpScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
hidOtherPanel();
mV2XScenario = V2XFatigueDrivingScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING:
hidOtherPanel();
mV2XScenario = V2XPushEventScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING:
hidOtherPanel();
mV2XScenario = V2XPushLiveCarScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_ANIMATION_WARNING:
hidOtherPanel();
mV2XScenario = V2XAnimationScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP:
mV2XScenario = V2XCarForHelpScenario.getInstance();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING:
hidOtherPanel();
mV2XScenario = V2XIllegalParkScenario.getInstance();
break;
default:
@@ -111,6 +104,9 @@ public class V2XScenarioManager implements IV2XScenarioManager {
// 展示最新的消息
if (mV2XScenario != null) {
if (v2XMessageEntity.getType() != V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP) {
hidOtherPanel();
}
mV2XScenario.init(v2XMessageEntity);
mV2XScenarioSet.put(v2XMessageEntity.getType(), mV2XScenario);
}

View File

@@ -29,7 +29,7 @@
<corners android:radius="@dimen/dp_26" />
<gradient
android:angle="135"
android:endColor="#E6F5F5F5"
android:endColor="#F5F5F5"
android:startColor="#FFFFFF"
android:type="linear"
android:useLevel="true" />