[8.1.0]
[fea] [m2] [地图、mind、预测 展示逻辑]
This commit is contained in:
@@ -3,7 +3,12 @@ package com.mogo.och.shuttle.weaknet.passenger.presenter
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeListener
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.shuttle.weaknet.passenger.callback.ADASCallback
|
||||
import com.mogo.och.shuttle.weaknet.passenger.callback.ICommonCallback
|
||||
@@ -11,13 +16,60 @@ import com.mogo.och.shuttle.weaknet.passenger.constant.M2Const.Companion.M2_MAP_
|
||||
import com.mogo.och.shuttle.weaknet.passenger.model.CommonModel
|
||||
import com.mogo.och.shuttle.weaknet.passenger.model.PM2ADASModel
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.map.PM2HPMapFragment
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.AIMessageManager
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean.AIMessage
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class PM2ADASPresenter(view: PM2HPMapFragment?) :
|
||||
Presenter<PM2HPMapFragment?>(view), ADASCallback, ICommonCallback {
|
||||
Presenter<PM2HPMapFragment?>(view), ADASCallback, ICommonCallback, BridgeListener,
|
||||
AIMessageManager.AIMessageListener {
|
||||
|
||||
private val TAG = "PM2ADASPresenter"
|
||||
|
||||
init {
|
||||
private var haveTrajectoryInfos:Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
checkScreenChange()
|
||||
}
|
||||
}
|
||||
private var havePredictionInfos:Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
checkScreenChange()
|
||||
}
|
||||
}
|
||||
// 是否有订单
|
||||
private var haveLine:Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
checkScreenChange()
|
||||
}
|
||||
}
|
||||
private var arrived:Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
checkScreenChange()
|
||||
}
|
||||
}
|
||||
|
||||
private var aiMessageShowmagic:Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
checkScreenChange()
|
||||
}
|
||||
}
|
||||
|
||||
private var lastAiMessageTime:Long by Delegates.observable(System.currentTimeMillis()) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
aiMessageShowmagic = true
|
||||
RxUtils.disposeSubscribe(lastAIMessageCountDown)
|
||||
lastAIMessageCountDown = RxUtils.createSubscribe(5_000) {
|
||||
aiMessageShowmagic = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var lastAIMessageCountDown: Disposable? = null
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
PM2ADASModel.INSTANCE.init(context)
|
||||
initListener()
|
||||
}
|
||||
@@ -25,12 +77,16 @@ class PM2ADASPresenter(view: PM2HPMapFragment?) :
|
||||
private fun initListener() {
|
||||
PM2ADASModel.INSTANCE.setAdasCallback(this)
|
||||
CommonModel.setRouteLineInfoCallback(TAG, this)
|
||||
BridgeManager.addBridgeListener(TAG,this)
|
||||
AIMessageManager.registerListener(this)
|
||||
}
|
||||
|
||||
private fun removeListener() {
|
||||
PM2ADASModel.INSTANCE.setAdasCallback(null)
|
||||
CommonModel.setRouteLineInfoCallback(TAG,null)
|
||||
CommonModel.releaseListeners()
|
||||
BridgeManager.removeBridgeListener(TAG)
|
||||
AIMessageManager.unregisterListener(this)
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
@@ -51,12 +107,6 @@ class PM2ADASPresenter(view: PM2HPMapFragment?) :
|
||||
}
|
||||
}
|
||||
|
||||
override fun showNoTaskView(isTrue: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.showNoTaskView(!isTrue)
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLineStations(stations: MutableList<BusStationBean>) {
|
||||
|
||||
val stationsList = mutableListOf<LatLng>()
|
||||
@@ -79,8 +129,10 @@ class PM2ADASPresenter(view: PM2HPMapFragment?) :
|
||||
stationsListPass.add(latLng)
|
||||
} else if (station.drivingStatus == 2) {
|
||||
if (station.isLeaving) {
|
||||
arrived = false
|
||||
stationsListPass.add(latLng)
|
||||
} else {
|
||||
arrived = true
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
} else {
|
||||
@@ -98,4 +150,75 @@ class PM2ADASPresenter(view: PM2HPMapFragment?) :
|
||||
override fun removeHDMapStations() {
|
||||
mView?.removeMapMaker(M2_MAP_STATION_MAKER)
|
||||
}
|
||||
|
||||
override fun showNoTaskView(noLine: Boolean) {
|
||||
haveLine = !noLine
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.showNoTaskView(!noLine)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onTrajectoryHaveData(haveTrajectoryInfos: Boolean) {
|
||||
this.haveTrajectoryInfos = haveTrajectoryInfos
|
||||
// checkScreenChange()
|
||||
}
|
||||
|
||||
override fun onPredictionHavaData(havePredictionInfos: Boolean) {
|
||||
this.havePredictionInfos = havePredictionInfos
|
||||
// checkScreenChange()
|
||||
}
|
||||
|
||||
override fun onReceive(msg: AIMessage) {
|
||||
lastAiMessageTime = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
override fun clear() {
|
||||
}
|
||||
|
||||
|
||||
fun checkScreenChange(){
|
||||
CallerLogger.d(TAG,"haveLine:$haveLine arrived:$arrived havePredictionInfos:$havePredictionInfos haveTrajectoryInfos:$haveTrajectoryInfos aiMessageShowmagic:$aiMessageShowmagic")
|
||||
BizLoopManager.runInMainThread{
|
||||
// 是否有订单
|
||||
if(haveLine){// 有订单
|
||||
if(arrived){//展示高德地图
|
||||
if(aiMessageShowmagic){
|
||||
// 展示高德地图+展示mogomind
|
||||
mView?.showAmap_mind()
|
||||
return@runInMainThread
|
||||
}else{
|
||||
// 展示高德地图
|
||||
mView?.showAmap()
|
||||
return@runInMainThread
|
||||
}
|
||||
}else{// 展示高精地图
|
||||
if(aiMessageShowmagic){
|
||||
// 展示高精地图
|
||||
mView?.showHDMap_mind()
|
||||
return@runInMainThread
|
||||
}else{
|
||||
if(havePredictionInfos&&haveTrajectoryInfos){
|
||||
// 展示高精地图+展示预测和决策
|
||||
mView?.showHDMap_aip_prediction()
|
||||
return@runInMainThread
|
||||
}else{
|
||||
// 展示高精地图
|
||||
mView?.showHDMap()
|
||||
return@runInMainThread
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else{// 没有订单
|
||||
if(aiMessageShowmagic){// 有mogomind 消息
|
||||
// 展示高精地图+mogoMind
|
||||
mView?.showHDMap_mind()
|
||||
}else{
|
||||
// 展示高精地图
|
||||
mView?.showHDMap()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,12 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UriUtils
|
||||
import com.mogo.och.common.module.biz.media.MediaManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.transform.OchTransform
|
||||
@@ -14,6 +19,11 @@ import com.mogo.och.shuttle.weaknet.passenger.presenter.PM2Presenter
|
||||
import com.mogo.och.common.module.wigets.media.MediaPlayerFragment
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.line.PM2DrivingInfoFragment
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.map.PM2HPMapFragment
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.AIMessageManager
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean.AIMessage
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.test1
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.test2
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.test3
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.tv_shuttle_b2_p_version
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.video_fragment
|
||||
|
||||
@@ -91,6 +101,63 @@ class PM2BaseFragment :
|
||||
if (mediaFragment == null) mediaFragment = MediaPlayerFragment()
|
||||
childFragmentManager.beginTransaction().add(R.id.video_fragment, mediaFragment!!)
|
||||
.show(mediaFragment!!).commitAllowingStateLoss()
|
||||
|
||||
|
||||
test1.onClick {
|
||||
CallerRoadV2NEventWindowListenerManager.showImage(
|
||||
System.currentTimeMillis().toString(),
|
||||
System.currentTimeMillis(),
|
||||
EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
String.format(
|
||||
EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
100
|
||||
),
|
||||
false,
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
UriUtils.res2Uri(
|
||||
EventTypeEnumNew.getPoiTypeBg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType,
|
||||
false
|
||||
).toString()
|
||||
).toString()
|
||||
)
|
||||
}
|
||||
test2.onClick {
|
||||
CallerMapRoadListenerManager.invokeCrossDevice(true)
|
||||
}
|
||||
test3.onClick {
|
||||
val one = AIMessage.RoadMsg(201,1,true,false)
|
||||
val two = AIMessage.RoadMsg(202,2,false,false)
|
||||
val three = AIMessage.RoadMsg(203,3,false,true)
|
||||
|
||||
val sortedList = ArrayList<AIMessage.RoadMsg>()
|
||||
sortedList.add(one)
|
||||
sortedList.add(two)
|
||||
sortedList.add(three)
|
||||
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),"路口车龙","前方路口有车龙",sortedList)
|
||||
AIMessageManager.post(ndeEvent)
|
||||
|
||||
// CallerRoadV2NEventWindowListenerManager.showImage(
|
||||
// System.currentTimeMillis().toString(),
|
||||
// System.currentTimeMillis(),
|
||||
// EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
// String.format(
|
||||
// EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
// 100
|
||||
// ),
|
||||
// false,
|
||||
// String.format(
|
||||
// EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
// 100
|
||||
// ),
|
||||
// UriUtils.res2Uri(
|
||||
// EventTypeEnumNew.getPoiTypeBg(
|
||||
// EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType,
|
||||
// false
|
||||
// ).toString()
|
||||
// ).toString()
|
||||
// )
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): PM2Presenter {
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.mogo.och.shuttle.weaknet.passenger.ui.map
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.marginEnd
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
@@ -16,7 +19,11 @@ import com.mogo.och.shuttle.weaknet.passenger.R
|
||||
import com.mogo.och.shuttle.weaknet.passenger.constant.M2Const.Companion.TYPE_MARKER_M2_LINE
|
||||
import com.mogo.och.shuttle.weaknet.passenger.presenter.PM2ADASPresenter
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.aciv_top_shader
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.cl_aip_contain
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.cl_prediction_contain
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.mHomeView
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.mindView
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.overMapView
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -71,6 +78,7 @@ class PM2HPMapFragment :
|
||||
val radius = AutoSizeUtils.dp2px(requireContext(), 16f)
|
||||
it.outlineProvider = TextureVideoViewOutlineProvider(radius.toFloat())
|
||||
it.clipToOutline = true
|
||||
it.hideResetView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,4 +203,91 @@ class PM2HPMapFragment :
|
||||
overMapView?.clearCustomPolyline()
|
||||
}
|
||||
|
||||
// 展示高精地图
|
||||
// 展示高精地图+展示预测和决策
|
||||
// 展示高精地图+mogoMind
|
||||
// 展示高德地图
|
||||
// 展示高德地图+展示mogomind
|
||||
|
||||
val hdMapMarginEnd = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),-170f)
|
||||
|
||||
// 展示高精地图
|
||||
fun showHDMap(){
|
||||
mHomeView.visibility = View.VISIBLE
|
||||
val layoutParams = mHomeView.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.marginStart = 0
|
||||
mHomeView.layoutParams = layoutParams
|
||||
|
||||
aciv_top_shader.visibility = View.GONE
|
||||
|
||||
cl_aip_contain.visibility = View.GONE
|
||||
cl_prediction_contain.visibility = View.GONE
|
||||
|
||||
mindView.visibility = View.GONE
|
||||
overMapView.visibility = View.GONE
|
||||
}
|
||||
// 展示高德地图
|
||||
fun showAmap(){
|
||||
mHomeView.visibility = View.GONE
|
||||
aciv_top_shader.visibility = View.GONE
|
||||
|
||||
cl_aip_contain.visibility = View.GONE
|
||||
cl_prediction_contain.visibility = View.GONE
|
||||
|
||||
mindView.visibility = View.GONE
|
||||
overMapView.visibility = View.VISIBLE
|
||||
|
||||
val layoutParams = overMapView.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.marginStart = 0
|
||||
overMapView.layoutParams = layoutParams
|
||||
}
|
||||
// 展示高精地图+mogoMind
|
||||
fun showHDMap_mind(){
|
||||
mHomeView.visibility = View.VISIBLE
|
||||
val layoutParams = mHomeView.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.marginStart = hdMapMarginEnd
|
||||
mHomeView.layoutParams = layoutParams
|
||||
|
||||
aciv_top_shader.visibility = View.VISIBLE
|
||||
|
||||
cl_aip_contain.visibility = View.GONE
|
||||
cl_prediction_contain.visibility = View.GONE
|
||||
|
||||
mindView.visibility = View.VISIBLE
|
||||
overMapView.visibility = View.GONE
|
||||
}
|
||||
// 展示高精地图+展示预测和决策
|
||||
fun showHDMap_aip_prediction(){
|
||||
mHomeView.visibility = View.VISIBLE
|
||||
val layoutParams = mHomeView.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.marginStart = hdMapMarginEnd
|
||||
mHomeView.layoutParams = layoutParams
|
||||
|
||||
aciv_top_shader.visibility = View.VISIBLE
|
||||
|
||||
cl_aip_contain.visibility = View.VISIBLE
|
||||
cl_prediction_contain.visibility = View.VISIBLE
|
||||
|
||||
mindView.visibility = View.GONE
|
||||
overMapView.visibility = View.GONE
|
||||
}
|
||||
|
||||
fun showAmap_mind(){
|
||||
mHomeView.visibility = View.GONE
|
||||
|
||||
aciv_top_shader.visibility = View.VISIBLE
|
||||
|
||||
cl_aip_contain.visibility = View.GONE
|
||||
cl_prediction_contain.visibility = View.GONE
|
||||
|
||||
mindView.visibility = View.VISIBLE
|
||||
|
||||
overMapView.visibility = View.VISIBLE
|
||||
|
||||
val layoutParams = overMapView.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.marginStart = hdMapMarginEnd
|
||||
overMapView.layoutParams = layoutParams
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,9 +28,6 @@ import com.mogo.och.shuttle.weaknet.passenger.ui.mind.data.NDEViewModel
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.data.RoadCrossRoamViewModel
|
||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.data.RoadV2NEventViewModel
|
||||
import kotlinx.android.synthetic.main.m2_mind_view.view.rv_mind_list
|
||||
import kotlinx.android.synthetic.main.m2_mind_view.view.test1
|
||||
import kotlinx.android.synthetic.main.m2_mind_view.view.test2
|
||||
import kotlinx.android.synthetic.main.m2_mind_view.view.test3
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class MindView : ConstraintLayout, MindViewModel.AiViewCallback {
|
||||
@@ -83,62 +80,6 @@ class MindView : ConstraintLayout, MindViewModel.AiViewCallback {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
test1.onClick {
|
||||
CallerRoadV2NEventWindowListenerManager.showImage(
|
||||
System.currentTimeMillis().toString(),
|
||||
System.currentTimeMillis(),
|
||||
EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
String.format(
|
||||
EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
100
|
||||
),
|
||||
false,
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
UriUtils.res2Uri(
|
||||
EventTypeEnumNew.getPoiTypeBg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType,
|
||||
false
|
||||
).toString()
|
||||
).toString()
|
||||
)
|
||||
}
|
||||
test2.onClick {
|
||||
CallerMapRoadListenerManager.invokeCrossDevice(true)
|
||||
}
|
||||
test3.onClick {
|
||||
val one = AIMessage.RoadMsg(201,1,true,false)
|
||||
val two = AIMessage.RoadMsg(202,2,false,false)
|
||||
val three = AIMessage.RoadMsg(203,3,false,true)
|
||||
|
||||
val sortedList = ArrayList<AIMessage.RoadMsg>()
|
||||
sortedList.add(one)
|
||||
sortedList.add(two)
|
||||
sortedList.add(three)
|
||||
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),"路口车龙","前方路口有车龙",sortedList)
|
||||
AIMessageManager.post(ndeEvent)
|
||||
|
||||
// CallerRoadV2NEventWindowListenerManager.showImage(
|
||||
// System.currentTimeMillis().toString(),
|
||||
// System.currentTimeMillis(),
|
||||
// EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
// String.format(
|
||||
// EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
// 100
|
||||
// ),
|
||||
// false,
|
||||
// String.format(
|
||||
// EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
// 100
|
||||
// ),
|
||||
// UriUtils.res2Uri(
|
||||
// EventTypeEnumNew.getPoiTypeBg(
|
||||
// EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType,
|
||||
// false
|
||||
// ).toString()
|
||||
// ).toString()
|
||||
// )
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
@@ -37,31 +37,10 @@ class MindViewModel : ViewModel(), AIMessageManager.AIMessageListener,
|
||||
private val _messagesFlow = MutableStateFlow<List<AIMessage>>(emptyList())
|
||||
val messagesFlow: SharedFlow<List<AIMessage>> get() = _messagesFlow
|
||||
|
||||
private val _asrUIStateFlow = MutableStateFlow<AsrUIState>(AsrUIState.Idle)
|
||||
val asrUIStateFlow: StateFlow<AsrUIState> get() = _asrUIStateFlow
|
||||
|
||||
private val tipsTimeOut = "小智还没反应过来,请稍后再试~"
|
||||
private val tipsExit = "我先退下了"
|
||||
val tipsQuestions = listOf(
|
||||
"可以问我:前方路口有拥堵吗?",
|
||||
"可以对我说:介绍一下蘑菇车联?",
|
||||
"想要对话时可以点击:小智智能体",
|
||||
"可以问我:今天天气怎么样?",
|
||||
)
|
||||
private val tipsWakeUpList = listOf(
|
||||
"嗯,我在呢",
|
||||
"在的",
|
||||
"在呢",
|
||||
"你说",
|
||||
)
|
||||
|
||||
private val commontCallback = object : ICommonCallback{
|
||||
override fun showNoTaskView(isTrue: Boolean) {
|
||||
if(isTrue){
|
||||
synchronized(msgList) {
|
||||
msgList.clear()
|
||||
_messagesFlow.value = msgList.toList()
|
||||
}
|
||||
clearMsg()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,20 +165,10 @@ class MindViewModel : ViewModel(), AIMessageManager.AIMessageListener,
|
||||
}
|
||||
|
||||
|
||||
fun getQuestionsRandomIndex(): Int {
|
||||
return tipsQuestions.indexOf(tipsQuestions.random())
|
||||
}
|
||||
|
||||
interface AiViewCallback {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sealed class AsrUIState {
|
||||
object Idle : AsrUIState()
|
||||
data class Listening(val partialText: String) : AsrUIState()
|
||||
data class Recognized(val finalText: String) : AsrUIState()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ object CommonModel {
|
||||
LanSocketManager.unRegisterSocketMessageListener(DPMsgType.TYPE_TASK_DETAILS.type, typeTaskDetails)
|
||||
LoginLanPassengerSocket.removeListener(TAG)
|
||||
cleanStation("release")
|
||||
this.mCommonCallbackList.clear()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,31 +43,5 @@
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/test1"
|
||||
android:text="测试1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/test2"
|
||||
android:text="测试2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/test3"
|
||||
android:text="测试3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</merge>
|
||||
@@ -138,6 +138,31 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/test1"
|
||||
android:text="测试1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/test2"
|
||||
android:text="测试2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/test3"
|
||||
android:text="测试3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 16 9 -->
|
||||
<!-- 1000 562.5 -->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -19,47 +19,8 @@
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="-170dp"
|
||||
android:layout_width="@dimen/dp_996"
|
||||
android:layout_height="@dimen/dp_650"/>
|
||||
<!--虚化阴影-->
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/m2_map_right_top"
|
||||
android:layout_width="@dimen/dp_430"
|
||||
android:layout_height="@dimen/dp_650"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/b2_aip_bg"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_1"
|
||||
android:layout_width="@dimen/dp_411"
|
||||
android:layout_height="@dimen/dp_332"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/b2_prediction_bg"
|
||||
android:layout_marginEnd="@dimen/dp_1"
|
||||
android:layout_marginBottom="@dimen/dp_m_1"
|
||||
android:layout_width="@dimen/dp_411"
|
||||
android:layout_height="@dimen/dp_332"/>
|
||||
|
||||
<com.mogo.och.shuttle.weaknet.passenger.ui.mind.MindView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/b2_mind_bg"
|
||||
android:layout_width="@dimen/dp_411"
|
||||
android:layout_height="@dimen/dp_650"/>
|
||||
|
||||
|
||||
<!-- 全览地图带站点-->
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
@@ -78,6 +39,53 @@
|
||||
app:arrivedDrawable="@drawable/shuttle_p_m2_amap_arrived_road"
|
||||
app:unArrivedDrawable="@drawable/shuttle_p_m2_amap_arriving_road"
|
||||
app:mapTilt="0" />
|
||||
|
||||
<!--虚化阴影-->
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_top_shader"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/m2_map_right_top"
|
||||
android:layout_width="@dimen/dp_430"
|
||||
android:layout_height="@dimen/dp_650"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_aip_contain"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/b2_aip_bg"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_1"
|
||||
android:layout_width="@dimen/dp_411"
|
||||
android:layout_height="@dimen/dp_332"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_prediction_contain"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/b2_prediction_bg"
|
||||
android:layout_marginEnd="@dimen/dp_1"
|
||||
android:layout_marginBottom="@dimen/dp_m_1"
|
||||
android:layout_width="@dimen/dp_411"
|
||||
android:layout_height="@dimen/dp_332"/>
|
||||
|
||||
<com.mogo.och.shuttle.weaknet.passenger.ui.mind.MindView
|
||||
android:id="@+id/mindView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/b2_mind_bg"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/dp_411"
|
||||
android:layout_height="@dimen/dp_650"/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user