From ed182ed7e796422f905f341d45e4cc796cb038f1 Mon Sep 17 00:00:00 2001 From: zhangyuanzhen Date: Sat, 18 Jan 2020 11:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=AD=E9=9F=B3=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/map/MapPresenter.java | 22 +++++++++++++ .../com/mogo/module/map/VoiceConstants.java | 31 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java index 4dcf0f939b..a7c3b094f0 100644 --- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java +++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java @@ -200,6 +200,28 @@ public class MapPresenter extends Presenter< MapView > implements case VoiceConstants.CMD_MAP_CAR_UP_MODE: mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D ); break; + + //case VoiceConstants.CMD_MAP_GEO_NEARBY: + // if (intent != null) { + // String keywords = intent.getStringExtra("keyword"); + // mSearchManager.showCategory(keywords); + // } + + case VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE: + //mSearchManager.speakDraft(); + AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null); + + break; + + case VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE: + //mSearchManager.speakDetail(); + AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null); + + break; + case VoiceConstants.CMD_MAP_SPEAK_REMAIN: + break; + default: + break; } } diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java index 6ae747efef..3cee43f979 100644 --- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java +++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java @@ -140,6 +140,31 @@ public class VoiceConstants { public static final String CMD_MAP_NORTH_UP_MODE = "com.ileja.traffic.north.up"; public static final String CMD_MAP_NORTH_UP_MODE_UN_WAKEUP = "CMD_MAP_NORTH_UP_MODE_UN_WAKEUP"; public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"北朝上"}; + /** + * 简洁模式 + */ + public static final String CMD_MAP_SPEAK_DRAFT_MODE = "com.ileja.traffic.speak.draft"; + public static final String CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP = "CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP"; + public static final String[] CMD_MAP_SPEAK_DRAFT_MODE_TRIGGER_WORDS = {"简洁模式"}; + + + /** + * 详细模式 + */ + public static final String CMD_MAP_SPEAK_DETAIL_MODE = "com.ileja.traffic.speak.detail"; + public static final String CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP = "CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP"; + public static final String[] CMD_MAP_SPEAK_DETAIL_MODE_TRIGGER_WORDS = {"详细模式"}; + + /** + * 播报当前导航剩余里程和时间 + */ + public static final String CMD_MAP_SPEAK_REMAIN = "com.ileja.traffic.speak.remain"; + public static final String CMD_MAP_SPEAK_REMAIN_UN_WAKEUP = "CMD_MAP_SPEAK_REMAIN_UN_WAKEUP"; + public static final String[] CMD_MAP_SPEAK_REMAIN_TRIGGER_WORDS = {"还有多久","多久到","还有多远"}; + + + + public static final Map< String, String[] > sVoiceCmds = new HashMap<>(); public static final List< String > sCmds = new ArrayList<>(); @@ -164,6 +189,9 @@ public class VoiceConstants { 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 ); sVoiceCmds.put( VoiceConstants.CMD_MAP_GEO_NEARBY_WAKEUP, VoiceConstants.CMD_MAP_GEO_NEARBY_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_REMAIN_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_REMAIN_TRIGGER_WORDS ); // 唤醒 sCmds.add( VoiceConstants.CMD_MAP_ZOOM_IN ); sCmds.add( VoiceConstants.CMD_MAP_ZOOM_OUT ); @@ -182,5 +210,8 @@ public class VoiceConstants { sCmds.add( VoiceConstants.CMD_MAP_GO_COMPANY ); sCmds.add( VoiceConstants.CMD_MAP_HISTORY ); sCmds.add( VoiceConstants.CMD_MAP_STOP_NAVI_MODE ); + sCmds.add( VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE ); + sCmds.add( VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE ); + sCmds.add( VoiceConstants.CMD_MAP_SPEAK_REMAIN ); } }