[Change]
增加控制地图「白天」「夜间」模式 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -152,9 +152,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
private boolean mLastStatusIsVr = false;
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
public void onMapModeChanged(EnumMapUI mCurrentUI) {
|
||||
clearAllData();
|
||||
if (ui == EnumMapUI.Type_VR) {
|
||||
if (mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR) {
|
||||
if (!mLastStatusIsVr) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
|
||||
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
|
||||
|
||||
@@ -2,9 +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;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
|
||||
@@ -27,7 +25,6 @@ public class IntentHandlerFactory {
|
||||
mHandlers.put( Intent.ACTION_POWER_DISCONNECTED, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( AccStatusReceiver.ACTION_NWD_ACC, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
|
||||
mHandlers.put( ConnectivityManager.CONNECTIVITY_ACTION, new NetworkChangedIntentHandler() );
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
|
||||
@@ -13,10 +13,7 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -252,20 +249,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
intent3.putExtra("EXTRA_REQUEST_AUTO_STATE", 0);
|
||||
context.sendBroadcast(intent3);
|
||||
break;
|
||||
case 32:// 控制实时路况
|
||||
MogoMapUIController.getInstance().setTrafficEnabled(true);
|
||||
break;
|
||||
case 33:// 测试小智语音
|
||||
AIAssist.getInstance(context).speakTTSVoice("庞帆说这个是一个 hard coding.");
|
||||
break;
|
||||
case 34:// 修改地图模式VR OR 2D
|
||||
int type = intent.getIntExtra("type", 0);
|
||||
if (type != 0) {
|
||||
CallerBase.getApiInstance(IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER).changeToVRMode();
|
||||
} else {
|
||||
CallerBase.getApiInstance(IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER).changeTo2dMode();
|
||||
}
|
||||
break;
|
||||
case 36:// 测试打点功能
|
||||
MogoLatLng center = MogoMapUIController.getInstance()
|
||||
.getWindowCenterLocation();
|
||||
@@ -393,10 +379,6 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 45:// 测试开启鹰眼模式
|
||||
MogoMapUIController.getInstance()
|
||||
.openVrMode(false);
|
||||
break;
|
||||
case 46:// 模拟鹰眼模式下绘制车辆周边的数据
|
||||
mTimeTickHandler.sendEmptyMessageDelayed(1, 0L);
|
||||
break;
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.mogo.module.service.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
|
||||
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 {
|
||||
MogoMapUIController.getInstance()
|
||||
.setTrafficEnabled( true );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user