From 7d83dd58b9d0d8330ab4ae108f53cec4a2ba5960 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Fri, 27 Nov 2020 09:58:14 +0800 Subject: [PATCH] bugfix --- .../launchercard/LauncherCardRefresher.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java index 84d831d711..a6bd55cd38 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java @@ -527,9 +527,18 @@ class LauncherCardRefresher { } else if ( datum instanceof TtsConfigData.NearRoads ) { result = handleNearRoadsTtsConfig( ( ( TtsConfigData.NearRoads ) datum ) ); } else if ( datum instanceof TtsConfigData.OnlineCarVsExplorerWay ) { - result = handleExplorerWayTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) ); - if ( !result ) { + if ( node.type == LauncherCardRefreshType.ExplorerWay ) { + result = handleExplorerWayTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) ); + if ( !result ) { + node.type = LauncherCardRefreshType.OnlineCar; + result = handleOnlineCarTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) ); + } + } else if( node.type == LauncherCardRefreshType.OnlineCar ){ result = handleOnlineCarTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) ); + if ( !result ) { + node.type = LauncherCardRefreshType.ExplorerWay; + result = handleExplorerWayTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) ); + } } } if ( result ) { @@ -595,7 +604,7 @@ class LauncherCardRefresher { String tts = mContext.getString( R.string.module_service_launcher_card_tips ); String info = mContext.getString( R.string.module_service_launcher_card_info ); speakTTS( String.format( tts, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay.getDesc() ), false ); - notifyRefreshChanged( String.format( info, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay ), explorerWay.poiTotal, tts ); + notifyRefreshChanged( String.format( info, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay.getDesc() ), explorerWay.poiTotal, tts ); return true; } @@ -612,7 +621,7 @@ class LauncherCardRefresher { String tts = mContext.getString( R.string.module_service_launcher_card_tips ); String info = mContext.getString( R.string.module_service_launcher_card_info ); speakTTS( String.format( tts, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar.getDesc() ), false ); - notifyRefreshChanged( String.format( info, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar ), onlineCar.carTotal, tts ); + notifyRefreshChanged( String.format( info, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar.getDesc() ), onlineCar.carTotal, tts ); return true; }