From 196359ce650283b49b1d255fd7759bf8d6e9f9e6 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Wed, 5 Feb 2020 15:51:08 +0800 Subject: [PATCH] opt --- .../tanlu/fragment/TanluCardViewFragment.java | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java index 682ec808ad..5c173e05bf 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java @@ -428,7 +428,6 @@ public class TanluCardViewFragment extends MvpFragment> mogoIntentManager.registerIntentListener(TanluConstants.GO_TO_SHARE, mogoIntentListener); } - /** * 唤醒语音 */ @@ -469,6 +468,40 @@ public class TanluCardViewFragment extends MvpFragment> } }; + + /** + * 免唤醒语音监听 + */ + private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() { + @Override + public void onCmdSelected(String cmd) { + Log.d(TAG, "com.zhidao.tanlu.play ------->" + cmd); + if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok + gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG) + .build(simpleCoverVideoPlayer); + simpleCoverVideoPlayer.getStartButton().performClick(); + + } + } + + @Override + public void onCmdAction(String speakText) { + } + + @Override + public void onCmdCancel(String speakText) { + } + + @Override + public void onSpeakEnd(String speakText) { + } + + @Override + public void onSpeakSelectTimeOut(String speakText) { + } + }; + + /** * type=1 路况 *

@@ -498,40 +531,6 @@ public class TanluCardViewFragment extends MvpFragment> mAnalytics.track(TanluConstants.CARNET_USER_UPLOAD, properties); } - /** - * 免唤醒语音监听 - */ - private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() { - @Override - public void onCmdSelected(String cmd) { - Log.d(TAG, "com.zhidao.tanlu.play ------->"); - if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok -// FullMediaActivity.Companion.launch(getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime); - //TODO - gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG) - .build(simpleCoverVideoPlayer); - simpleCoverVideoPlayer.getStartButton().performClick(); - - } - } - - @Override - public void onCmdAction(String speakText) { - } - - @Override - public void onCmdCancel(String speakText) { - } - - @Override - public void onSpeakEnd(String speakText) { - } - - @Override - public void onSpeakSelectTimeOut(String speakText) { - } - }; - /** * 发送广播 1拥堵,2交通检查,3封路 */ @@ -735,7 +734,9 @@ public class TanluCardViewFragment extends MvpFragment> @Override public void onPerform() { //免唤醒 - AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.PLAY_VIDEO, TanluConstants.CMD_PLAY_ROAD_CONDITION, mogoVoiceListener); + AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.PLAY_VIDEO, + TanluConstants.CMD_PLAY_ROAD_CONDITION, mogoVoiceListener); + isCurrentPage = true; Logger.d(TAG, "tanlu卡片 onPerform 有效 ---->"); mMarkerManager = mMogoMapService.getMarkerManager(getActivity());