Merge branch 'dev_robotaxi-d-app-module_2132_221223_2.13.2' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_2132_221223_2.13.2

This commit is contained in:
lixiaopeng
2023-01-14 19:22:28 +08:00
6 changed files with 95 additions and 18 deletions

View File

@@ -111,6 +111,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils
import mogo_msg.MogoReportMsg
import record_cache.RecordPanelOuterClass
import java.util.*
import java.util.concurrent.atomic.AtomicReference
/**
@@ -171,7 +172,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var adUpgradeDialog: AdUpgradeDialog? = null
private var lastSpeakJob: Job? = null
private val lastSpeakJob by lazy { AtomicReference<Job>() }
private var lastShowV2XJob: Job? = null
@@ -901,7 +902,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
override fun onShow(reminder: IReminder) {
listener?.onShow()
lastShowV2XJob?.safeCancel()
lastSpeakJob?.safeCancel()
lastSpeakJob.get()?.safeCancel()
showingV2XTip = reminder
lifecycleScope.launch {
delay(expireTime)
@@ -914,7 +915,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
lifecycleScope.launch {
speak(it, ttsContent)
}.also { itx ->
lastSpeakJob = itx
lastSpeakJob.set(itx)
}
}
}
@@ -969,10 +970,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
"$M_HMI$TAG",
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
)
lastShowV2XJob?.safeCancel()
lastSpeakJob?.safeCancel()
lifecycleScope.launch {
delay(expireTime)
}.also { itx ->
@@ -983,10 +981,18 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
lifecycleScope.launch {
val last = lastSpeakJob.get()
Log.d("CODE", "---- 0 ------: last: $last")
if (last != null && !last.isCompleted) {
Log.d("CODE", "---- 1 ------")
return
}
lifecycleScope.launch(Dispatchers.Default) {
Log.d("CODE", "---- 2 ------")
speak(it, ttsContent)
Log.d("CODE", "---- 3 ------")
}.also { itx ->
lastSpeakJob = itx
lastSpeakJob.set(itx)
}
}
}

View File

@@ -61,7 +61,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
return BubbleNoticeHolder(view)
}
summary -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_summary,parent,false)
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_summary,parent,false)
return BubbleSummaryHolder(view)
}
else -> {

View File

@@ -38,11 +38,12 @@
<TextView
android:id="@+id/tvSummaryContent"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvSummaryTitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSummaryTitle"
app:layout_constraintRight_toRightOf="@id/tvSummaryTime"
android:gravity="start"
android:textColor="#B3FFFFFF"
android:textSize="28dp"

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp"
>
<ImageView
android:id="@+id/ivSummaryImage"
android:layout_width="140dp"
android:layout_height="130dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="15dp"
android:src="@drawable/icon_notice_default"
/>
<TextView
android:id="@+id/tvSummaryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="蘑菇小助手"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
app:layout_constraintLeft_toRightOf="@id/ivSummaryImage"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvSummaryContent"
android:layout_marginStart="15dp"
/>
<TextView
android:id="@+id/tvSummaryContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvSummaryTitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSummaryTitle"
app:layout_constraintRight_toRightOf="@id/tvSummaryTime"
android:gravity="start"
android:textColor="#B3FFFFFF"
android:textSize="28dp"
/>
<TextView
android:id="@+id/tvSummaryTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvSummaryTitle"
app:layout_constraintBottom_toBottomOf="@id/tvSummaryTitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -69,7 +69,7 @@ class V2XAiRoadEventMarker {
options.zIndex(75000f)
options.maxIndex(800000f)
val line = overlayManager.addPolyline(options)
current.set(Pair(line, null))
current.set(Pair(line, wrapper.markers))
if (line != null) {
line.isVisible = true
wrapper.addLine(line)

View File

@@ -27,6 +27,7 @@ import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.network.utils.GsonUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
@@ -72,16 +73,23 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
try {
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
//只展示不播报 不广播
boolean onlyShow = getV2XMessageEntity().isOnlyShow();
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
boolean onlyShow = entity.isOnlyShow();
if (!onlyShow) {
// 设置TTS
getV2XMessageEntity().getContent().getTts(false);
V2XRoadEventEntity content = entity.getContent();
if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) {
content.getTts(false);
}
}
showWindow();
String poiType = getV2XMessageEntity().getContent().getPoiType();
String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat());
String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon());
String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId();
String poiType = entity.getContent().getPoiType();
String lat = String.valueOf(entity.getContent().getLocation().getLat());
String lon = String.valueOf(entity.getContent().getLocation().getLon());
String infoId = entity.getContent().getNoveltyInfo().getInfoId();
String style = "1";
Map<String, Object> properties = new HashMap<>();
properties.put("dbid", infoId);
@@ -117,7 +125,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
if (carLocation != null && noveltyInfo != null) {
MarkerLocation eventLocation = noveltyInfo.getLocation();
if (eventLocation != null) {
double distance = CoordinateUtils.calculateLineDistance(carLocation.getLongitude(), carLocation.getLatitude(), eventLocation.getLon(), eventLocation.getLat());
double distance = content.getDistance();
alarmText = String.format(alarmText, Math.round(distance) + "");
ttsText = String.format(ttsText, Math.round(distance) + "");
}