rebase
This commit is contained in:
@@ -59,12 +59,16 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
} else {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':services:mogo-service-api')
|
||||
implementation project(":modules:mogo-module-common")
|
||||
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.carchatting" >
|
||||
|
||||
<application>
|
||||
<!--这里是为了测试增加的广播-->
|
||||
<receiver android:name=".biz.Test">
|
||||
<intent-filter>
|
||||
<action android:name="com.callchat" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_SERVICE_APIS
|
||||
import com.mogo.module.carchatting.R
|
||||
import com.mogo.module.carchatting.bean.UserInfo
|
||||
import com.mogo.module.carchatting.card.CallChatConstant.Companion.MODULE_NAME
|
||||
import com.mogo.module.carchatting.card.CallChatConstant.Companion.TAG
|
||||
import com.mogo.module.carchatting.util.*
|
||||
import com.mogo.module.carchatting.view.CallingWindowManager.Companion.callingWindowManager
|
||||
import com.mogo.module.carchatting.view.MapViewManager.Companion.mapViewManager
|
||||
@@ -35,7 +36,6 @@ class CallChatCenter private constructor() : IBizCallChat.IBizCallBack, IVoiceCo
|
||||
IVoiceIntentListener {
|
||||
|
||||
companion object {
|
||||
const val TAG: String = "CallChatCenter"
|
||||
|
||||
val callChatCenter by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
CallChatCenter()
|
||||
@@ -383,6 +383,7 @@ class CallChatCenter private constructor() : IBizCallChat.IBizCallBack, IVoiceCo
|
||||
private fun hideLauncherCallingView() {
|
||||
callWindowHideCallBack()
|
||||
callingWindowManager.hideCallingView()
|
||||
callingWindowManager.hideIncomingView()
|
||||
}
|
||||
|
||||
private fun callWindowShowCallBack() {
|
||||
@@ -407,6 +408,7 @@ class CallChatCenter private constructor() : IBizCallChat.IBizCallBack, IVoiceCo
|
||||
Logger.d(TAG, "answerCall")
|
||||
taskMainLaunch {
|
||||
callingWindowManager.hideIncomingView()
|
||||
showLauncherCallingView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.module.carchatting.biz
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.*
|
||||
import com.mogo.chat.callcenter.CallController.Companion.callController
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
@@ -15,6 +14,7 @@ import com.mogo.chat.util.CallTimer.Companion.callTimer
|
||||
import com.mogo.chat.util.UserInfoHelper.currentCallType
|
||||
import com.mogo.chat.util.UserInfoHelper.tmpSenderInfo
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.module.carchatting.R
|
||||
import com.mogo.module.carchatting.bean.EnthusiasmIndex
|
||||
import com.mogo.module.carchatting.bean.Result
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.module.carchatting.biz
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.module.carchatting.bean.UserInfo
|
||||
|
||||
class Test:BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
CallChatCenter.callChatCenter.showIncomingCall(UserInfo("123",123,"","","","","","","",""))
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.module.carchatting.net
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.exception.ApiException
|
||||
import com.mogo.chat.exception.ApiException.Companion.NULL_REQUEST_DATA_API_EXCEPTION
|
||||
import com.mogo.chat.exception.CallApiException
|
||||
import com.mogo.chat.exception.CommonException.Companion.NETWORK_EXCEPTION
|
||||
import com.mogo.chat.exception.CommonException.Companion.NULL_EXCEPTION
|
||||
import com.mogo.chat.exception.CommonException.Companion.NULL_REQUEST_DATA_API_EXCEPTION
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import kotlinx.coroutines.*
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
@@ -63,7 +63,7 @@ class Request<T> {
|
||||
if (result.code == 0) {
|
||||
onSuccess?.invoke(result)
|
||||
} else {
|
||||
throw ApiException(result.code, result.msg)
|
||||
throw CallApiException(result.code, result.msg)
|
||||
}
|
||||
} else {
|
||||
throw NULL_REQUEST_DATA_API_EXCEPTION
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.carchatting.net
|
||||
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.TeammateInfo
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.module.carchatting.bean.Result
|
||||
import retrofit2.http.FieldMap
|
||||
import retrofit2.http.FormUrlEncoded
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.carchatting.net
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.debug.DebugConfig.CAR_MACHINE_TYPE_BYD
|
||||
import com.mogo.module.carchatting.R
|
||||
import com.mogo.module.carchatting.bean.UserInfo
|
||||
import com.mogo.module.carchatting.biz.CallChatCenter
|
||||
import com.mogo.module.carchatting.view.VrModeHelper.Companion.vrModeHelper
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget
|
||||
@@ -94,7 +93,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
quitVehicleTeam: () -> Unit,
|
||||
moveToCenter: () -> Unit
|
||||
) {
|
||||
Logger.d(CallChatCenter.TAG, "CallingWindowManager init --->")
|
||||
Logger.d(TAG, "CallingWindowManager init --->")
|
||||
this.mContext = context
|
||||
this.serviceApi = serviceApi
|
||||
this.match = match
|
||||
@@ -106,7 +105,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
Logger.d(CallChatCenter.TAG, "CallingWindowManager initView --->")
|
||||
Logger.d(TAG, "CallingWindowManager initView --->")
|
||||
launcherCallingView = vrModeHelper.getCallingWindowLayoutView(mContext!!)
|
||||
launcherCallingView?.setOnClickListener { }
|
||||
launcherCallingView?.let { view ->
|
||||
@@ -176,27 +175,27 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
|
||||
fun showInitView() {
|
||||
if (DebugConfig.getCarMachineType() != CAR_MACHINE_TYPE_BYD) {
|
||||
Logger.d(CallChatCenter.TAG, "showInitView Mogo车机不执行")
|
||||
Logger.d(TAG, "showInitView Mogo车机不执行")
|
||||
return
|
||||
}
|
||||
if (launcherCallingView == null) {
|
||||
Logger.d(CallChatCenter.TAG, "展示Launcher浮窗 showInitView")
|
||||
Logger.d(TAG, "展示Launcher浮窗 showInitView")
|
||||
initView()
|
||||
showCallingWindow()
|
||||
Logger.d(CallChatCenter.TAG, "添加浮窗成功 showInitView")
|
||||
Logger.d(TAG, "添加浮窗成功 showInitView")
|
||||
}
|
||||
}
|
||||
|
||||
fun showMatchingView() {
|
||||
if (launcherCallingView == null) {
|
||||
Logger.d(CallChatCenter.TAG, "展示Launcher浮窗 showMatchingView")
|
||||
Logger.d(TAG, "展示Launcher浮窗 showMatchingView")
|
||||
initView()
|
||||
matchView?.visibility = View.GONE
|
||||
moduleCarchattingTeamRlView?.visibility = View.GONE
|
||||
callingView?.visibility = View.GONE
|
||||
matchingView?.visibility = View.VISIBLE
|
||||
showCallingWindow()
|
||||
Logger.d(CallChatCenter.TAG, "添加浮窗成功 showMatchingView")
|
||||
Logger.d(TAG, "添加浮窗成功 showMatchingView")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +204,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
hangUpIncomingBack: () -> Unit
|
||||
) {
|
||||
Logger.d(
|
||||
CallChatCenter.TAG,
|
||||
TAG,
|
||||
"展示Launcher来电浮窗 showIncomingView===$isLauncherCallingViewShown"
|
||||
)
|
||||
this.agreeIncomingBack = agreeIncomingBack
|
||||
@@ -253,7 +252,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
params.topMargin = y.toInt()
|
||||
serviceApi?.windowManagerApi?.addView(launcherIncomingView, params, true)
|
||||
isLauncherIncomingViewShown = true
|
||||
Logger.d(CallChatCenter.TAG, "添加浮窗成功 addIncomingView===$isLauncherCallingViewShown")
|
||||
Logger.d(TAG, "添加浮窗成功 addIncomingView===$isLauncherCallingViewShown")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,14 +260,14 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
currentUserInfo: UserInfo?,
|
||||
hangUpCallBack: () -> Unit
|
||||
) {
|
||||
Logger.d(CallChatCenter.TAG, "展示Launcher浮窗 showCallingView===$isLauncherCallingViewShown")
|
||||
Logger.d(TAG, "展示Launcher浮窗 showCallingView===$isLauncherCallingViewShown")
|
||||
if (!isLauncherCallingViewShown) {
|
||||
addCallWindowView(hangUpCallBack) {
|
||||
refreshCallWindowData(currentUserInfo)
|
||||
}
|
||||
} else {
|
||||
Logger.d(
|
||||
CallChatCenter.TAG,
|
||||
TAG,
|
||||
"刷新Launcher浮窗数据 showCallingView===currentUserInfo :$currentUserInfo"
|
||||
)
|
||||
refreshCallWindowData(currentUserInfo)
|
||||
@@ -294,7 +293,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
showCallingWindow()
|
||||
refreshData.invoke()
|
||||
isLauncherCallingViewShown = true
|
||||
Logger.d(CallChatCenter.TAG, "添加浮窗成功 addCallWindowView===$isLauncherCallingViewShown")
|
||||
Logger.d(TAG, "添加浮窗成功 addCallWindowView===$isLauncherCallingViewShown")
|
||||
}
|
||||
|
||||
private fun refreshCallWindowData(currentUserInfo: UserInfo?) {
|
||||
@@ -329,7 +328,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
if (!isLauncherIncomingViewShown) {
|
||||
return
|
||||
}
|
||||
Logger.d(CallChatCenter.TAG, "隐藏Launcher来电浮窗===$isLauncherCallingViewShown")
|
||||
Logger.d(TAG, "隐藏Launcher来电浮窗===$isLauncherCallingViewShown")
|
||||
releaseAudioAndVoice()
|
||||
if (isLauncherIncomingViewShown) {
|
||||
isLauncherIncomingViewShown = false
|
||||
@@ -340,7 +339,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
}
|
||||
|
||||
fun hideCallingView() {
|
||||
Logger.d(CallChatCenter.TAG, "隐藏Launcher浮窗===$isLauncherCallingViewShown")
|
||||
Logger.d(TAG, "隐藏Launcher浮窗===$isLauncherCallingViewShown")
|
||||
if (isLauncherCallingViewShown) {
|
||||
callingTimer?.text = null
|
||||
callingNickName?.text = null
|
||||
@@ -360,13 +359,13 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
}
|
||||
|
||||
fun updateTimer(timeStr: String) {
|
||||
Logger.d(CallChatCenter.TAG, "CallingWindowManager updateView===$timeStr")
|
||||
Logger.d(TAG, "CallingWindowManager updateView===$timeStr")
|
||||
callingTimer?.text = timeStr
|
||||
}
|
||||
|
||||
fun showVehicleTeamView() {
|
||||
Logger.d(
|
||||
CallChatCenter.TAG,
|
||||
TAG,
|
||||
"showVehicleTeamView isLauncherCallingViewShown ===$isLauncherCallingViewShown"
|
||||
)
|
||||
if (!isLauncherCallingViewShown) {
|
||||
@@ -386,7 +385,7 @@ class CallingWindowManager private constructor() : IVoiceIntentListener {
|
||||
|
||||
fun hideVehicleTeamView() {
|
||||
Logger.d(
|
||||
CallChatCenter.TAG,
|
||||
TAG,
|
||||
"hideVehicleTeamView isLauncherCallingViewShown ===$isLauncherCallingViewShown"
|
||||
)
|
||||
callingView?.visibility = View.GONE
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.module.carchatting.R
|
||||
import com.mogo.module.carchatting.bean.UserInfo
|
||||
import com.mogo.module.carchatting.biz.CallChatCenter
|
||||
import com.mogo.module.carchatting.biz.CallChatCenter.Companion.callChatCenter
|
||||
import com.mogo.module.carchatting.card.CallChatConstant.Companion.TAG
|
||||
import com.mogo.module.carchatting.view.VrModeHelper.Companion.vrModeHelper
|
||||
import com.mogo.module.carchatting.voice.IVoiceCommandListener
|
||||
import com.mogo.module.carchatting.voice.VoiceUtil
|
||||
@@ -89,7 +90,7 @@ class TeamInvitationWindowManager private constructor() {
|
||||
try {
|
||||
job = GlobalScope.launch(Dispatchers.Main) {
|
||||
delay(1000 * 20)
|
||||
Logger.d(CallChatCenter.TAG, "refuseCall()--->executed")
|
||||
Logger.d(TAG, "refuseCall()--->executed")
|
||||
callChatCenter.refuseCall(userInfo!!.sn)
|
||||
hideTeamInvitationView()
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.module.carchatting.R
|
||||
import com.mogo.module.carchatting.bean.EnthusiasmIndex
|
||||
import com.mogo.module.carchatting.bean.UserInfo
|
||||
import com.mogo.module.carchatting.biz.CallChatCenter
|
||||
import com.mogo.module.carchatting.biz.CallChatCenter.Companion.callChatCenter
|
||||
import com.mogo.module.carchatting.voice.IVoiceCommandListener
|
||||
import com.mogo.module.carchatting.voice.VoiceUtil
|
||||
@@ -52,7 +51,6 @@ class UserDialog : BaseFloatDialog {
|
||||
|
||||
constructor(mogoDriverInfo: MogoDriverInfo, context: Context) : super(context) {
|
||||
driverInfo = mogoDriverInfo
|
||||
Logger.i(CallChatCenter.TAG, "构造函数赋值 driverInfo:$driverInfo")
|
||||
initView()
|
||||
}
|
||||
|
||||
@@ -83,12 +81,10 @@ class UserDialog : BaseFloatDialog {
|
||||
if (moduleCallChatRatingBar!!.visibility == View.VISIBLE) {
|
||||
moduleCallChatRatingBar!!.visibility = View.GONE
|
||||
}
|
||||
Logger.i(CallChatCenter.TAG, "initView driverInfo sn === ${driverInfo?.sn}")
|
||||
val sn = driverInfo?.sn
|
||||
sn?.let {
|
||||
if (it != MoGoAiCloudClientConfig.getInstance().sn) {
|
||||
callChatCenter.updateUserCallStatus { status ->
|
||||
Logger.i(CallChatCenter.TAG, "刷新用户信息打电话状态=== $status")
|
||||
if (status) {
|
||||
moduleCallChatUserCaller?.visibility = View.VISIBLE
|
||||
}
|
||||
@@ -101,7 +97,6 @@ class UserDialog : BaseFloatDialog {
|
||||
}
|
||||
|
||||
private fun refreshUserWindowData() {
|
||||
Logger.i(CallChatCenter.TAG, "refreshUserWindowData")
|
||||
val options: RequestOptions =
|
||||
RequestOptions().circleCrop()
|
||||
.placeholder(R.mipmap.module_carchatting_default_head_img)
|
||||
@@ -126,7 +121,6 @@ class UserDialog : BaseFloatDialog {
|
||||
}
|
||||
|
||||
fun updateUserInfo(mogoDriverInfo: MogoDriverInfo?) {
|
||||
Logger.i(CallChatCenter.TAG, "updateUserInfo 赋值前 mogoDriverInfo: $mogoDriverInfo")
|
||||
mogoDriverInfo?.let {
|
||||
driverInfo?.let { driverInfo ->
|
||||
if (driverInfo.userHead.isNullOrBlank()) {
|
||||
@@ -137,7 +131,6 @@ class UserDialog : BaseFloatDialog {
|
||||
}
|
||||
}
|
||||
}
|
||||
Logger.i(CallChatCenter.TAG, "updateUserInfo 赋值后 driverInfo : $driverInfo , 准备更新用户信息")
|
||||
refreshUserWindowData()
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.carchatting.view
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.module.carchatting.bean.EnthusiasmIndex
|
||||
import com.mogo.module.carchatting.biz.CallChatCenter
|
||||
import com.mogo.module.carchatting.card.CallChatConstant.Companion.TAG
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.zhidao.carchattingprovider.MogoDriverInfo
|
||||
|
||||
@@ -26,7 +27,7 @@ class UserWindowManager private constructor() {
|
||||
mogoDriverInfo: MogoDriverInfo,
|
||||
userWindowListener: ((Boolean) -> Unit)
|
||||
) {
|
||||
Logger.d(CallChatCenter.TAG, "展示用户信息浮窗===mogoDriverInfo : $mogoDriverInfo")
|
||||
Logger.d(TAG, "展示用户信息浮窗===mogoDriverInfo : $mogoDriverInfo")
|
||||
this.userWindowListener = userWindowListener
|
||||
val context = ContextHolderUtil.getContext()
|
||||
context?.let {
|
||||
@@ -34,22 +35,22 @@ class UserWindowManager private constructor() {
|
||||
userDialog = UserDialog(mogoDriverInfo, it)
|
||||
userDialog!!.show()
|
||||
userDialog!!.setOnDismissListener {
|
||||
Logger.d(CallChatCenter.TAG, "主动隐藏用户信息浮窗===")
|
||||
Logger.d(TAG, "主动隐藏用户信息浮窗===")
|
||||
userDialog = null
|
||||
this.userWindowListener?.invoke(false)
|
||||
this.userWindowListener = null
|
||||
}
|
||||
this.userWindowListener?.invoke(true)
|
||||
Logger.d(CallChatCenter.TAG, "添加用户信息浮窗成功===")
|
||||
Logger.d(TAG, "添加用户信息浮窗成功===")
|
||||
} else {
|
||||
Logger.d(CallChatCenter.TAG, "刷新用户信息浮窗数据===mogoDriverInfo :$mogoDriverInfo")
|
||||
Logger.d(TAG, "刷新用户信息浮窗数据===mogoDriverInfo :$mogoDriverInfo")
|
||||
updateUserInfo(mogoDriverInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updateUserEnthusiasmIndex(enthusiasmIndex: EnthusiasmIndex) {
|
||||
Logger.d(CallChatCenter.TAG, "刷新用户热心指数=== $enthusiasmIndex")
|
||||
Logger.d(TAG, "刷新用户热心指数=== $enthusiasmIndex")
|
||||
userDialog?.let {
|
||||
if(it.isShowing){
|
||||
userDialog?.updateUserEnthusiasmIndex(enthusiasmIndex)
|
||||
@@ -58,7 +59,7 @@ class UserWindowManager private constructor() {
|
||||
}
|
||||
|
||||
fun updateUserInfo(mogoDriverInfo: MogoDriverInfo) {
|
||||
Logger.d(CallChatCenter.TAG, "刷新用户信息=== $mogoDriverInfo")
|
||||
Logger.d(TAG, "刷新用户信息=== $mogoDriverInfo")
|
||||
userDialog?.let {
|
||||
if(it.isShowing){
|
||||
userDialog?.updateUserInfo(mogoDriverInfo)
|
||||
@@ -67,7 +68,7 @@ class UserWindowManager private constructor() {
|
||||
}
|
||||
|
||||
fun hideUserView() {
|
||||
Logger.d(CallChatCenter.TAG, "隐藏用户信息浮窗===")
|
||||
Logger.d(TAG, "隐藏用户信息浮窗===")
|
||||
userDialog?.dismiss()
|
||||
userWindowListener?.invoke(false)
|
||||
userWindowListener = null
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mogo.module.carchatting.view
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.TeammateInfo
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.module.carchatting.net.Repository
|
||||
import com.mogo.module.carchatting.net.request
|
||||
|
||||
|
||||
@@ -78,24 +78,19 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogowebsocket
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
implementation rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
compileOnly rootProject.ext.dependencies.mogomap
|
||||
compileOnly rootProject.ext.dependencies.mogoutils
|
||||
compileOnly rootProject.ext.dependencies.mogoserviceapi
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
|
||||
implementation project(":libraries:mogo-map")
|
||||
implementation project(":foudations:mogo-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':services:mogo-service-api')
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
|
||||
@@ -5,16 +5,17 @@ import com.mogo.chat.model.ChatServiceModel
|
||||
import com.mogo.chat.model.bean.AllUnit
|
||||
import com.mogo.chat.model.bean.LocationCarsWithRadius
|
||||
import com.mogo.chat.model.bean.toSns
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.util.UserInfoHelper
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
open class BaseController {
|
||||
|
||||
val chatServiceModel: ChatServiceModel = ChatServiceModel()
|
||||
|
||||
fun getUserInfo(onSuccess: (() -> Unit)? = null, onError: ((Exception) -> Unit)? = null) {
|
||||
if (!UserInfoHelper.userInfo.sn.isBlank()) {
|
||||
if (UserInfoHelper.userInfo.sn.isNotBlank()) {
|
||||
log(TAG, "userInfo getSn : ${UserInfoHelper.userInfo}")
|
||||
onSuccess?.invoke()
|
||||
return
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.chat.util.UserInfoHelper.userInfo
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.getRoomId
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.chat.base
|
||||
|
||||
import com.mogo.chat.constant.HttpConstants
|
||||
|
||||
class BaseResponse<out T>(val code: Int, val msg: String, val result: T) {
|
||||
|
||||
fun isSuccess(baseUrl: String): Boolean {
|
||||
return when (baseUrl) {
|
||||
HttpConstants.getBaseUrl() -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.mogo.chat.exception
|
||||
|
||||
class ApiException : CommonException {
|
||||
|
||||
companion object {
|
||||
val NULL_REQUEST_DATA_API_EXCEPTION = ApiException(2, "request data is null")
|
||||
val ENTER_ROOM_API_EXCEPTION = ApiException(3, "roomId is null or already enter room")
|
||||
}
|
||||
|
||||
constructor(code: Int, msg: String) : super(code, msg)
|
||||
|
||||
fun getErrorMsg():String{
|
||||
return msg
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.mogo.chat.exception
|
||||
|
||||
class CallApiException : CommonException {
|
||||
|
||||
companion object {
|
||||
|
||||
val ENTER_ROOM_API_EXCEPTION = CallApiException(3, "roomId is null or already enter room")
|
||||
}
|
||||
|
||||
constructor(code: Int, msg: String) : super(code, msg)
|
||||
|
||||
fun getErrorMsg():String{
|
||||
return msg
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ open class CommonException :Exception{
|
||||
companion object{
|
||||
val NETWORK_EXCEPTION = CommonException(1, "network is error")
|
||||
val NULL_EXCEPTION = CommonException(1, "exception is null")
|
||||
val NULL_REQUEST_DATA_API_EXCEPTION = CommonException(1, "request data is null")
|
||||
}
|
||||
|
||||
protected var code: Int = 0
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.chat.model
|
||||
|
||||
import com.mogo.chat.base.BaseRepository
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.constant.HttpConstants.Companion.getConfig
|
||||
import com.mogo.chat.model.bean.OnLineStatus
|
||||
import com.mogo.chat.model.bean.UserInfoBySns
|
||||
import com.mogo.chat.model.bean.UserInfoBySnsRequest
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
|
||||
|
||||
class ChatServiceModel : BaseRepository() {
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.chat.model
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseRepository
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.FocusBlackListRequest
|
||||
import com.mogo.chat.model.bean.FocusData
|
||||
import com.mogo.chat.model.bean.FriendRequest
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
|
||||
class FocusModel : BaseRepository() {
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.chat.model
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseRepository
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.FriendData
|
||||
import com.mogo.chat.model.bean.FriendOrSelfOnLine
|
||||
import com.mogo.chat.model.bean.FriendRequest
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
|
||||
class FriendModel : BaseRepository() {
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.mogo.chat.model.bean
|
||||
|
||||
fun OnLineStatus.onLine(): Boolean {
|
||||
return carOnLine == 1 && onLine == 1
|
||||
}
|
||||
|
||||
/**
|
||||
* carOnLine:ACC ON状态 1:在线 2:不在线
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.chat.model.control
|
||||
|
||||
import com.mogo.chat.R
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.CallController.Companion.callController
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
import com.mogo.chat.callcenter.exchangeToCallType
|
||||
@@ -12,9 +11,8 @@ import com.mogo.chat.constant.CALL_TYPE_VOICE
|
||||
import com.mogo.chat.constant.PUSH_MSG_DENY_ENTER
|
||||
import com.mogo.chat.constant.PUSH_MSG_HANG_UP
|
||||
import com.mogo.chat.constant.TAG
|
||||
import com.mogo.chat.exception.ApiException.Companion.ENTER_ROOM_API_EXCEPTION
|
||||
import com.mogo.chat.exception.CallApiException.Companion.ENTER_ROOM_API_EXCEPTION
|
||||
import com.mogo.chat.model.bean.RoomInfo
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.util.CallTimer.Companion.callTimer
|
||||
import com.mogo.chat.util.MediaController
|
||||
import com.mogo.chat.util.UserInfoHelper
|
||||
@@ -23,6 +21,8 @@ import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.saveRoomId
|
||||
import com.mogo.chat.util.trackCall
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
|
||||
object ChatController : BaseController(), IGMEEventCallBack {
|
||||
|
||||
@@ -3,18 +3,18 @@ package com.mogo.chat.model.control
|
||||
import com.mogo.chat.R
|
||||
import com.mogo.chat.aspect.DebugLog
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
import com.mogo.chat.callcenter.IMType
|
||||
import com.mogo.chat.callcenter.canMatchTimeout
|
||||
import com.mogo.chat.constant.TAG
|
||||
import com.mogo.chat.model.bean.MatchRequestParam
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.net.taskDelayAsync
|
||||
import com.mogo.chat.provider.ServiceApi
|
||||
import com.mogo.chat.util.*
|
||||
import com.mogo.chat.util.audio.AudioFocusUtil
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package com.mogo.chat.model.control
|
||||
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.common.gme.IGMEEventCallBack
|
||||
import com.mogo.chat.constant.CALL_TYPE_VEHICLE_TEAM
|
||||
import com.mogo.chat.constant.PUSH_MSG_DENY_ENTER
|
||||
import com.mogo.chat.constant.PUSH_MSG_HANG_UP
|
||||
import com.mogo.chat.constant.TAG
|
||||
import com.mogo.chat.model.bean.CallRequestParam
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.provider.ServiceApi
|
||||
import com.mogo.chat.util.UserInfoHelper
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.getRoomId
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.network.Utils
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
object VehicleTeamController : BaseController(), IGMEEventCallBack {
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.mogo.chat.net
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.chat.exception.ApiException
|
||||
import com.mogo.chat.exception.ApiException.Companion.NULL_REQUEST_DATA_API_EXCEPTION
|
||||
import com.mogo.chat.exception.CommonException.Companion.NETWORK_EXCEPTION
|
||||
import com.mogo.chat.exception.CommonException.Companion.NULL_EXCEPTION
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import kotlinx.coroutines.*
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
import java.util.concurrent.TimeoutException
|
||||
|
||||
class Request<T> {
|
||||
private lateinit var loader: suspend () -> T
|
||||
|
||||
private var start: (() -> Unit)? = null
|
||||
|
||||
private var onSuccess: ((T) -> Unit)? = null
|
||||
|
||||
private var onError: ((java.lang.Exception) -> Unit)? = null
|
||||
|
||||
private var onComplete: (() -> Unit)? = null
|
||||
|
||||
private var addLifecycle: LifecycleOwner? = null
|
||||
|
||||
|
||||
infix fun loader(loader: suspend () -> T) {
|
||||
this.loader = loader
|
||||
}
|
||||
|
||||
infix fun start(start: (() -> Unit)?) {
|
||||
this.start = start
|
||||
}
|
||||
|
||||
infix fun onSuccess(onSuccess: ((T) -> Unit)?) {
|
||||
this.onSuccess = onSuccess
|
||||
}
|
||||
|
||||
infix fun onError(onError: ((java.lang.Exception) -> Unit)?) {
|
||||
this.onError = onError
|
||||
}
|
||||
|
||||
infix fun onComplete(onComplete: (() -> Unit)?) {
|
||||
this.onComplete = onComplete
|
||||
}
|
||||
|
||||
infix fun addLifecycle(addLifecycle: LifecycleOwner?) {
|
||||
this.addLifecycle = addLifecycle
|
||||
}
|
||||
|
||||
fun request() {
|
||||
|
||||
GlobalScope.launch(context = Dispatchers.Main) {
|
||||
|
||||
start?.invoke()
|
||||
try {
|
||||
val deferred = GlobalScope.async(Dispatchers.IO, start = CoroutineStart.LAZY) {
|
||||
loader()
|
||||
}
|
||||
val result = deferred.await()
|
||||
if (result != null && result is BaseResponse<*>) {
|
||||
if (result.code == 0) {
|
||||
onSuccess?.invoke(result)
|
||||
} else {
|
||||
throw ApiException(result.code, result.msg)
|
||||
}
|
||||
} else {
|
||||
throw NULL_REQUEST_DATA_API_EXCEPTION
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
//数据打点
|
||||
if (e == null) {
|
||||
onError?.invoke(NULL_EXCEPTION)
|
||||
}
|
||||
when (e) {
|
||||
is UnknownHostException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
is TimeoutException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
is SocketTimeoutException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
else -> onError?.invoke(java.lang.Exception(e.message))
|
||||
}
|
||||
} finally {
|
||||
onComplete?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> request(buildRequest: Request<T>.() -> Unit) {
|
||||
Request<T>().apply(buildRequest).request()
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.chat.net
|
||||
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.*
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import retrofit2.http.*
|
||||
|
||||
interface HttpApi {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.chat.service
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
import com.mogo.chat.callcenter.exchangeToCallType
|
||||
import com.mogo.chat.callcenter.isCalling
|
||||
@@ -12,11 +11,9 @@ import com.mogo.chat.constant.*
|
||||
import com.mogo.chat.model.bean.FocusStatus
|
||||
import com.mogo.chat.model.bean.OnLineStatus
|
||||
import com.mogo.chat.model.bean.UserInfoBySns
|
||||
import com.mogo.chat.model.bean.onLine
|
||||
import com.mogo.chat.model.control.ChatController
|
||||
import com.mogo.chat.model.control.MatchController
|
||||
import com.mogo.chat.model.control.VehicleTeamController
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.service.InvokeDataProxy.Companion.covertMapToSns
|
||||
import com.mogo.chat.util.UserInfoHelper.currentCallType
|
||||
import com.mogo.chat.util.UserInfoHelper.tmpSenderInfo
|
||||
@@ -24,13 +21,15 @@ import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.setCarOnLineStatus
|
||||
import com.mogo.chat.util.trackHangUp
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
object ChatServiceHandler : BaseController() {
|
||||
|
||||
fun call(
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
) {
|
||||
queryUserInfo(snReceiver, {
|
||||
val map = Gson().fromJson<Map<String, String>>(it, Map::class.java)
|
||||
@@ -47,9 +46,9 @@ object ChatServiceHandler : BaseController() {
|
||||
}
|
||||
|
||||
private fun realCall(
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
) {
|
||||
ChatController.call(snReceiver, 0, {
|
||||
onSuccess.invoke()
|
||||
@@ -63,7 +62,12 @@ object ChatServiceHandler : BaseController() {
|
||||
realHangUp(onSuccess, onError, roomId)
|
||||
}
|
||||
|
||||
fun refuseCall(sn: String?, onSuccess: () -> Unit, onError: (Exception) -> Unit, roomId: Int = -1) {
|
||||
fun refuseCall(
|
||||
sn: String?,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
roomId: Int = -1
|
||||
) {
|
||||
var hangUpSn: String? = sn
|
||||
if (hangUpSn.isNullOrBlank()) {
|
||||
if (tmpSenderInfo.sn.isBlank()) {
|
||||
@@ -80,53 +84,92 @@ object ChatServiceHandler : BaseController() {
|
||||
currentCallType == CALL_TYPE_VEHICLE_TEAM -> {
|
||||
trackHangUp(CALL_TYPE_VEHICLE_TEAM, "2")
|
||||
log(TAG, "hangUp VehicleTeam")
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(MoGoAiCloudClientConfig.getInstance().sn, PUSH_MSG_HANG_UP, CALL_TYPE_VEHICLE_TEAM, onSuccess, onError)
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
PUSH_MSG_HANG_UP,
|
||||
CALL_TYPE_VEHICLE_TEAM,
|
||||
onSuccess,
|
||||
onError
|
||||
)
|
||||
}
|
||||
GMEApi.isRoomEntered() || callTypeManager.callStatus.isCalling() -> {
|
||||
trackHangUp(callTypeManager.callStatus.exchangeToCallType(), "2")
|
||||
log(TAG, "hangUp Call")
|
||||
ChatController.requestConnectStatus(tmpSenderInfo.sn, PUSH_MSG_HANG_UP, onSuccess, onError, roomId)
|
||||
ChatController.requestConnectStatus(
|
||||
tmpSenderInfo.sn,
|
||||
PUSH_MSG_HANG_UP,
|
||||
onSuccess,
|
||||
onError,
|
||||
roomId
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
log(TAG, "realHangUp " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType")
|
||||
log(
|
||||
TAG, "realHangUp " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun realRefuse(sn: String, onSuccess: () -> Unit, onError: (Exception) -> Unit, roomId: Int = -1) {
|
||||
private fun realRefuse(
|
||||
sn: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
roomId: Int = -1
|
||||
) {
|
||||
log(TAG, "realRefuse currentCallType : $currentCallType ")
|
||||
when {
|
||||
currentCallType == CALL_TYPE_VEHICLE_TEAM -> {
|
||||
log(TAG, "refuse VehicleTeam")
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(sn, PUSH_MSG_DENY_ENTER, CALL_TYPE_VEHICLE_TEAM, onSuccess, onError)
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(
|
||||
sn,
|
||||
PUSH_MSG_DENY_ENTER,
|
||||
CALL_TYPE_VEHICLE_TEAM,
|
||||
onSuccess,
|
||||
onError
|
||||
)
|
||||
}
|
||||
callTypeManager.callStatus.isReadyCalling() -> {
|
||||
log(TAG, "refuse call")
|
||||
ChatController.requestConnectStatus(sn, PUSH_MSG_DENY_ENTER, onSuccess, onError, roomId)
|
||||
ChatController.requestConnectStatus(
|
||||
sn,
|
||||
PUSH_MSG_DENY_ENTER,
|
||||
onSuccess,
|
||||
onError,
|
||||
roomId
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
log(TAG, "realRefuse " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType")
|
||||
log(
|
||||
TAG, "realRefuse " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun answer(
|
||||
sn: String,
|
||||
roomId: Int,
|
||||
onSuccess: (() -> Unit)? = null,
|
||||
onError: ((Exception) -> Unit)? = null
|
||||
sn: String,
|
||||
roomId: Int,
|
||||
onSuccess: (() -> Unit)? = null,
|
||||
onError: ((Exception) -> Unit)? = null
|
||||
) {
|
||||
log(TAG, "answer currentCallType ==== $currentCallType")
|
||||
getUserInfo({
|
||||
when (currentCallType) {
|
||||
CALL_TYPE_VEHICLE_TEAM -> {
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(sn, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM, {
|
||||
onSuccess?.invoke()
|
||||
}, onError)
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(
|
||||
sn,
|
||||
PUSH_MSG_AGREE_ENTER,
|
||||
CALL_TYPE_VEHICLE_TEAM,
|
||||
{
|
||||
onSuccess?.invoke()
|
||||
},
|
||||
onError
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
ChatController.requestConnectStatus(sn, PUSH_MSG_AGREE_ENTER, {
|
||||
@@ -141,10 +184,10 @@ object ChatServiceHandler : BaseController() {
|
||||
}
|
||||
|
||||
fun startMatch(
|
||||
flag: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
timeOut: () -> Unit
|
||||
flag: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
timeOut: () -> Unit
|
||||
) {
|
||||
getUserInfo({
|
||||
MatchController.startMatch(flag, onSuccess, onError, timeOut)
|
||||
@@ -157,7 +200,11 @@ object ChatServiceHandler : BaseController() {
|
||||
MatchController.cancelMatch(onSuccess)
|
||||
}
|
||||
|
||||
fun inviteJoinVehicleTeam(invitedSn: String, onSuccess: () -> Unit, onError: (Exception) -> Unit) {
|
||||
fun inviteJoinVehicleTeam(
|
||||
invitedSn: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit
|
||||
) {
|
||||
VehicleTeamController.inviteJoinVehicleTeam(invitedSn, onSuccess, onError)
|
||||
}
|
||||
|
||||
@@ -212,7 +259,7 @@ object ChatServiceHandler : BaseController() {
|
||||
onSuccess {
|
||||
val onLineStatus = it.result
|
||||
log(TAG, "onLineStatus : $onLineStatus")
|
||||
onSuccess.invoke(onLineStatus.onLine())
|
||||
onSuccess.invoke(onLineStatus.carOnLine == 1 && onLineStatus.onLine == 1)
|
||||
}
|
||||
onError {
|
||||
onError.invoke(it)
|
||||
@@ -221,9 +268,9 @@ object ChatServiceHandler : BaseController() {
|
||||
}
|
||||
|
||||
fun queryUserInfo(
|
||||
sn: String,
|
||||
onSuccess: (userInfo: String) -> Unit,
|
||||
onError: (Exception) -> Unit
|
||||
sn: String,
|
||||
onSuccess: (userInfo: String) -> Unit,
|
||||
onError: (Exception) -> Unit
|
||||
) {
|
||||
request<BaseResponse<UserInfoBySns>> {
|
||||
loader {
|
||||
|
||||
@@ -76,7 +76,8 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.callchatprovider
|
||||
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
} else {
|
||||
@@ -87,6 +88,7 @@ dependencies {
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-carchattingprovider')
|
||||
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.constants.AdasRecognizedType;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.common.drawer.bean.SpeedData;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -4,16 +4,15 @@ import android.view.animation.LinearInterpolator;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.marker.RoadConditionInfoWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.constants.DataTypes
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.utils.WorkThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
|
||||
@@ -18,12 +18,16 @@ enum class EventTypeEnum(
|
||||
GAS_STATION("10001", "加油站", content = "加油站附近", tts = "加油站"),
|
||||
|
||||
//交通检查
|
||||
TRAFFIC_CHECK("10002", "交通检查", "前方交通检查",
|
||||
R.drawable.v2x_icon_jiaotongjiancha_vr, "前方交通检查", "交通检查"),
|
||||
TRAFFIC_CHECK(
|
||||
"10002", "交通检查", "前方交通检查",
|
||||
R.drawable.v2x_icon_jiaotongjiancha_vr, "前方交通检查", "交通检查"
|
||||
),
|
||||
|
||||
//封路
|
||||
ROAD_CLOSED("10003", "封路", "前方封路", R.drawable.v2x_icon_fenglu_vr,
|
||||
"前方封路", "道路封路"),
|
||||
ROAD_CLOSED(
|
||||
"10003", "封路", "前方封路", R.drawable.v2x_icon_fenglu_vr,
|
||||
"前方封路", "道路封路"
|
||||
),
|
||||
|
||||
//商场打折
|
||||
SHOP_DISCOUNT("10004", ""),
|
||||
@@ -32,23 +36,31 @@ enum class EventTypeEnum(
|
||||
FOURS_4S("10005", ""),
|
||||
|
||||
//施工
|
||||
FOURS_ROAD_WORK("10006", "道路施工", "前方施工", R.drawable.v2x_icon_daolushigong_vr,
|
||||
"前方施工", "道路施工"),
|
||||
FOURS_ROAD_WORK(
|
||||
"10006", "道路施工", "前方施工", R.drawable.v2x_icon_daolushigong_vr,
|
||||
"前方施工", "道路施工"
|
||||
),
|
||||
|
||||
//拥堵
|
||||
FOURS_BLOCK_UP("10007", "道路拥堵", "前方拥堵", R.drawable.v2x_icon_yongdu_vr,
|
||||
"前方道路拥堵", "道路拥堵"),
|
||||
FOURS_BLOCK_UP(
|
||||
"10007", "道路拥堵", "前方拥堵", R.drawable.v2x_icon_yongdu_vr,
|
||||
"前方道路拥堵", "道路拥堵"
|
||||
),
|
||||
|
||||
//积水
|
||||
FOURS_PONDING("10008", "道路积水", "前方道路积水", R.drawable.v2x_icon_jishui_vr,
|
||||
"前方道路积水", "道路积水"),
|
||||
FOURS_PONDING(
|
||||
"10008", "道路积水", "前方道路积水", R.drawable.v2x_icon_jishui_vr,
|
||||
"前方道路积水", "道路积水"
|
||||
),
|
||||
|
||||
//超市打折
|
||||
FOURS_SHOP_FREE("10009", ""),
|
||||
|
||||
//浓雾
|
||||
FOURS_FOG("10010", "出现浓雾", "浓雾预警", R.drawable.v2x_icon_nongwu_vr,
|
||||
"前方出现浓雾", "出现浓雾"),
|
||||
FOURS_FOG(
|
||||
"10010", "出现浓雾", "浓雾预警", R.drawable.v2x_icon_nongwu_vr,
|
||||
"前方出现浓雾", "出现浓雾"
|
||||
),
|
||||
|
||||
//结冰
|
||||
FOURS_ICE("10011", "路面结冰", content = "前方路面结冰", tts = "路面结冰"),
|
||||
@@ -57,28 +69,40 @@ enum class EventTypeEnum(
|
||||
FOURS_PARKING("10012", "停车场", content = "停车场附近", tts = "停车场"),
|
||||
|
||||
//事故
|
||||
FOURS_ACCIDENT("10013", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"),
|
||||
FOURS_ACCIDENT(
|
||||
"10013", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"
|
||||
),
|
||||
|
||||
//重大事故
|
||||
FOURS_ACCIDENT_01("1001301", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"),
|
||||
FOURS_ACCIDENT_01(
|
||||
"1001301", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"
|
||||
),
|
||||
|
||||
//特大事故
|
||||
FOURS_ACCIDENT_02("1001302", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"),
|
||||
FOURS_ACCIDENT_02(
|
||||
"1001302", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"
|
||||
),
|
||||
|
||||
//较大事故
|
||||
FOURS_ACCIDENT_03("1001303", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"),
|
||||
FOURS_ACCIDENT_03(
|
||||
"1001303", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"
|
||||
),
|
||||
|
||||
//一般事故
|
||||
FOURS_ACCIDENT_04("1001304", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"),
|
||||
FOURS_ACCIDENT_04(
|
||||
"1001304", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"
|
||||
),
|
||||
|
||||
//轻微事故
|
||||
FOURS_ACCIDENT_05("1001305", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"),
|
||||
FOURS_ACCIDENT_05(
|
||||
"1001305", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
|
||||
"前方交通事故", "交通事故"
|
||||
),
|
||||
|
||||
//身边
|
||||
FOURS_NEALY("10014", "身边事件"),
|
||||
@@ -123,220 +147,222 @@ enum class EventTypeEnum(
|
||||
TYPE_USECASE_ID_EBW(
|
||||
ObuConstants.USE_CASE_ID.EBW.toString(),
|
||||
"紧急制动预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_emergency_brake,
|
||||
content="前车急刹车",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_emergency_brake,
|
||||
content = "前车急刹车",
|
||||
tts = "前车急刹车"
|
||||
),
|
||||
TYPE_USECASE_ID_FCW(
|
||||
ObuConstants.USE_CASE_ID.FCW.toString(),
|
||||
"前向碰撞预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
|
||||
content="前车碰撞预警",
|
||||
tts="小心前车"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "前车碰撞预警",
|
||||
tts = "小心前车"
|
||||
),
|
||||
TYPE_USECASE_ID_ICW(
|
||||
ObuConstants.USE_CASE_ID.ICW.toString(),
|
||||
"交叉路口碰撞预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
|
||||
content="交叉路口碰撞预警",
|
||||
tts="注意交叉路口车辆"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "交叉路口碰撞预警",
|
||||
tts = "注意交叉路口车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_CLW(
|
||||
ObuConstants.USE_CASE_ID.CLW.toString(),
|
||||
"车辆失控预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_vehicle_control,
|
||||
content="前%s失控预警",
|
||||
tts="小心%s失控车辆"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_vehicle_control,
|
||||
content = "前%s失控预警",
|
||||
tts = "小心%s失控车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_DNPW(
|
||||
ObuConstants.USE_CASE_ID.DNPW.toString(),
|
||||
"逆向超车预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_reverse_overtaking,
|
||||
content="逆向超车预警",
|
||||
tts="注意对向来车"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_reverse_overtaking,
|
||||
content = "逆向超车预警",
|
||||
tts = "注意对向来车"
|
||||
),
|
||||
TYPE_USECASE_ID_AVW(
|
||||
ObuConstants.USE_CASE_ID.AVW.toString(),
|
||||
"异常车辆提醒",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content="%s车异常",
|
||||
tts="小心%s异常车辆"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "%s车异常",
|
||||
tts = "小心%s异常车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_BSW(
|
||||
ObuConstants.USE_CASE_ID.BSW.toString(),
|
||||
"盲区预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_blind_area_collision,
|
||||
content="%s后盲区预警",
|
||||
tts="注意%s后车辆"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_blind_area_collision,
|
||||
content = "%s后盲区预警",
|
||||
tts = "注意%s后车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_LCW(
|
||||
ObuConstants.USE_CASE_ID.LCW.toString(),
|
||||
"变道预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_reverse_overtaking,
|
||||
content="%s向变道预警",
|
||||
tts="注意%s后车辆"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_reverse_overtaking,
|
||||
content = "%s向变道预警",
|
||||
tts = "注意%s后车辆"
|
||||
),//注意左后车辆/注意右后车辆
|
||||
TYPE_USECASE_ID_EVW(
|
||||
ObuConstants.USE_CASE_ID.EVW.toString(),
|
||||
"紧急车辆提醒",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_special_vehicle_access,
|
||||
content="注意特种车辆通行",
|
||||
tts="请避让特种车辆"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_special_vehicle_access,
|
||||
content = "注意特种车辆通行",
|
||||
tts = "请避让特种车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_VRUCW_PERSON(
|
||||
0X2B0201.toString(),
|
||||
"弱势交通参与者碰撞预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_pedestrian_crossing,
|
||||
content="注意行人",
|
||||
tts="注意行人"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
|
||||
content = "注意行人",
|
||||
tts = "注意行人"
|
||||
),//行人/摩托车碰撞预警
|
||||
TYPE_USECASE_ID_VRUCW_MOTORBIKE(
|
||||
0X2B0202.toString(),
|
||||
"弱势交通参与者碰撞预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_motorcycle_collision,
|
||||
content="注意摩托车",
|
||||
tts="注意摩托车"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
|
||||
content = "注意摩托车",
|
||||
tts = "注意摩托车"
|
||||
),//摩托车碰撞预警
|
||||
TYPE_USECASE_ID_SLW(
|
||||
ObuConstants.USE_CASE_ID.SLW.toString(),
|
||||
"限速预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_over_speed,
|
||||
content="已超速",
|
||||
tts="已超速"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_over_speed,
|
||||
content = "已超速",
|
||||
tts = "已超速"
|
||||
),
|
||||
TYPE_USECASE_ID_LTA(
|
||||
ObuConstants.USE_CASE_ID.LTA.toString(),
|
||||
"左转辅助",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
|
||||
content="左转碰撞预警",
|
||||
tts="注意路口对向来车"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "左转碰撞预警",
|
||||
tts = "注意路口对向来车"
|
||||
),
|
||||
TYPE_USECASE_ID_HLW(
|
||||
ObuConstants.USE_CASE_ID.HLW.toString(),
|
||||
"道路危险情况预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_road_dangerous,
|
||||
content="道路危险情况预警",
|
||||
tts="前方路况危险,小心行驶"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous,
|
||||
content = "道路危险情况预警",
|
||||
tts = "前方路况危险,小心行驶"
|
||||
),//(如果能给出具体的类别,则播报具体危险类别)
|
||||
TYPE_USECASE_ID_IVS(
|
||||
ObuConstants.USE_CASE_ID.IVS.toString(),
|
||||
"车内标牌",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_road_construction,
|
||||
content="车内标牌",
|
||||
tts=""
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_construction,
|
||||
content = "车内标牌",
|
||||
tts = ""
|
||||
),
|
||||
TYPE_USECASE_ID_TJW(
|
||||
ObuConstants.USE_CASE_ID.TJW.toString(),
|
||||
"前方拥堵提醒",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_congestion,
|
||||
content="前方%d米道路拥堵",
|
||||
tts="前方拥堵,减速慢行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_congestion,
|
||||
content = "前方%d米道路拥堵",
|
||||
tts = "前方拥堵,减速慢行"
|
||||
),
|
||||
TYPE_USECASE_ID_IVP(
|
||||
ObuConstants.USE_CASE_ID.IVP.toString(),
|
||||
"闯红灯预警",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_traffic_lights_red,
|
||||
content="路口红灯,禁止通行",
|
||||
tts="路口红灯,禁止通行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red,
|
||||
content = "路口红灯,禁止通行",
|
||||
tts = "路口红灯,禁止通行"
|
||||
),
|
||||
TYPE_USECASE_ID_IVP_GREEN(
|
||||
0x2B091.toString(),
|
||||
"绿波通行",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_traffic_lights_green,
|
||||
content="建议车速 %s KM/H",
|
||||
tts="建议车速 %s KM/H"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_green,
|
||||
content = "建议车速 %s KM/H",
|
||||
tts = "建议车速 %s KM/H"
|
||||
),
|
||||
TYPE_USECASE_ID_COC(
|
||||
ObuConstants.USE_CASE_ID.COC.toString(),
|
||||
"预留",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content="路况预警",
|
||||
tts="路况预警"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "路况预警",
|
||||
tts = "路况预警"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_TRAMCAR(
|
||||
0x2C01.toString(),
|
||||
"前方有轨电车提醒",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_tramcar,
|
||||
content="注意前方有轨电车",
|
||||
tts="注意前方有轨电车驶过"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_tramcar,
|
||||
content = "注意前方有轨电车",
|
||||
tts = "注意前方有轨电车驶过"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP(
|
||||
0x2C02.toString(),
|
||||
"前方左转急弯",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_turn_left_sharp,
|
||||
content="注意前方左转急弯",
|
||||
tts="前方路口左转急弯,减速慢行",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_turn_left_sharp,
|
||||
content = "注意前方左转急弯",
|
||||
tts = "前方路口左转急弯,减速慢行",
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP(
|
||||
0x2C03.toString(),
|
||||
"前方右转急弯",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_turn_right_sharp,
|
||||
content="注意前方右转急弯",
|
||||
tts="前方路口右转急弯,减速慢行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_turn_right_sharp,
|
||||
content = "注意前方右转急弯",
|
||||
tts = "前方路口右转急弯,减速慢行"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING(
|
||||
0x2C04.toString(),
|
||||
"人行横道",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_pedestrian_crossing,
|
||||
content="注意前方人行横道",
|
||||
tts="前方人行横道,减速慢行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
|
||||
content = "注意前方人行横道",
|
||||
tts = "前方人行横道,减速慢行"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL(
|
||||
0x2C05.toString(),
|
||||
"学校",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_school,
|
||||
content="注意前方学校",
|
||||
tts="前方学校,减速慢行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_school,
|
||||
content = "注意前方学校",
|
||||
tts = "前方学校,减速慢行"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_COLLISION_WARNING(
|
||||
0x2C06.toString(),
|
||||
"事故易发路段",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
|
||||
content="注意当前路段事故多发",
|
||||
tts="当前路段事故多发,请小心驾驶"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "注意当前路段事故多发",
|
||||
tts = "当前路段事故多发,请小心驾驶"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG(
|
||||
0x2C07.toString(),
|
||||
"环岛行驶",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_roundaboutpng,
|
||||
content="注意前方驶入环岛",
|
||||
tts="即将驶入环岛,减速慢行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_roundaboutpng,
|
||||
content = "注意前方驶入环岛",
|
||||
tts = "即将驶入环岛,减速慢行"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_TEST_SECTION(
|
||||
0x2C08.toString(),
|
||||
"驾校考试路段",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_test_section,
|
||||
content="注意前方驾校考试路段",
|
||||
tts="驾校考试路段,请小心驾驶"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_test_section,
|
||||
content = "注意前方驾校考试路段",
|
||||
tts = "驾校考试路段,请小心驾驶"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE(
|
||||
0x2C09.toString(),
|
||||
"驼峰桥",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_hump_bridge,
|
||||
content="注意前方驼峰桥",
|
||||
tts="注意即将驶入驼峰桥,请小心驾驶"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_hump_bridge,
|
||||
content = "注意前方驼峰桥",
|
||||
tts = "注意即将驶入驼峰桥,请小心驾驶"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_NO_PARKING(
|
||||
0x2C10.toString(),
|
||||
"禁止停车",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_no_parking,
|
||||
content="注意当前路段禁止停车",
|
||||
tts="当前路段,禁止停车"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_no_parking,
|
||||
content = "注意当前路段禁止停车",
|
||||
tts = "当前路段,禁止停车"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY(
|
||||
0x2C11.toString(),
|
||||
"减速慢行",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_give_way,
|
||||
content="注意路况复杂,减速慢行",
|
||||
tts="路况复杂,减速慢行"
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_give_way,
|
||||
content = "注意路况复杂,减速慢行",
|
||||
tts = "路况复杂,减速慢行"
|
||||
),
|
||||
TYPE_ERROR(
|
||||
ObuConstants.USE_CASE_ID.ERROR.toString(),
|
||||
"未知/错误/异常",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content="",
|
||||
tts=""
|
||||
);
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "",
|
||||
tts = ""
|
||||
),
|
||||
|
||||
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@@ -541,12 +567,12 @@ enum class EventTypeEnum(
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.tts
|
||||
FOURS_FOG.poiType -> FOURS_FOG.tts
|
||||
FOURS_ICE.poiType -> FOURS_ICE.tts
|
||||
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
|
||||
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
|
||||
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.tts
|
||||
else -> "道路事件"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getTtsWithFeedback(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
@@ -564,7 +590,7 @@ enum class EventTypeEnum(
|
||||
else -> "道路事件"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getAlarmContent(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
@@ -634,7 +660,7 @@ enum class EventTypeEnum(
|
||||
else -> "实时路况"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getMarker3DRes(poiType: String?): Int {
|
||||
return when (poiType) {
|
||||
@@ -649,7 +675,7 @@ enum class EventTypeEnum(
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getTypeNameTTS(type: String?): String {
|
||||
return when (type) {
|
||||
@@ -665,7 +691,7 @@ enum class EventTypeEnum(
|
||||
else -> "实时路况"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getUpdateIconRes(poiType: String?): Int {
|
||||
return when (poiType) {
|
||||
@@ -768,6 +794,7 @@ enum class EventTypeEnum(
|
||||
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiTypeSrcVr
|
||||
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.poiTypeSrcVr
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.poiTypeSrcVr
|
||||
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr
|
||||
else -> TYPE_ERROR.poiTypeSrcVr
|
||||
}
|
||||
@@ -806,6 +833,7 @@ enum class EventTypeEnum(
|
||||
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.content
|
||||
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.content
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.content
|
||||
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.content
|
||||
else -> TYPE_ERROR.content
|
||||
@@ -845,6 +873,7 @@ enum class EventTypeEnum(
|
||||
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.tts
|
||||
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.tts
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.tts
|
||||
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.tts
|
||||
else -> TYPE_ERROR.tts
|
||||
|
||||
@@ -60,6 +60,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
} else {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
@@ -67,6 +69,8 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
implementation project(':core:mogo-core-utils')
|
||||
|
||||
}
|
||||
implementation 'com.zhidaoauto.voice.controller:api:1.0.2'
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.mogo.module.navi.cp.AddressHelper
|
||||
import com.mogo.module.navi.cp.PersonalInfoManager
|
||||
import com.mogo.module.navi.dao.SearchPoiDao
|
||||
import com.mogo.module.navi.database.AppDataBase
|
||||
import com.mogo.utils.WorkThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.ObservableOnSubscribe
|
||||
|
||||
@@ -66,7 +66,7 @@ import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -46,7 +46,7 @@ import com.mogo.module.service.status.EnvStatusManager;
|
||||
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -60,13 +60,16 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.moduleservice
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
|
||||
} else {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-service')
|
||||
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ import com.mogo.utils.NetworkUtils;
|
||||
import com.mogo.utils.TipDrawable;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.mogo.module.common.view.NetworkLoadingView;
|
||||
import com.mogo.module.v2x.view.SurroundingMarginDecoration;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.fragment.V2XScenarioHistoryFragment;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -2,12 +2,8 @@ package com.mogo.module.v2x.presenter;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.fragment.V2XShareEventsFragment;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
import java.util.List;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
public class ShareEventsPresenter extends Presenter <V2XShareEventsFragment>{
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.module.v2x.scenario.scene.park;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Handler;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
@@ -19,11 +18,10 @@ import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.marker.V2XMarkerAdapter;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.listener.V2XLocationListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
Reference in New Issue
Block a user