opt
This commit is contained in:
@@ -28,7 +28,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
||||
DebugConfig.setNetMode( DebugConfig.NET_MODE_QA );
|
||||
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CODITION" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CONDITION" ) );
|
||||
MogoModulePaths.addModule(new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE) );
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
mMapView.setRouteOverlayVisible( false );
|
||||
mMapView.setCarOverlayVisible( false );
|
||||
mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
||||
mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +378,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
case Type_Night:
|
||||
options.setNaviNight( true );
|
||||
break;
|
||||
case Type_AUTO_LIGHT_Night:
|
||||
options.setNaviNight( false );
|
||||
options.setAutoNaviViewNightMode( true );
|
||||
break;
|
||||
}
|
||||
mMapView.setViewOptions( options );
|
||||
}
|
||||
@@ -425,7 +429,9 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void displayOverview() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.displayOverview();
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
mMapView.displayOverview();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,11 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setPosition( double lat, double lng );
|
||||
|
||||
/**
|
||||
* 获取坐标点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getPosition();
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,12 +25,17 @@ public enum EnumMapUI {
|
||||
/**
|
||||
* 白天模式
|
||||
*/
|
||||
Type_Light( 3, 4 ),
|
||||
Type_Light( 3, 5 ),
|
||||
|
||||
/**
|
||||
* 夜晚模式
|
||||
*/
|
||||
Type_Night( 4, 3 );
|
||||
Type_Night( 4, 4 ),
|
||||
|
||||
/**
|
||||
* 夜晚模式
|
||||
*/
|
||||
Type_AUTO_LIGHT_Night( 5, 3 );
|
||||
|
||||
private int next;
|
||||
private int code;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
|
||||
private void init() {
|
||||
mHolder = getHolder();
|
||||
mHolder.addCallback( this );
|
||||
setZOrderOnTop( false );
|
||||
setZOrderOnTop( true );
|
||||
mHolder.setFormat( PixelFormat.TRANSLUCENT );
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,18 @@ import android.text.TextUtils;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -21,6 +28,9 @@ import com.mogo.service.voice.IMogoVoiceListener;
|
||||
*/
|
||||
public class MapPresenter extends Presenter< MapView > implements IMogoVoiceListener, IMogoVoiceCmdCallBack {
|
||||
|
||||
private static final String TAG = "MapPresenter";
|
||||
|
||||
private IMogoMapService mMogoMapService;
|
||||
|
||||
public MapPresenter( MapView view ) {
|
||||
super( view );
|
||||
@@ -29,18 +39,19 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
|
||||
registerUnWakeupCmd();
|
||||
}
|
||||
|
||||
private void registerUnWakeupCmd() {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_LIGHT_MODE, VoiceConstants.CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS, this );
|
||||
if ( VoiceConstants.sUnWakeupCmds.isEmpty() ) {
|
||||
Logger.w( TAG, "no unwakeup words" );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnWakeupCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +122,7 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
* @param action actionType = 0 -> 0 - 开、1 - 关
|
||||
* actionType = 1 -> 0 - 放大地图、1 - 缩小地图
|
||||
* actionType = 2 -> 0 - 切换到2D车头朝上、1 - 切换2D正北模式、2 - 切换3D车头朝上
|
||||
* actionType = 3 -> 0 - 黑夜、1 - 正常
|
||||
* actionType = 3 -> 0 - 黑夜、1 - 正常、2 - 自动
|
||||
*/
|
||||
public void onMapUISetting( int actionType, int action ) {
|
||||
switch ( actionType ) {
|
||||
@@ -146,6 +157,8 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Night );
|
||||
} else if ( action == 1 ) {
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
|
||||
} else if( action == 2){
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -178,6 +191,21 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE:
|
||||
onMapUISetting( 3, 0 );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
|
||||
onMapUISetting( 3, 2 );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
|
||||
mMogoMapService.getMapUIController().displayOverview();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
|
||||
mMogoMapService.getMapUIController().recoverLockMode();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
|
||||
mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
@@ -99,12 +102,13 @@ public class VoiceConstants {
|
||||
* 2D模式
|
||||
*/
|
||||
public static final String CMD_MAP_2D = "CMD_MAP_2D";
|
||||
public static final String[] CMD_MAP_2D_WAKE_UP_WORDS = {"2D模式"};
|
||||
public static final String[] CMD_MAP_2D_WAKE_UP_WORDS = {"二地模式"};
|
||||
|
||||
/**
|
||||
* 3D模式
|
||||
*/
|
||||
public static final String CMD_MAP_3D = "CMD_MAP_3D";
|
||||
public static final String[] CMD_MAP_3D_WAKE_UP_WORDS = {"3D模式"};
|
||||
public static final String[] CMD_MAP_3D_WAKE_UP_WORDS = {"三地模式"};
|
||||
|
||||
/**
|
||||
* 白天模式
|
||||
@@ -116,18 +120,67 @@ public class VoiceConstants {
|
||||
* 黑夜模式
|
||||
*/
|
||||
public static final String CMD_MAP_NIGHT_MODE = "CMD_MAP_NIGHT_MODE";
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS = {"黑夜模式"};
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS = {"夜间模式"};
|
||||
|
||||
/**
|
||||
* 自动模式
|
||||
*/
|
||||
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "CMD_MAP_AUTO_LIGHT_NIGHT_MODE";
|
||||
public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS = {"自动模式"};
|
||||
|
||||
/**
|
||||
* 查看路况
|
||||
*/
|
||||
public static final String CMD_MAP_TRAFFIC_MODE = "CMD_MAP_TRAFFIC_MODE";
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS = {"查看路况"};
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS = {"打开路况", "打开实况"};
|
||||
/**
|
||||
* 关闭路况
|
||||
*/
|
||||
public static final String CMD_MAP_UN_TRAFFIC_MODE = "CMD_MAP_UN_TRAFFIC_MODE";
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS = {"关闭路况"};
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS = {"关闭路况","关闭实况"};
|
||||
|
||||
/**
|
||||
* 导航全览
|
||||
*/
|
||||
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "CMD_MAP_DISPLAY_OVERVIEW_MODE";
|
||||
public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS = {"进入全览", "查看全程"};
|
||||
|
||||
/**
|
||||
* 继续导航
|
||||
*/
|
||||
public static final String CMD_MAP_CONTINUE_NAVI_MODE = "CMD_MAP_CONTINUE_NAVI_MODE";
|
||||
public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS = {"继续导航"};
|
||||
|
||||
/**
|
||||
* 车头朝上
|
||||
*/
|
||||
public static final String CMD_MAP_CAR_UP_MODE = "CMD_MAP_CAR_UP_MODE";
|
||||
public static final String[] CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS = {"车头朝上"};
|
||||
|
||||
/**
|
||||
* 北朝上
|
||||
*/
|
||||
public static final String CMD_MAP_NORTH_UP_MODE = "CMD_MAP_NORTH_UP_MODE";
|
||||
public static final String[] CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS = {"北朝上"};
|
||||
|
||||
public static final Map< String, String[] > sUnWakeupCmds = new HashMap<>();
|
||||
|
||||
|
||||
static {
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_LIGHT_MODE, VoiceConstants.CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE, VoiceConstants.CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE, VoiceConstants.CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ServiceConst {
|
||||
/**
|
||||
* 卡片 探路数据
|
||||
*/
|
||||
public static final String CARD_TYPE_ROAD_CODITION = "CARD_TYPE_ROAD_CODITION";
|
||||
public static final String CARD_TYPE_ROAD_CONDITION = "CARD_TYPE_ROAD_CONDITION";
|
||||
|
||||
/**
|
||||
* 卡片 分享音乐
|
||||
|
||||
@@ -352,7 +352,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
public void onPerform() {
|
||||
Logger.d(TAG, "tanlu卡片 有效 ---->");
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getActivity());
|
||||
List<IMogoMarker> markers = mMarkerManager.getMarkers("CARD_TYPE_ROAD_CODITION");
|
||||
List<IMogoMarker> markers = mMarkerManager.getMarkers("CARD_TYPE_ROAD_CONDITION");
|
||||
if (markers != null && markers.size() > 0) {
|
||||
mEmptyLayout.setVisibility(View.GONE);
|
||||
mRootLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class TanluCardViewProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "CARD_TYPE_ROAD_CODITION";
|
||||
return "CARD_TYPE_ROAD_CONDITION";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user