修复了周边道路事件数量播报错误问题

This commit is contained in:
董宏宇
2020-12-01 14:45:14 +08:00
parent b2c2c0ba05
commit daaf2fe35c

View File

@@ -198,6 +198,8 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
spannableString.setSpan(new StyleSpan(Typeface.BOLD), 7, spannableString.setSpan(new StyleSpan(Typeface.BOLD), 7,
originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTotalTv.setText(spannableString); mTotalTv.setText(spannableString);
ttsForSurroundingFirstToday(exploreWayList.size());
} else { } else {
mTopLayout.setVisibility(View.GONE); mTopLayout.setVisibility(View.GONE);
mRecyclerView.setVisibility(View.GONE); mRecyclerView.setVisibility(View.GONE);
@@ -207,19 +209,19 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
ttsForVoiceCheckout(); ttsForVoiceCheckout();
fromVoice = false; fromVoice = false;
} }
ttsForSurroundingFirstToday();
} }
/* /**
* 手动点击周边事件 TTS播报 * 手动点击周边事件 TTS播报
* */ */
private void ttsForSurroundingFirstToday() { private void ttsForSurroundingFirstToday(int eventCount) {
boolean hasBroadTts = V2XUtils.isFirstTodayWithKey("TTS_FOR_SURROUNDING_SELECTED"); boolean hasBroadTts = V2XUtils.isFirstTodayWithKey("TTS_FOR_SURROUNDING_SELECTED");
if (hasBroadTts == false) { if (!hasBroadTts) {
if (poiInfosList.size() > 0) { if (eventCount > 0) {
AIAssist.getInstance(V2XUtils.getApp()). AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("发现周边" + poiInfosList.size() + "条交通信息", null); speakTTSVoice("发现周边" + eventCount + "条交通信息", null);
} else { } else {
Logger.e(TAG,"周边没有发现交通信息");
} }
} }
} }