[8.0.0]全息路口探查进MogoMind
This commit is contained in:
@@ -49,6 +49,7 @@ class AiView @JvmOverloads constructor(
|
||||
private var viewModel:AIViewModel?=null
|
||||
private var pncActionsModel:PNCActionsViewModel ?= null
|
||||
private var roadV2NEventModel:RoadV2NEventViewModel ?= null
|
||||
private var roadCrossRoamModel:RoadCrossRoamViewModel ?= null
|
||||
|
||||
private var aiAnimator: BigFrameAnimatorContainer?=null
|
||||
private var aiAnimatorBg: BigFrameAnimatorContainer?=null
|
||||
@@ -230,6 +231,10 @@ class AiView @JvmOverloads constructor(
|
||||
ViewModelProvider(it)[RoadV2NEventViewModel::class.java]
|
||||
}
|
||||
roadV2NEventModel?.init()
|
||||
roadCrossRoamModel = findViewTreeViewModelStoreOwner()?.let{
|
||||
ViewModelProvider(it)[RoadCrossRoamViewModel::class.java]
|
||||
}
|
||||
roadCrossRoamModel?.init(context)
|
||||
}
|
||||
|
||||
private fun startListInfo(){
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.mogo.och.unmanned.passenger.ui.aiview
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerServicesEventManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
|
||||
|
||||
class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
|
||||
|
||||
companion object{
|
||||
const val TAG = "RoadCrossRoamViewModel"
|
||||
}
|
||||
|
||||
private lateinit var mContext: Context
|
||||
|
||||
fun init(context: Context){
|
||||
CallerMapRoadListenerManager.addListener(TAG, this)
|
||||
mContext = context
|
||||
}
|
||||
|
||||
override fun onCrossDevice(trigger: Boolean) {
|
||||
super.onCrossDevice(trigger)
|
||||
if(trigger){
|
||||
show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun show(){
|
||||
// 没有路线不做提示
|
||||
if (CallerAutoPilotStatusListenerManager.getLineId() == 0L) {
|
||||
CallerLogger.d(TAG, "没有路线不做提示")
|
||||
return
|
||||
}
|
||||
// 处于漫游模式下不做处理
|
||||
if (CallerMapIdentifyManager.roam.second) {
|
||||
if (CallerMapIdentifyManager.roam.first != TAG) {
|
||||
ToastUtils.showLong("正在漫游中,不展示路口漫游")
|
||||
}
|
||||
CallerLogger.d(TAG, "正在漫游中,不展示路口漫游")
|
||||
return
|
||||
}
|
||||
// 首页被遮挡不做提示
|
||||
if (!CallerHmiViewControlListenerManager.getMainPageVisible()) {
|
||||
CallerLogger.d(TAG, "attachView return , mainPageVisible is false")
|
||||
return
|
||||
}
|
||||
// 没有路侧设备,不做处理
|
||||
CallerLogger.d(TAG, "命中,attachView")
|
||||
val cross = CallerMapRoadListenerManager.getCrossEndInfo()
|
||||
if (cross.isNullOrEmpty()) {
|
||||
CallerLogger.d(TAG, "未触发,路口ID:$cross")
|
||||
return
|
||||
}
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
val disStr = "为您提供路口全息影像,助力出行"
|
||||
AIAssist.getInstance(mContext).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2)
|
||||
}
|
||||
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD)
|
||||
AIMessageManager.post(AIMessage.RoadCrossRoam(System.currentTimeMillis().toString(),""))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ class AIMessageAdapter : ListAdapter<AIMessage, MessageViewHolder>(MessageDiffCa
|
||||
AIMessage.TYPE_QA -> QAViewHolder(inflater.inflate(R.layout.item_ai_msg_qa, parent, false))
|
||||
AIMessage.TYPE_PNC_ACTION -> PNCActionViewHolder(inflater.inflate(R.layout.item_ai_pnc_action,parent,false))
|
||||
AIMessage.TYPE_ROAD_V2N -> RoadV2NEventViewHolder(inflater.inflate(R.layout.item_ai_road_v2n_event,parent,false))
|
||||
AIMessage.TYPE_ROAD_CROSS ->RoadCrossRoamViewHolder(inflater.inflate(R.layout.item_ai_road_cross_roam,parent,false))
|
||||
else -> throw IllegalArgumentException("Invalid view type")
|
||||
}
|
||||
}
|
||||
@@ -36,6 +37,7 @@ class AIMessageAdapter : ListAdapter<AIMessage, MessageViewHolder>(MessageDiffCa
|
||||
is AIMessage.Warning -> AIMessage.TYPE_WARNING
|
||||
is AIMessage.PNCAction -> AIMessage.TYPE_PNC_ACTION
|
||||
is AIMessage.RoadV2NEvent -> AIMessage.TYPE_ROAD_V2N
|
||||
is AIMessage.RoadCrossRoam -> AIMessage.TYPE_ROAD_CROSS
|
||||
else -> AIMessage.TYPE_EVENT
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.mogo.och.unmanned.passenger.ui.aiview.adapter
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.graphics.Rect
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
@@ -14,12 +18,15 @@ import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.v2n.RoadV2NEventLivePlayView
|
||||
import com.mogo.eagle.core.function.view.MapRoamView
|
||||
import com.mogo.eagle.core.function.view.RoadCrossRoamListAdapter
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
@@ -235,7 +242,66 @@ class RoadV2NEventViewHolder(binding: View) : MessageViewHolder(binding){
|
||||
|
||||
}
|
||||
|
||||
class RoadCrossRoamViewHolder(binding: View) : MessageViewHolder(binding){
|
||||
|
||||
private var ivZhiRoadRoamSet: ImageView = binding.findViewById(R.id.ivZhiRoadRoamSet)
|
||||
private var ivZhiRoadRoamView: ImageView = binding.findViewById(R.id.ivZhiRoadRoamView)
|
||||
private var tvRoadRoamTitle: TextView = binding.findViewById(R.id.tvRoadRoamTitle)
|
||||
private var mapRoamView: MapRoamView = binding.findViewById(R.id.mapRoamView)
|
||||
private var clScanningBg: ConstraintLayout = binding.findViewById(R.id.clScanningBg)
|
||||
private var ivCoverRoam: ImageView = binding.findViewById(R.id.ivCoverRoam)
|
||||
private var lvRoadCrossRoamTip: RecyclerView = binding.findViewById(R.id.lvRoadCrossRoamTip)
|
||||
|
||||
override fun bind(item: AIMessage, onItemClickListener: OnItemClickListener?) {
|
||||
if(item is AIMessage.RoadCrossRoam){
|
||||
lvRoadCrossRoamTip.layoutManager = NoScrollLayoutManager(itemView.context)
|
||||
lvRoadCrossRoamTip.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
outRect.bottom = 24
|
||||
}
|
||||
})
|
||||
mapRoamView.openRoam()
|
||||
lvRoadCrossRoamTip.adapter = RoadCrossRoamListAdapter(itemView.context, true)
|
||||
// 创建横向移动的动画
|
||||
val animator =
|
||||
ObjectAnimator.ofFloat(
|
||||
ivCoverRoam,
|
||||
"translationX",
|
||||
-120f,
|
||||
540f
|
||||
)
|
||||
animator.duration = 1500 // 设置动画持续时间,单位为毫秒
|
||||
animator.repeatCount = 6
|
||||
animator.repeatMode = ValueAnimator.RESTART // 设置动画来回移动
|
||||
animator.start()
|
||||
val rotationAnim = ObjectAnimator.ofFloat(ivZhiRoadRoamView, "rotation", 0f, 360f)
|
||||
rotationAnim.repeatCount = 9
|
||||
rotationAnim.repeatMode = ValueAnimator.RESTART
|
||||
rotationAnim.duration = 1000
|
||||
rotationAnim.interpolator = LinearInterpolator()
|
||||
rotationAnim.start()
|
||||
tvRoadRoamTitle.setTextColor(itemView.context.getColor(R.color.color_131415))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class NoScrollLayoutManager(context: Context?) : LinearLayoutManager(context) {
|
||||
override fun canScrollVertically(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun canScrollHorizontally(): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
fun interface OnItemClickListener {
|
||||
fun onItemClick(item: AIMessage, position: Int)
|
||||
|
||||
@@ -23,6 +23,7 @@ sealed class AIMessage(
|
||||
const val TYPE_WARNING = 5
|
||||
const val TYPE_PNC_ACTION = 6
|
||||
const val TYPE_ROAD_V2N = 7
|
||||
const val TYPE_ROAD_CROSS = 8
|
||||
}
|
||||
|
||||
data class Scan(
|
||||
@@ -148,4 +149,9 @@ sealed class AIMessage(
|
||||
var lat: Double, //事件坐标-纬度
|
||||
):AIMessage(id,title,tts)
|
||||
|
||||
data class RoadCrossRoam(
|
||||
override val id: String,
|
||||
override val title: String
|
||||
): AIMessage(id,title)
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_799"
|
||||
android:layout_height="@dimen/dp_944"
|
||||
app:shadowRadius="@dimen/dp_20"
|
||||
app:shadowColor="#26666666"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp"
|
||||
app:blurRadius="@dimen/dp_26">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_747"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivZhiRoadRoamView"
|
||||
android:layout_width="@dimen/dp_84"
|
||||
android:layout_height="@dimen/dp_84"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:background="@drawable/anim_road_roam"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/mapRoamView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivZhiRoadRoamSet"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:src="@drawable/bg_road_roam_anim_set"
|
||||
app:layout_constraintTop_toTopOf="@id/ivZhiRoadRoamView"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivZhiRoadRoamView"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivZhiRoadRoamView"
|
||||
app:layout_constraintRight_toRightOf="@id/ivZhiRoadRoamView"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRoadRoamTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_35"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:lineSpacingExtra="@dimen/dp_8"
|
||||
android:text="@string/road_cross_roam_tip"
|
||||
android:textColor="@color/color_131415"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivZhiRoadRoamView"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapRoamView
|
||||
android:id="@+id/mapRoamView"
|
||||
android:layout_width="@dimen/dp_683"
|
||||
android:layout_height="@dimen/dp_384"
|
||||
android:layout_marginTop="@dimen/dp_140"
|
||||
app:isWeatherEnable="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:styleMode="MAP_STYLE_DAY_VR_TAXI" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clScanningBg"
|
||||
android:layout_width="@dimen/dp_673"
|
||||
android:layout_height="@dimen/dp_384"
|
||||
app:layout_constraintLeft_toLeftOf="@id/mapRoamView"
|
||||
app:layout_constraintTop_toTopOf="@id/mapRoamView"
|
||||
app:layout_constraintBottom_toBottomOf="@id/mapRoamView">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCoverRoam"
|
||||
android:layout_width="@dimen/dp_153"
|
||||
android:layout_height="@dimen/dp_384"
|
||||
android:src="@drawable/icon_cover_line"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lvRoadCrossRoamTip"
|
||||
android:layout_width="@dimen/dp_683"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/mapRoamView"
|
||||
app:layout_constraintRight_toRightOf="@+id/mapRoamView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mapRoamView" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
@@ -74,27 +74,6 @@
|
||||
app:fusionLightUser="passenger"
|
||||
/>
|
||||
|
||||
<!-- 前方路况探查 -->
|
||||
<com.mogo.eagle.core.function.view.RoadCrossRoamView
|
||||
android:layout_width="@dimen/dp_648"
|
||||
android:layout_height="@dimen/dp_970"
|
||||
android:layout_marginTop="@dimen/dp_410"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--自动探查-->
|
||||
<com.mogo.och.unmanned.taxi.ui.rodedata.OchAutomaticExplorationView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
android:layout_marginBottom="-100dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:explorationUser="passenger"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<!-- 地图marker点击触发路侧直播 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.camera.RoadCrossLiveView
|
||||
android:layout_width="@dimen/dp_648"
|
||||
|
||||
Reference in New Issue
Block a user