otp
This commit is contained in:
@@ -81,4 +81,14 @@ public class AppsFragmentProvider implements IMogoModuleProvider {
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,4 +77,14 @@ public class ExtensionsModuleProvider implements IMogoModuleProvider {
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,4 +80,14 @@ public class EntranceProvider implements IMogoModuleProvider {
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
try {
|
||||
mCurrentPosition = position;
|
||||
mMogoModuleHandler.setEnable( mCardModulesAdapter.getProvider( position ).getModuleName() );
|
||||
mShadowFrame.setVisibility( View.VISIBLE );
|
||||
mMogoCardManager.invoke( position, mMogoModuleHandler.getCurrentModuleName() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -81,4 +81,14 @@ public class MapFragmentProvider implements IMogoModuleProvider {
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ public class MapPresenter extends Presenter< MapView >
|
||||
.build( MogoServicePaths.PATH_SEARCH_MANAGER )
|
||||
.navigation( getContext() );
|
||||
|
||||
registerVoiceCmd();
|
||||
|
||||
IMogoNavi mogoNavi = mMogoMapService.getNavi( getContext() );
|
||||
mogoNavi.setCalculatePathDisplayBounds( new Rect(
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.dp_730 )
|
||||
@@ -84,26 +82,24 @@ public class MapPresenter extends Presenter< MapView >
|
||||
}
|
||||
|
||||
private void registerVoiceCmd() {
|
||||
if ( VoiceConstants.sVoiceCmds.isEmpty() ) {
|
||||
Logger.w( TAG, "no unwakeup words" );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||
mMogoIntentManager.registerIntentListener( entry.getKey(), this );
|
||||
// AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
|
||||
for ( String cmd : VoiceConstants.sCmds ) {
|
||||
mMogoIntentManager.registerIntentListener( cmd, this );
|
||||
}
|
||||
}
|
||||
|
||||
private void unregisterVoiceCmd() {
|
||||
if ( VoiceConstants.sVoiceCmds.isEmpty() ) {
|
||||
Logger.w( TAG, "no unwakeup words" );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||
mMogoIntentManager.unregisterIntentListener( entry.getKey() );
|
||||
// AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this );
|
||||
}
|
||||
|
||||
for ( String cmd : VoiceConstants.sCmds ) {
|
||||
mMogoIntentManager.unregisterIntentListener( cmd );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,92 +114,90 @@ public class MapPresenter extends Presenter< MapView >
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
switch ( cmd ) {
|
||||
case VoiceConstants.CMD_MAP_TRAFFIC_MODE:
|
||||
case VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_TRAFFIC_MODE:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已打开", null );
|
||||
mView.getUIController().setTrafficEnabled( true );
|
||||
mSearchManager.showSearch();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已打开", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE:
|
||||
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已关闭", null );
|
||||
mView.getUIController().setTrafficEnabled( false );
|
||||
mSearchManager.showMain();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已关闭", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_ZOOM_IN:
|
||||
case VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP:
|
||||
mView.getUIController().changeZoom( true );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已放大", null );
|
||||
case VoiceConstants.CMD_MAP_ZOOM_IN:
|
||||
mView.getUIController().changeZoom( true );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_ZOOM_OUT:
|
||||
case VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已缩小", null );
|
||||
case VoiceConstants.CMD_MAP_ZOOM_OUT:
|
||||
mView.getUIController().changeZoom( false );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_2D:
|
||||
case VoiceConstants.CMD_MAP_2D_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
case VoiceConstants.CMD_MAP_2D:
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_3D:
|
||||
case VoiceConstants.CMD_MAP_3D_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_3D:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_3D );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DAY_TIME_MODE:
|
||||
case VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_DAY_TIME_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
|
||||
break;
|
||||
|
||||
case VoiceConstants.CMD_MAP_GO_COMPANY:
|
||||
case VoiceConstants.CMD_MAP_GO_COMPANY_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_GO_COMPANY:
|
||||
mSearchManager.goCompany();
|
||||
break;
|
||||
|
||||
case VoiceConstants.CMD_MAP_GO_HOME:
|
||||
case VoiceConstants.CMD_MAP_GO_HOME_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_GO_HOME:
|
||||
mSearchManager.goHome();
|
||||
break;
|
||||
|
||||
case VoiceConstants.CMD_MAP_HISTORY:
|
||||
case VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_HISTORY:
|
||||
mSearchManager.showSearch();
|
||||
break;
|
||||
|
||||
case VoiceConstants.CMD_MAP_STOP_NAVI_MODE:
|
||||
case VoiceConstants.CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_STOP_NAVI_MODE:
|
||||
mSearchManager.showMain();
|
||||
break;
|
||||
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE:
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Night );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
|
||||
mView.getUIController().displayOverview();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_UN_WAKEUP:
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
|
||||
mView.getUIController().recoverLockMode();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE_UN_WAKEUP:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
|
||||
break;
|
||||
default:
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -24,14 +26,14 @@ public class VoiceConstants {
|
||||
*/
|
||||
public static final String CMD_MAP_GO_HOME = "com.ileja.navi.map.go.home";
|
||||
public static final String CMD_MAP_GO_HOME_UN_WAKEUP = "CMD_MAP_GO_HOME_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_ZOOM_IN_GO_HOME = {"我要回家","导航回家","带我回家"};
|
||||
public static final String[] CMD_MAP_ZOOM_IN_GO_HOME = {"我要回家", "导航回家", "带我回家"};
|
||||
|
||||
/**
|
||||
* 去公司
|
||||
*/
|
||||
public static final String CMD_MAP_GO_COMPANY = "com.ileja.navi.map.go.company";
|
||||
public static final String CMD_MAP_GO_COMPANY_UN_WAKEUP = "CMD_MAP_GO_COMPANY_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_ZOOM_IN_GO_COMPANY = {"我要去公司","导航去公司","带我去公司"};
|
||||
public static final String[] CMD_MAP_ZOOM_IN_GO_COMPANY = {"我要去公司", "导航去公司", "带我去公司"};
|
||||
|
||||
/**
|
||||
* 导航历史记录
|
||||
@@ -41,7 +43,6 @@ public class VoiceConstants {
|
||||
public static final String[] CMD_MAP_HISTORY_TRIGGER_WORDS = {"查询导航历史记录"};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 缩小地图
|
||||
*/
|
||||
@@ -120,7 +121,6 @@ public class VoiceConstants {
|
||||
public static final String[] CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS = {"停止导航/结束导航/取消导航/放弃导航/退出导航/关闭导航"};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 车头朝上
|
||||
*/
|
||||
@@ -136,8 +136,10 @@ public class VoiceConstants {
|
||||
public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"北朝上"};
|
||||
|
||||
public static final Map< String, String[] > sVoiceCmds = new HashMap<>();
|
||||
public static final List< String > sCmds = new ArrayList<>();
|
||||
|
||||
static {
|
||||
// 免唤醒
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_2D_UN_WAKEUP, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS );
|
||||
@@ -155,5 +157,24 @@ public class VoiceConstants {
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_COMPANY_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_COMPANY );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP, VoiceConstants.CMD_MAP_HISTORY_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS );
|
||||
|
||||
// 唤醒
|
||||
sCmds.add( VoiceConstants.CMD_MAP_ZOOM_IN );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_ZOOM_OUT );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_2D );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_3D );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_DAY_TIME_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_NIGHT_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_TRAFFIC_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_CAR_UP_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_NORTH_UP_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_GO_HOME );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_GO_COMPANY );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_HISTORY );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_STOP_NAVI_MODE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
)
|
||||
}
|
||||
|
||||
// 是否开启导航
|
||||
var isStartedNavi = false
|
||||
|
||||
override fun onViewCreated(
|
||||
view: View,
|
||||
savedInstanceState: Bundle?
|
||||
@@ -96,6 +99,7 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
tv_navi_navi.setOnClickListener {
|
||||
SearchServiceHolder.getNavi()
|
||||
.startNavi(false)
|
||||
isStartedNavi = true
|
||||
SearchServiceHolder.fragmentManager.clearAll()
|
||||
}
|
||||
|
||||
@@ -122,8 +126,9 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
SearchServiceHolder.statusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT, false
|
||||
)
|
||||
SearchServiceHolder.getNavi()
|
||||
.clearCalculatePaths()
|
||||
if (!isStartedNavi) {
|
||||
SearchServiceHolder.getNavi().clearCalculatePaths()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -79,4 +79,14 @@ public class SearchFragmentProvider implements IMogoModuleProvider {
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,12 +472,10 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -527,4 +525,14 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
mStatusManager.setADASUIShow( getModuleName(), status == 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,4 +83,14 @@ public class TanluCardViewProvider implements IMogoModuleProvider {
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return "探路";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,18 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoMarkerClickListener getMarkerClickListener();
|
||||
|
||||
/**
|
||||
* 获取模块对应 app 的包名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getAppPackage();
|
||||
|
||||
/**
|
||||
* 获取对应模块 app 名称
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getAppName();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user