[Fix bug]修复instance.setArguments多次调用造成 fragment already add,问题
Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -17,7 +17,7 @@ buildscript {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31'
|
||||
classpath "com.alibaba:arouter-register:1.0.8-mogo"
|
||||
classpath "com.alibaba:arouter-register:1.0.9-mogo"
|
||||
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
|
||||
// classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||
// classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||
|
||||
@@ -50,8 +50,8 @@ ext {
|
||||
rxjava : "io.reactivex.rxjava2:rxjava:2.2.2",
|
||||
rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.1",
|
||||
// arouter
|
||||
arouter : "com.alibaba:arouter-api:1.0.8-mogo",
|
||||
aroutercompiler : "com.alibaba:arouter-compiler:1.0.8-mogo",
|
||||
arouter : "com.alibaba:arouter-api:1.0.9-mogo",
|
||||
aroutercompiler : "com.alibaba:arouter-compiler:1.0.9-mogo",
|
||||
// glide
|
||||
glide : 'com.github.bumptech.glide:glide:4.8.0',
|
||||
glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0',
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
@@ -61,10 +58,6 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
private var cameraListView: CameraListView? = null
|
||||
private var cameraViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
override fun init(context: Context?) {
|
||||
Log.d(TAG, "init")
|
||||
}
|
||||
|
||||
override fun vipIdentification(visible: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
Logger.d(TAG, "vipIdentification")
|
||||
@@ -76,13 +69,6 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
return null
|
||||
}
|
||||
|
||||
override val functionName: String
|
||||
get() = TAG
|
||||
|
||||
override fun initViews() {
|
||||
initViewShowWithConfig()
|
||||
ivCameraIcon?.setOnClickListener {
|
||||
@@ -433,8 +419,8 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
|
||||
@@ -3,13 +3,12 @@ package com.mogo.eagle.core.function.api.hmi.warning
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/2 7:36 下午
|
||||
*/
|
||||
interface IMoGoWaringProvider : IMoGoFunctionProvider {
|
||||
interface IMoGoWaringProvider {
|
||||
|
||||
/**
|
||||
* 隐藏 脉速表
|
||||
|
||||
@@ -16,15 +16,15 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
* HMI 调用者管理,这里对外及其他模块提供功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去
|
||||
*/
|
||||
object CallerHmiManager : CallerBase() {
|
||||
private val waringProviderApi: IMoGoWaringProvider
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation() as IMoGoWaringProvider;
|
||||
private val waringProviderApi: IMoGoWaringProvider?
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation() as IMoGoWaringProvider
|
||||
|
||||
/**
|
||||
* 隐藏 脉速表
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setSpeedChartViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setSpeedChartViewVisibility(visibility)
|
||||
waringProviderApi?.setSpeedChartViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setAutopilotStatusViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setAutopilotStatusViewVisibility(visibility)
|
||||
waringProviderApi?.setAutopilotStatusViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setPerspectiveSwitchViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setPerspectiveSwitchViewVisibility(visibility)
|
||||
waringProviderApi?.setPerspectiveSwitchViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setCheckStatusViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setCheckStatusViewVisibility(visibility)
|
||||
waringProviderApi?.setCheckStatusViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ object CallerHmiManager : CallerBase() {
|
||||
tag: String?,
|
||||
listenerIMoGo: IMoGoWarningStatusListener?
|
||||
) {
|
||||
waringProviderApi.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo)
|
||||
waringProviderApi?.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param tag 弹窗标识
|
||||
*/
|
||||
fun disableWarningV2X(tag: String?) {
|
||||
waringProviderApi.disableWarningV2X(tag)
|
||||
waringProviderApi?.disableWarningV2X(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,35 +83,35 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
||||
*/
|
||||
fun showWarningTrafficLight(checkLightId: Int) {
|
||||
waringProviderApi.showWarningTrafficLight(checkLightId)
|
||||
waringProviderApi?.showWarningTrafficLight(checkLightId)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭红绿灯预警
|
||||
*/
|
||||
fun disableWarningTrafficLight() {
|
||||
waringProviderApi.disableWarningTrafficLight()
|
||||
waringProviderApi?.disableWarningTrafficLight()
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改红灯倒计时
|
||||
*/
|
||||
fun changeCountdownRed(redNum: Int) {
|
||||
waringProviderApi.changeCountdownRed(redNum)
|
||||
waringProviderApi?.changeCountdownRed(redNum)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改黄灯倒计时
|
||||
*/
|
||||
fun changeCountdownYellow(yellowNum: Int) {
|
||||
waringProviderApi.changeCountdownYellow(yellowNum)
|
||||
waringProviderApi?.changeCountdownYellow(yellowNum)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿灯倒计时
|
||||
*/
|
||||
fun changeCountdownGreen(greenNum: Int) {
|
||||
waringProviderApi.changeCountdownGreen(greenNum)
|
||||
waringProviderApi?.changeCountdownGreen(greenNum)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param greenNum 绿灯倒计时
|
||||
*/
|
||||
fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) {
|
||||
waringProviderApi.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
|
||||
waringProviderApi?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,14 +129,14 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param limitingSpeed 限速速度
|
||||
*/
|
||||
fun showLimitingVelocity(limitingSpeed: Int) {
|
||||
waringProviderApi.showLimitingVelocity(limitingSpeed)
|
||||
waringProviderApi?.showLimitingVelocity(limitingSpeed)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭限速预警
|
||||
*/
|
||||
fun disableLimitingVelocity() {
|
||||
waringProviderApi.disableLimitingVelocity()
|
||||
waringProviderApi?.disableLimitingVelocity()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,7 +145,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum) {
|
||||
waringProviderApi.showWarning(direction)
|
||||
waringProviderApi?.showWarning(direction)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param closeTime 倒计时
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
waringProviderApi.showWarning(direction, closeTime)
|
||||
waringProviderApi?.showWarning(direction, closeTime)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,7 +164,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param trafficStylePushData
|
||||
*/
|
||||
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
|
||||
waringProviderApi.showNoticeForTrafficWithData(trafficStylePushData)
|
||||
waringProviderApi?.showNoticeForTrafficWithData(trafficStylePushData)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,21 +172,21 @@ object CallerHmiManager : CallerBase() {
|
||||
*
|
||||
*/
|
||||
fun showNoticeNormalData(noticeNormal: NoticeNormalData) {
|
||||
waringProviderApi.showNoticeNormalData(noticeNormal)
|
||||
waringProviderApi?.showNoticeNormalData(noticeNormal)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示VIP标识
|
||||
*/
|
||||
fun vipIdentification(visible: Boolean) {
|
||||
waringProviderApi.vipIdentification(visible)
|
||||
waringProviderApi?.vipIdentification(visible)
|
||||
}
|
||||
|
||||
fun startRoadCameraLive(flvUrl: String) {
|
||||
waringProviderApi.startRoadCameraLive(flvUrl)
|
||||
waringProviderApi?.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
fun showNoSignalView() {
|
||||
waringProviderApi.showNoSignView()
|
||||
waringProviderApi?.showNoSignView()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user