tts-打开事件面板联调

This commit is contained in:
liujing
2020-11-23 15:45:53 +08:00
parent f37439aefc
commit b0491943cb
5 changed files with 36 additions and 14 deletions

View File

@@ -164,12 +164,15 @@ public class SchemeIntent implements IMogoStatusChangedListener {
break;
case TYPE_SHOW_ONLINE_CAR_PANEL:
handleShowOnlineCarPanel(target);
break;
case TYPE_SHOW_HISTORY_PANEL:
handleShowSharePanel(0);
handleShowEventPanel(0);
break;
case TYPE_SHOW_SURROUNDING_PANEL:
handleShowSharePanel(1);
handleShowEventPanel(1);
break;
case TYPE_SHOW_SHARE_PANEL:
handleShowSharePanel(2);
handleShowEventPanel(2);
break;
default:
break;
@@ -225,7 +228,7 @@ public class SchemeIntent implements IMogoStatusChangedListener {
/*
* 语音打开事件面板
* */
private void handleShowSharePanel(int item) {
private void handleShowEventPanel(int item) {
Logger.d(TAG, "语音打开事件面板" + String.valueOf(item));
mApis.getEventPanelManager().showPanelWithSelectedItem(item);
}

View File

@@ -9,6 +9,7 @@ import android.text.Spanned
import android.text.style.AbsoluteSizeSpan
import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.RadioButton
@@ -256,20 +257,23 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
* 语音查询热心指数需求
* */
fun showPanelWithSelectedItem(item: Int) {
mV2XShareEventsFragment.fromVoice = true
if (isPanelShow()) {
when (item) {
0 -> mV2XScenarioHistoryFragment.ttsForVoiceCheckout()
1 -> mV2XSurroundingFragment.ttsForVoiceCheckout()
else -> mV2XShareEventsFragment.ttsForVoiceCheck()
try {
when (item) {
0 -> mV2XScenarioHistoryFragment.ttsForVoiceCheckout()
1 -> mV2XSurroundingFragment.ttsForVoiceCheckout()
else -> mV2XShareEventsFragment.ttsForVoiceCheckout()
}
} catch (e: java.lang.Exception) {
}
} else {
showPanel()
selectWithItem(item)
}
}
private fun initDetail() {
mDetailRecyclerView!!.addItemDecoration(SpacesItemDecoration(resources.getDimension(R.dimen.share_item_padding).toInt()))
mSurroundingDetailAdapter = V2XSurroundingDetailAdapter(activity, markerExploreWays)
@@ -343,10 +347,14 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
return typeName
}
/*
* 语音查询事件面板内容
* */
private fun selectWithItem(item: Int) {
when (item) {
0 -> {
try {
mV2XScenarioHistoryFragment.fromVoice = true
mRbScenarioHistory?.isChecked = true
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -354,6 +362,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
1 -> {
try {
mV2XSurroundingFragment.fromVoice = true
mRbSurroundingEvent?.isChecked = true
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -361,6 +370,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
2 -> {
try {
mV2XShareEventsFragment.fromVoice = true
mRbShareEvents?.isChecked = true
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -372,6 +382,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
fun showPanel() {
Logger.d(MODULE_NAME, "in fragment show panel")
mClPanelContainer?.visibility = View.VISIBLE
if (DebugConfig.isMapBased()) {
V2XVoiceManager.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP, mCloeEventCb)
}

View File

@@ -38,7 +38,7 @@ import java.util.List;
public class V2XScenarioHistoryFragment
extends MvpFragment<V2XScenarioHistoryFragment, ScenarioHistoryPresenter> {
private String TAG = "ScenarioHistoryFragment";
public Boolean fromVoice = false;
private V2XListEmptyView mEmptyView;
private LinearLayout mClHistoryList;
private RecyclerView mRecyclerView;
@@ -128,6 +128,10 @@ public class V2XScenarioHistoryFragment
mClHistoryList.setVisibility(View.GONE);
}
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
if (fromVoice == true){
ttsForVoiceCheckout();
fromVoice = false;
}
ttsForHistoryFirstToday();
}
});

View File

@@ -105,7 +105,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
dataArrayList.add(resultData.getResult().getEnthusiasmIndex());
if (fromVoice == true) {
try {
ttsForVoiceCheck();
ttsForVoiceCheckout();
} catch (Exception e) {
}
@@ -140,7 +140,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
/*
* 语音打开我的分享,TTS播报
* */
public void ttsForVoiceCheck() {
public void ttsForVoiceCheckout() {
int shareNum = resultData.getResult().getEnthusiasmIndex().getShareNum();
int approveNum = resultData.getResult().getEnthusiasmIndex().getLikeNum();
double enthusiasm = resultData.getResult().getEnthusiasmIndex().getEnthusiasmIndex();

View File

@@ -84,7 +84,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
private List<SurroundingConstruction> poiInfosList = new ArrayList<>();
private IMogoServiceApis mApis;
private NetworkLoadingView mloadingImage;
public Boolean fromVoice = false;
@Override
protected int getLayoutId() {
@@ -199,6 +199,10 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
mRecyclerView.setVisibility(View.GONE);
mEmptyLayout.setVisibility(View.VISIBLE);
}
if (fromVoice == true) {
ttsForVoiceCheckout();
fromVoice = false;
}
ttsForSurroundingFirstToday();
}