This commit is contained in:
zhongchao
2023-03-10 13:40:52 +08:00
30 changed files with 495 additions and 223 deletions

View File

@@ -13,7 +13,6 @@
android:id="@+id/module_carchatting_call_head"
android:layout_width="@dimen/module_call_chat_calling_iv_hawk_eye_width_height"
android:layout_height="@dimen/module_call_chat_calling_iv_hawk_eye_width_height"
android:scaleType="centerInside"
android:src="@mipmap/module_carchatting_hawk_eye_default_head_img"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -25,7 +24,6 @@
android:layout_width="@dimen/module_call_chat_hawk_eye_circle_btn_size"
android:layout_height="@dimen/module_call_chat_hawk_eye_circle_btn_size"
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
android:scaleType="centerInside"
android:src="@mipmap/module_carchatting_launcher_calling_hangup"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -16,6 +16,7 @@ import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.api.devatools.apm.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.api.devatools.download.*
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.zhjt.mogo_core_function_devatools.apm.*
@@ -69,6 +70,9 @@ class DevaToolsProvider : IDevaToolsProvider {
FuncConfigImpl.init()
MogoLogCatchManager.init(mContext!!)
// 视角切换功能初始化,监听路口及停止线回调
CallerVisualAngleManager.init()
//升级(鹰眼/工控)与监控服务
iPCReportManager.initServer()
moFangManager.init(mContext!!)

View File

@@ -79,7 +79,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|| it.resultList.contains(RESULT_SHOW_WARNING)
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList,false)
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
}
@@ -91,7 +91,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
ReportEntity(
TimeUtils.millis2String(System.currentTimeMillis()),
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
)
,false)
)
reportListFloatWindow?.refreshData(reportList)

View File

@@ -9,6 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
@@ -39,7 +40,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
var driverMsgBoxBubbleAdapter: DriverMsgBoxBubbleAdapter ?=null
private val TAG = "DriverMsgBoxBubbleView"
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
private val dataList :ArrayList<MsgBoxCountDownBean> = ArrayList()
private var isShowData = true
private fun initView() {
@@ -92,7 +93,8 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
//todo 过滤MAP系统异常报警
} else{
clMsgBubbleLayout.visibility = View.VISIBLE
dataList.add(msgBoxBean)
val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxBean)
dataList.add(msgBoxCountDownBean)
driverMsgBoxBubbleAdapter?.setData(dataList)
}
}

View File

@@ -7,6 +7,7 @@ import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
@@ -25,7 +26,7 @@ class MBoxBubbleView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
private val TAG = "PassengerMsgBoxBubbleView"
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
private val dataList :ArrayList<MsgBoxCountDownBean> = ArrayList()
private var mBoxBubbleAdapter: MBoxBubbleAdapter?= null
private var isShowData = true
@@ -58,7 +59,8 @@ class MBoxBubbleView @JvmOverloads constructor(
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
dataList.add(msgBoxList)
val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList)
dataList.add(msgBoxCountDownBean)
mBoxBubbleAdapter?.setData(dataList)
}
}

View File

@@ -6,9 +6,7 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
@@ -25,7 +23,7 @@ class MMsgBoxBubbleView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
private val TAG = "MMsgBoxBubbleView"
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
private val dataList :ArrayList<MsgBoxCountDownBean> = ArrayList()
private var mMsgBoxBubbleAdapter: MMsgBoxBubbleAdapter?= null
private var isShowData = true
@@ -55,17 +53,27 @@ class MMsgBoxBubbleView @JvmOverloads constructor(
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
dataList.add(msgBoxList)
mMsgBoxBubbleAdapter?.setData(dataList)
update(msgBoxList)
}
if(msgBoxList.type == MsgBoxType.OPERATION){
if((msgBoxList.bean as OperationMsg).type == 2){
update(msgBoxList)
}
}
}
}
}
private fun update(msgBoxList: MsgBoxBean){
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList)
dataList.add(msgBoxCountDownBean)
mMsgBoxBubbleAdapter?.setData(dataList)
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerMsgBoxListenerManager.addListener(TAG,this)

View File

@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
@@ -64,6 +65,15 @@ class MMsgBoxListView @JvmOverloads constructor(
mMsgBoxListAdapter?.setData(it)
}
}
if(msgBoxList.type == MsgBoxType.OPERATION){
if((msgBoxList.bean as OperationMsg).type == 2){
noticeList?.add(0,msgBoxList)
noticeList?.let {
mMsgBoxListAdapter?.setData(it)
}
}
}
}
}
}

View File

@@ -7,6 +7,7 @@ import android.view.*
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
@@ -30,7 +31,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
private val TAG = "PassengerMsgBoxBubbleView"
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
private val dataList :ArrayList<MsgBoxCountDownBean> = ArrayList()
private var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null
private var isShowData = true
@@ -63,7 +64,8 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
dataList.add(msgBoxList)
val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList)
dataList.add(msgBoxCountDownBean)
passengerMsgBoxBubbleAdapter?.setData(dataList)
}
}

View File

@@ -30,7 +30,7 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
*/
class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
private var data: ArrayList<MsgBoxBean> ?= null
private var data: ArrayList<MsgBoxCountDownBean> ?= null
private val operation: Int = 1
private val operationReturn: Int = 10
@@ -40,10 +40,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
private val report: Int = 4
private val summary: Int = 5
var countDownTimer: CountDownTimer?=null
private var changeViewListener: ChangeViewListener?=null
fun setData(data: ArrayList<MsgBoxBean>){
fun setData(data: ArrayList<MsgBoxCountDownBean>){
this.data = data
if(data.size>4){
data.removeAt(0)
@@ -90,9 +89,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
when (holder) {
is BubbleOperationHolder -> {
data?.let {
val msgBoxBean = it[position]
val msgBoxBean = it[position].msgBoxBean
val operationMsg = msgBoxBean.bean as OperationMsg
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvBubbleOperationContent.text = operationMsg.content
holder.clBubbleOperationLayout.setOnClickListener {
CallerMsgBoxEventListenerManager.invokeBubbleOperationListener(msgBoxBean)
@@ -102,7 +101,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
//运营平台还车通知
is BubbleOperationReturnHolder -> {
data?.let {
val operationReturnMsg = it[position].bean as OperationMsg
val operationReturnMsg = it[position].msgBoxBean.bean as OperationMsg
holder.tvOperationReturnContent.text = operationReturnMsg.content
holder.tvOperationReturnTime.text =
TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat())
@@ -111,17 +110,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
//运营平台靠边停车
is BubbleOperationStopHolder -> {
data?.let {
val operationStopMsg = it[position].bean as OperationMsg
val operationStopMsg = it[position].msgBoxBean.bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
}
}
is BubbleReportHolder -> {
data?.let {
val msgBoxBean = it[position]
val msgBoxBean = it[position].msgBoxBean
val reportEntity = msgBoxBean.bean as ReportEntity
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].msgBoxBean.timestamp)}"
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}"
@@ -134,11 +133,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
is BubbleNoticeHolder -> {
data?.let {
val msgBoxBean = it[position].bean
val msgBoxBean = it[position].msgBoxBean.bean
val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
@@ -154,7 +153,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
@@ -173,9 +172,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
is BubbleV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val msgBoxBean = it[position].msgBoxBean
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
@@ -186,15 +185,15 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
is BubbleSummaryHolder -> {
data?.let {
val summaryMsg = it[position].bean as V2XMsg
holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
val summaryMsg = it[position].msgBoxBean.bean as V2XMsg
holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvSummaryContent.text = summaryMsg.content
}
}
}
val msgBoxBean: MsgBoxBean = data!![position]
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
val msgBoxBean: MsgBoxCountDownBean = data!![position]
msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
override fun onTick(p0: Long) {
}
@@ -203,34 +202,32 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
data?.remove(msgBoxBean)
changeViewListener?.notifyView()
notifyDataSetChanged()
// notifyItemRemoved(index)
// notifyItemRangeChanged(index,recordTypeEntity.size-index)
}
}
countDownTimer?.start()
msgBoxBean.countDownTimer?.start()
}
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
return if(data!![position].type == MsgBoxType.OPERATION){
if((data!![position].bean as OperationMsg).type == 0){
return if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){
if((data!![position].msgBoxBean.bean as OperationMsg).type == 0){
//运营平台还车通知
operationReturn
}else if((data!![position].bean as OperationMsg).type == 1){
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
//普通运营平台
operation
}
}else if(data!![position].type == MsgBoxType.REPORT){
}else if(data!![position].msgBoxBean.type == MsgBoxType.REPORT){
report
}else if(data!![position].type == MsgBoxType.NOTICE){
}else if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
}else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){
summary
} else{
v2x

View File

@@ -163,8 +163,51 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
"${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.tag = reportEntity
if(reportEntity.isShow){
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_close),
null,
null,
null
)
holder.tvStatusSelect.text = "折叠"
holder.ivReportImageNormal.visibility = View.GONE
holder.tvReportLevelNormal.visibility = View.GONE
holder.tvReportTimeNormal.visibility = View.GONE
holder.tvReportTypeNormal.visibility = View.GONE
holder.ivReportImageOpen.visibility = View.VISIBLE
holder.tvReportLevelOpen.visibility = View.VISIBLE
holder.tvReportTimeOpen.visibility = View.VISIBLE
holder.tvReportTypeOpen.visibility = View.VISIBLE
holder.tvReportReasonOpen.visibility = View.VISIBLE
holder.tvReportSrcOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
}else{
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_open),
null,
null,
null
)
holder.tvStatusSelect.text = "展开"
holder.ivReportImageNormal.visibility = View.VISIBLE
holder.tvReportLevelNormal.visibility = View.VISIBLE
holder.tvReportTimeNormal.visibility = View.VISIBLE
holder.tvReportTypeNormal.visibility = View.VISIBLE
holder.ivReportImageOpen.visibility = View.GONE
holder.tvReportLevelOpen.visibility = View.GONE
holder.tvReportTimeOpen.visibility = View.GONE
holder.tvReportTypeOpen.visibility = View.GONE
holder.tvReportReasonOpen.visibility = View.GONE
holder.tvReportSrcOpen.visibility = View.GONE
holder.tvReportActionOpen.visibility = View.GONE
}
holder.tvStatusSelect.setOnClickListener {
if (holder.tvReportLevelNormal.isVisible) {
if (!reportEntity.isShow) {
reportEntity.isShow = true
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_close),
null,
@@ -185,6 +228,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
holder.tvReportSrcOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
} else {
reportEntity.isShow = false
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_open),
null,
@@ -323,7 +367,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
)
}
}

View File

@@ -17,14 +17,13 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>(){
private var data: ArrayList<MsgBoxBean> ?= null
private var data: ArrayList<MsgBoxCountDownBean> ?= null
private val notice: Int = 1
private val v2x: Int = 2
var countDownTimer: CountDownTimer?=null
fun setData(data: ArrayList<MsgBoxBean>){
fun setData(data: ArrayList<MsgBoxCountDownBean>){
this.data = data
if(data.size>3){
data.removeAt(0)
@@ -49,14 +48,14 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<Re
when (holder) {
is BubbleNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeNormalData?.content
}else {
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content
}
@@ -65,8 +64,8 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<Re
is BubbleV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
val v2XMsg = msgBoxBean.msgBoxBean.bean as V2XMsg
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMV2XContent.text = v2XMsg.content
holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
@@ -74,8 +73,8 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<Re
}
}
val msgBoxBean: MsgBoxBean = data!![position]
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
val msgBoxBean: MsgBoxCountDownBean = data!![position]
msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
override fun onTick(p0: Long) {
}
@@ -88,13 +87,13 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<Re
}
}
countDownTimer?.start()
msgBoxBean.countDownTimer?.start()
}
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
return if(data!![position].type == MsgBoxType.NOTICE){
return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){
notice
}else{
v2x

View File

@@ -23,15 +23,15 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private var data: ArrayList<MsgBoxBean> ?= null
private var data: ArrayList<MsgBoxCountDownBean> ?= null
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
private val operation: Int = 4
var countDownTimer: CountDownTimer?=null
fun setData(data: ArrayList<MsgBoxBean>){
fun setData(data: ArrayList<MsgBoxCountDownBean>){
this.data = data
if(data.size>3){
data.removeAt(0)
@@ -49,6 +49,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_summary,parent,false)
BubbleSummaryHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_operation,parent,false)
BubbleOperationHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_v2x,parent,false)
BubbleV2XHolder(view)
@@ -60,10 +64,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
when (holder) {
is BubbleNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(R.drawable.icon_passenger_operation)
.optionalTransform(
@@ -78,7 +82,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(R.drawable.icon_passenger_operation)
.optionalTransform(
@@ -97,9 +101,9 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
is BubbleV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val msgBoxBean = it[position].msgBoxBean
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMV2XContent.text = v2XMsg.content
holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
@@ -110,8 +114,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
is BubbleSummaryHolder -> {
data?.let {
val summaryMsg= it[position].bean as V2XMsg
holder.tvMSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
val summaryMsg= it[position].msgBoxBean.bean as V2XMsg
holder.tvMSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMSummaryContent.text = summaryMsg.content
holder.tvMSummaryCheck.setOnClickListener {
//跳转全览模式
@@ -120,10 +124,17 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
}
}
is BubbleOperationHolder ->{
data?.let {
val operationMsg = it[position].msgBoxBean.bean as OperationMsg
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMOperationContent.text = operationMsg.content
}
}
}
val msgBoxBean: MsgBoxBean = data!![position]
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
val msgBoxBean: MsgBoxCountDownBean = data!![position]
msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
override fun onTick(p0: Long) {
}
@@ -136,16 +147,18 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
}
countDownTimer?.start()
msgBoxBean.countDownTimer?.start()
}
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
return if(data!![position].type == MsgBoxType.NOTICE){
return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
}else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){
summary
}else if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){
operation
} else{
v2x
}
@@ -175,4 +188,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
}
//通知消息
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
}
}

View File

@@ -9,10 +9,7 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.hmi.R
@@ -28,6 +25,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
private val operation: Int = 4
fun setData(data: List<MsgBoxBean>){
this.data = data
@@ -44,6 +42,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_summary,parent,false)
ListSummaryHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_operation,parent,false)
ListOperationHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_v2x,parent,false)
ListV2XHolder(view)
@@ -111,6 +113,13 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
}
}
}
is ListOperationHolder -> {
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMOperationContent.text = operationMsg.content
}
}
}
}
@@ -121,7 +130,9 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
} else{
}else if(data!![position].type == MsgBoxType.OPERATION){
operation
}else{
v2x
}
}
@@ -149,4 +160,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
}
//运营消息
class ListOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
}
}

View File

@@ -28,15 +28,13 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
*/
class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private var data: ArrayList<MsgBoxBean> ?= null
private var data: ArrayList<MsgBoxCountDownBean> ?= null
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
var countDownTimer: CountDownTimer?=null
fun setData(data: ArrayList<MsgBoxBean>){
fun setData(data: ArrayList<MsgBoxCountDownBean>){
this.data = data
if(data.size>3){
data.removeAt(0)
@@ -65,10 +63,10 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
when (holder) {
is BubbleNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
@@ -82,7 +80,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
@@ -100,9 +98,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
}
is BubbleV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val msgBoxBean = it[position].msgBoxBean
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvPassengerV2XContent.text = v2XMsg.content
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
@@ -113,8 +111,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
}
is BubbleSummaryHolder -> {
data?.let {
val summaryMsg= it[position].bean as V2XMsg
holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
val summaryMsg= it[position].msgBoxBean.bean as V2XMsg
holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvPassengerSummaryContent.text = summaryMsg.content
holder.tvPassengerSummaryCheck.setOnClickListener {
//跳转全览模式
@@ -125,8 +123,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
}
}
val msgBoxBean: MsgBoxBean = data!![position]
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
val msgBoxBean: MsgBoxCountDownBean = data!![position]
msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
override fun onTick(p0: Long) {
}
@@ -139,15 +137,15 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
}
}
countDownTimer?.start()
msgBoxBean.countDownTimer?.start()
}
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
return if(data!![position].type == MsgBoxType.NOTICE){
return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
}else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){
summary
} else{
v2x

View File

@@ -73,10 +73,10 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
}
override fun initViews() {
injectFloatView()
injectStatusBar()
window.setBackgroundDrawable(null)
initConnectInfoRV()
FloatingViewHandler.init(module_main_id_floating_view)
CallerHmiManager.init(this)
//申请悬浮窗权限
@@ -90,23 +90,42 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
}
private fun injectStatusBar() {
val decorView = this.window.decorView as FrameLayout
val decorView = this.window.decorView as? FrameLayout ?: return
val contentView =
(decorView.findViewById<View>(android.R.id.content) as ViewGroup).getChildAt(0)
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return
contentView.fitsSystemWindows = false
decorView.clipToPadding = false
var statusBarView = decorView.findViewWithTag<View>("status_bar")
if (statusBarView == null) {
statusBarView = statusBar
statusBarView.setTag("status_bar")
statusBarView.tag = "status_bar"
val params = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
)
params.topMargin = 0
params.gravity = Gravity.TOP
decorView.addView(statusBarView, params)
}
}
private fun injectFloatView() {
val decorView = this.window.decorView as? FrameLayout ?: return
val contentView =
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return
contentView.fitsSystemWindows = false
decorView.clipToPadding = false
var floatContainer = decorView.findViewWithTag<View>("float_container")
if (floatContainer == null) {
floatContainer = FrameLayout(this)
floatContainer.tag = "float_container"
FloatingViewHandler.init(floatContainer)
val params = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
)
decorView.addView(floatContainer, params)
}
val statusBarLP = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
)
statusBarLP.topMargin = 0
statusBarLP.gravity = Gravity.TOP
decorView.addView(statusBarView, statusBarLP)
}
/**

View File

@@ -0,0 +1,50 @@
<?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="450dp"
android:layout_height="110dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#FFFFFFFF"
app:roundLayoutRadius="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10">
<ImageView
android:id="@+id/ivMOperationImage"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_110"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
/>
<TextView
android:id="@+id/tvMOperationTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#99203555"
android:textSize="18dp"
android:layout_marginEnd="@dimen/dp_20"
/>
<TextView
android:id="@+id/tvMOperationContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
android:gravity="start"
android:textColor="#FF203555"
android:textSize="20dp"
android:layout_marginStart="@dimen/dp_13"
android:layout_marginEnd="@dimen/dp_13"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_100"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivMOperationImage"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_68"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_16"
android:src="@drawable/icon_passenger_operation"
/>
<TextView
android:id="@+id/tvMOperationTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#FF4A5B76"
android:textSize="@dimen/dp_18"
android:layout_marginEnd="@dimen/dp_10"
/>
<TextView
android:id="@+id/tvMOperationContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
android:gravity="start"
android:textColor="#FF203555"
android:textSize="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_16"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -6,23 +6,11 @@
android:background="@drawable/main_splash_bg"
android:orientation="vertical">
<!--网约车视图-->
<FrameLayout
android:id="@+id/module_main_id_och_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 浮层-->
<FrameLayout
android:id="@+id/module_main_id_floating_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!--网约车视图-->
<FrameLayout
android:id="@+id/module_main_id_och_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
android:layout_height="match_parent" />
<!--冷启动过渡Logo-->
<androidx.constraintlayout.widget.ConstraintLayout

View File

@@ -317,7 +317,7 @@
android:id="@+id/tbOpenMfView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="打开蘑方按键Toast"
android:text="蘑方按键Toast"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:visibility="gone"

View File

@@ -65,10 +65,10 @@ object TrackerSourceColorHelper {
//僵尸车
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
color = "#AE7887FF"
color = "#AD7488FF"
CallerMapUIServiceManager.getMapUIController()?.let {
if(it.isDayMode){
color = "#AD7488FF"
color = "#AE7887FF"
}
}
}

View File

@@ -1,10 +1,10 @@
package com.mogo.eagle.core.function.smp
import android.content.Context
import android.util.Log
import com.amap.api.maps.CoordinateConverter
import com.amap.api.maps.model.LatLng
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -22,9 +22,7 @@ object MarkerDrawerManager {
fun onLocationChanged(planningPoints: List<LatLng>, locIndex: Int)
}
private val routeWipeDisposable by lazy {
CompositeDisposable()
}
private var routeWipeDisposable: CompositeDisposable? = null
// 自主画线的所有高德坐标系的轨迹点
val planningPoints by lazy {
@@ -35,40 +33,44 @@ object MarkerDrawerManager {
var lastArrivedIndex: Int = -1
@Volatile
var lonLat = Pair(0.0, 0.0)
var lonLatHeading = Triple(0.0, 0.0, 0.0)
var callback: Callback? = null
fun startLoopCalCarLocation() {
routeWipeDisposable = CompositeDisposable()
getLoopCalCarObservable().delay(1000L, TimeUnit.MILLISECONDS, true)
.subscribeOn(Schedulers.io())
.repeat()
.retry()
.observeOn(AndroidSchedulers.mainThread())
.subscribe().let {
routeWipeDisposable.add(it)
routeWipeDisposable?.add(it)
}
}
fun stopLoopCalCarLocation() {
if (!routeWipeDisposable.isDisposed) {
routeWipeDisposable.dispose()
routeWipeDisposable?.let {
if (!it.isDisposed) {
it.dispose()
}
}
}
private fun getLoopCalCarObservable(): Observable<Int> {
return Observable.create(ObservableOnSubscribe { emitter ->
if (emitter.isDisposed) return@ObservableOnSubscribe
loopRouteAndWipe(planningPoints, lonLat.first, lonLat.second)
loopRouteAndWipe(planningPoints, lonLatHeading.first, lonLatHeading.second, lonLatHeading.third)
emitter.onComplete()
})
}
private fun loopRouteAndWipe(routePoints: List<LatLng>?, lon: Double, lat: Double) {
private fun loopRouteAndWipe(routePoints: List<LatLng>?, lon: Double, lat: Double, heading: Double) {
if (routePoints != null && routePoints.isNotEmpty()) {
val arrivedIndex: Int = getArrivedPointIndex(routePoints, lon, lat)
val newPointList = ArrayList<LatLng>()
val arrivedIndex: Int = getArrivedPointIndex(routePoints, newPointList, lon, lat, heading)
if (arrivedIndex != -1 && lastArrivedIndex != arrivedIndex) {
callback?.onLocationChanged(routePoints, arrivedIndex)
callback?.onLocationChanged(newPointList, arrivedIndex)
lastArrivedIndex = arrivedIndex
}
}
@@ -90,8 +92,10 @@ object MarkerDrawerManager {
*/
private fun getArrivedPointIndex(
routePoints: List<LatLng>,
newPoints: MutableList<LatLng>,
realLon: Double,
realLat: Double
realLat: Double,
heading: Double
): Int {
var currentIndex = 0 //记录疑似点
if (routePoints.isNotEmpty()) {
@@ -107,12 +111,17 @@ object MarkerDrawerManager {
)
if (baseDiffDis > diff) {
baseDiffDis = diff
currentIndex = i
// 距离最近的时候判断是否走过且车行驶是线性连续的1s不会跳点过多
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90 && i - lastArrivedIndex < 3) {
currentIndex = i
}
}
}
return currentIndex
newPoints.addAll(routePoints)
newPoints.add(currentIndex + 1, LatLng(realLat, realLon))
return currentIndex + 1
}
return currentIndex
return 0
}
/**

View File

@@ -87,8 +87,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
setExtraGPSData(gnssInfo)
}
@Volatile
private var isVisualAngleChanged = false
private var currentLevel:Int = 0
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
super.onAutopilotLightSwitchData(lightSwitch)
@@ -96,35 +95,28 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
when (it.number) {
Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转灯
CallerVisualAngleManager.showTurning(true)
showTurn(1)
turn(1)
}
Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯
CallerVisualAngleManager.showTurning(true)
showTurn(2)
turn(2)
}
Chassis.LightSwitch.LIGHT_NONE_VALUE -> {
CallerVisualAngleManager.showTurning(false)
hideTurn()
turn(0)
}
}
}
}
private fun showTurn(lightNum: Int) {
if (!isVisualAngleChanged) {
isVisualAngleChanged = true
private fun turn(lightNum: Int) {
if (currentLevel != lightNum) {
when (lightNum) {
0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
}
}
}
private fun hideTurn() {
if (isVisualAngleChanged) {
isVisualAngleChanged = false
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
currentLevel = lightNum
}
}

View File

@@ -36,7 +36,8 @@ import com.mogo.eagle.core.function.smp.MakerWithCount
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.coordinateConverterWgsToGcj
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLat
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lastArrivedIndex
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLatHeading
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.planningPoints
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocation
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateRoutePoints
@@ -236,6 +237,9 @@ class OverMapView @JvmOverloads constructor(
}
mStartMarker?.isVisible = false
mEndMarker?.isVisible = false
MarkerDrawerManager.stopLoopCalCarLocation()
planningPoints.clear()
lastArrivedIndex = -1
}
@SuppressLint("UseCompatLoadingForDrawables")
@@ -636,6 +640,8 @@ class OverMapView @JvmOverloads constructor(
texIndexList.clear()
}
for (i in coordinates.indices) {
// 线段数比点数少一个
if (i == 0) continue
if (i <= locIndex) {
if (isClearArrived) {
textureList.add(transparentBitmap)
@@ -647,7 +653,7 @@ class OverMapView @JvmOverloads constructor(
// 未走过的纹理
textureList.add(unArrivedBitmap)
}
texIndexList.add(i)
texIndexList.add(i - 1)
}
if (mAMap != null && coordinates.size > 2) {
//设置线段纹理
@@ -670,7 +676,7 @@ class OverMapView @JvmOverloads constructor(
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
lonLat = Pair(it.longitude, it.latitude)
lonLatHeading = Triple(it.longitude, it.latitude, it.heading)
drawCarMarker(it)
if (isFirstLocation) {
displayCustomOverView()

View File

@@ -124,6 +124,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
}
//设置长链接的secretKey 通过SHA1和包名找中台服务生成后续包名分渠道,需要做对应操作
clientConfig.secretKey = "YMj2VFDFxJ3Q4gNoZceJ"
// clientConfig.secretKey = "n48AlVufihvMDWgzwHX42yzSgiWaad6v"
clientConfig.iHttpCurrentLocation = object : ICurrentLocation {
override fun getCurrentLocation(): SimpleLocation {

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
* @description 工控机上报实例
* @since: 2022/4/13
*/
data class ReportEntity(
class ReportEntity(
var time: String,//上报时间
var src: String,//消息来源
var level: String,//消息等级 error info
@@ -17,6 +17,7 @@ data class ReportEntity(
var actionsList: List<String>,//试验性字段。消息发出者希望触发的动作例如触发短信报警自动创建工单要求pad弹框等
// var sec: Int,//秒
// var nsec: Int//纳秒 sec和nsec拼接起来是消息发送事件
var isShow: Boolean
): Serializable {
}

View File

@@ -0,0 +1,7 @@
package com.mogo.eagle.core.data.msgbox
import android.os.CountDownTimer
class MsgBoxCountDownBean(val msgBoxBean: MsgBoxBean){
var countDownTimer: CountDownTimer ?= null
}

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.map
import android.util.Log
import com.alibaba.android.arouter.launcher.*
import com.mogo.eagle.core.data.constants.*
import com.mogo.eagle.core.function.api.map.angle.*
@@ -17,6 +18,13 @@ object CallerVisualAngleManager {
@Volatile
private var isVisualAngleChanged = false
fun init() {
provider?.let {
Log.d("CallerVisualAngle", "--- init ---")
}
}
fun changeAngle(scene: Scene) {
provider?.changeAngle(scene)
}

View File

@@ -145,7 +145,7 @@ ADAS_DATA_LIB_POM_ARTIFACT_ID=adas-data
ADAS_DATA_LIB_CHILD_VERSION=.0
# 线程优化版本
THREAD_OPT_VERSION=4.0.0
THREAD_OPT_VERSION=4.0.1
# 是否支持patch升级
PATCH_UPGRADE_SUPPORT=true

View File

@@ -1,6 +1,8 @@
package com.mogo.map.location
import android.content.Context
import android.os.Handler
import android.os.HandlerThread
import com.amap.api.location.AMapLocation
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
@@ -29,6 +31,12 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
*/
private var lastGaoDeLocation: MogoLocation = MogoLocation()
private val handler by lazy {
val thread = HandlerThread("GDLocationChange")
thread.start()
Handler(thread.looper)
}
init {
AMapLocationClient.updatePrivacyShow(context, true, true)
AMapLocationClient.updatePrivacyAgree(context, true)
@@ -64,66 +72,68 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
}
override fun onLocationChanged(aMapLocation: AMapLocation) {
// 更新GNSS 信息
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
mapLocation?.let {
// 转换 GCJ02-->WGS84 坐标
val wgs84Location =
CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude)
lastGaoDeLocation.longitude = wgs84Location[0]
lastGaoDeLocation.latitude = wgs84Location[1]
lastGaoDeLocation.heading = it.bearing.toDouble()
lastGaoDeLocation.gnssSpeed = it.speed
lastGaoDeLocation.altitude = it.altitude
lastGaoDeLocation.satelliteTime = it.time
handler.post {
// 更新GNSS 信息
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
lastGaoDeLocation.locType = 1 // 定位类型为高德坐标(网路或者硬件定位)
lastGaoDeLocation.satellite = 4
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
mapLocation?.let {
// 转换 GCJ02-->WGS84 坐标
val wgs84Location =
CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude)
lastGaoDeLocation.cityName = it.city
lastGaoDeLocation.cityCode = it.cityCode
lastGaoDeLocation.provider = it.provider
lastGaoDeLocation.address = it.address
lastGaoDeLocation.district = it.district
lastGaoDeLocation.province = it.province
lastGaoDeLocation.adCode = it.adCode
lastGaoDeLocation.locationDetail = it.locationDetail
lastGaoDeLocation.poiName = it.poiName
lastGaoDeLocation.aoiName = it.aoiName
lastGaoDeLocation.street = it.street
lastGaoDeLocation.streetNum = it.streetNum
lastGaoDeLocation.description = it.description
lastGaoDeLocation.buildingId = it.buildingId
lastGaoDeLocation.floor = it.floor
lastGaoDeLocation.errorCode = it.errorCode
lastGaoDeLocation.errorInfo = it.errorInfo
}
lastGaoDeLocation.longitude = wgs84Location[0]
lastGaoDeLocation.latitude = wgs84Location[1]
lastGaoDeLocation.heading = it.bearing.toDouble()
lastGaoDeLocation.gnssSpeed = it.speed
lastGaoDeLocation.altitude = it.altitude
lastGaoDeLocation.satelliteTime = it.time
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
// 回掉给监听者
CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation)
lastGaoDeLocation.locType = 1 // 定位类型为高德坐标(网路或者硬件定位)
lastGaoDeLocation.satellite = 4
mapLocation = aMapLocation
// 本地SP缓存城市Code
val cityCode = aMapLocation.cityCode
if (cityCode != null && cityCode.isNotEmpty()) {
mCityCode = aMapLocation.cityCode
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
lastGaoDeLocation.cityName = it.city
lastGaoDeLocation.cityCode = it.cityCode
lastGaoDeLocation.provider = it.provider
lastGaoDeLocation.address = it.address
lastGaoDeLocation.district = it.district
lastGaoDeLocation.province = it.province
lastGaoDeLocation.adCode = it.adCode
lastGaoDeLocation.locationDetail = it.locationDetail
lastGaoDeLocation.poiName = it.poiName
lastGaoDeLocation.aoiName = it.aoiName
lastGaoDeLocation.street = it.street
lastGaoDeLocation.streetNum = it.streetNum
lastGaoDeLocation.description = it.description
lastGaoDeLocation.buildingId = it.buildingId
lastGaoDeLocation.floor = it.floor
lastGaoDeLocation.errorCode = it.errorCode
lastGaoDeLocation.errorInfo = it.errorInfo
}
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(
SharedPrefsConstants.LOCATION_LATITUDE,
aMapLocation.latitude.toString()
)
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(
SharedPrefsConstants.LOCATION_LONGITUDE,
aMapLocation.longitude.toString()
)
// 回掉给监听者
CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation)
mapLocation = aMapLocation
// 本地SP缓存城市Code
val cityCode = aMapLocation.cityCode
if (cityCode != null && cityCode.isNotEmpty()) {
mCityCode = aMapLocation.cityCode
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(
SharedPrefsConstants.LOCATION_LATITUDE,
aMapLocation.latitude.toString()
)
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(
SharedPrefsConstants.LOCATION_LONGITUDE,
aMapLocation.longitude.toString()
)
}
}
}

View File

@@ -68,8 +68,15 @@ class IFlyTekTts : IMogoTTS, InitListener {
}
override fun release() {
ttsEngine?.stopSpeaking()
ttsEngine?.destroy()
if (Thread.currentThread() != Looper.getMainLooper().thread) {
UiThreadHandler.post {
ttsEngine?.stopSpeaking()
ttsEngine?.destroy()
}
} else {
ttsEngine?.stopSpeaking()
ttsEngine?.destroy()
}
}
override fun flush() {
@@ -91,7 +98,16 @@ class IFlyTekTts : IMogoTTS, InitListener {
override fun speakTTSVoiceWithLevel(tts: String?, level: Int, callBack: IMogoTTSCallback?) {
if (tts.isNullOrEmpty()) return
speakMultiLangTTSWithLevel(MultiLangTtsEntity(listOf(LangTtsEntity(tts, LanguageType.CHINESE))), level, callBack)
speakMultiLangTTSWithLevel(
MultiLangTtsEntity(
listOf(
LangTtsEntity(
tts,
LanguageType.CHINESE
)
)
), level, callBack
)
}
override fun speakMultiLangTTSWithLevel(
@@ -99,10 +115,19 @@ class IFlyTekTts : IMogoTTS, InitListener {
level: Int,
callBack: IMogoTTSCallback?
) {
if (callBack != null) {
speakVoiceMap[ttsEntity.toString()] = callBack
if (Thread.currentThread() != Looper.getMainLooper().thread) {
UiThreadHandler.post {
if (callBack != null) {
speakVoiceMap[ttsEntity.toString()] = callBack
}
speakMultiLangTTSWithLevel(ttsEntity, level)
}
} else {
if (callBack != null) {
speakVoiceMap[ttsEntity.toString()] = callBack
}
speakMultiLangTTSWithLevel(ttsEntity, level)
}
speakMultiLangTTSWithLevel(ttsEntity, level)
}
override fun stopSpeakTts(text: String?) {
@@ -110,6 +135,16 @@ class IFlyTekTts : IMogoTTS, InitListener {
}
override fun stopTts() {
if (Thread.currentThread() != Looper.getMainLooper().thread) {
UiThreadHandler.post {
realStop()
}
} else {
realStop()
}
}
private fun realStop() {
curTtsEntity?.let {
val string = it.toString()
if (speakVoiceMap.containsKey(string)) {