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>