完成弹窗tts

This commit is contained in:
董宏宇
2021-08-06 16:07:32 +08:00
parent c484686c9d
commit 1b658d60af
31 changed files with 14 additions and 11 deletions

View File

@@ -18,6 +18,13 @@ import kotlin.random.Random
*/
class WarningBroadcastReceiver : BroadcastReceiver() {
private var mContext: Context? = null
companion object {
private const val TAG = "TestPanelBroadcastReceiver"
private var mMogoServiceApis: IMogoServiceApis? = null
private var mIMoGoWaringProvider: IMoGoWaringProvider? = null
}
override fun onReceive(context: Context, intent: Intent) {
try {
mMogoServiceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS)
@@ -60,10 +67,4 @@ class WarningBroadcastReceiver : BroadcastReceiver() {
)
}
companion object {
private const val TAG = "TestPanelBroadcastReceiver"
private var mMogoServiceApis: IMogoServiceApis? = null
private var mIMoGoWaringProvider: IMoGoWaringProvider? = null
}
}

View File

@@ -6,6 +6,7 @@ import android.view.View
import android.view.WindowManager
import android.view.animation.OvershootInterpolator
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.module.hmi.R
import com.mogo.module.hmi.notification.WarningFloat
import com.mogo.module.hmi.notification.anim.DefaultAnimator
@@ -50,11 +51,12 @@ class MoGoWarningFragment : MvpFragment<MoGoWarningContract.View?, WaringPresent
val notificationView = ViewV2XNotification(activity)
notificationView.setWarningIcon(WarningUtils.getWarningIcon(v2xType)[0] as Int)
if (alertContent != null) {
notificationView.setWarningContent(alertContent)
}else{
notificationView.setWarningContent(WarningUtils.getWarningIcon(v2xType)[1] as String)
}
notificationView.setWarningContent(
alertContent ?: WarningUtils.getWarningIcon(v2xType)[1] as String
)
AIAssist.getInstance(activity)
.speakTTSVoice(ttsContent ?: WarningUtils.getWarningIcon(v2xType)[2] as String)
WarningFloat.with(it)
.setTag(tag)