[8.2.0][opt]新增MogoMind运营面板的开关
This commit is contained in:
@@ -26,6 +26,8 @@ import com.mogo.och.biz.routing.ui.RoutingSwitchModel
|
||||
import com.mogo.och.common.module.map.MapMakerManager
|
||||
import com.mogo.och.common.module.wigets.dialog.CommonDialogStatus
|
||||
import com.mogo.och.biz.routing.ui.errorpoint.ReportErrorPointView
|
||||
import com.mogo.och.biz.routing.ui.runing.other.TaskRunningView
|
||||
import com.mogo.och.biz.routing.ui.runing.other.TaskRunningView.Companion
|
||||
import com.mogo.och.biz.routing.ui.utils.TimeDistanceUtils
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import kotlinx.android.synthetic.main.biz_taxi_running.view.actv_end_routing
|
||||
@@ -85,9 +87,11 @@ class TaxiRunningView: ConstraintLayout, TaxiRunningModel.RoutingRuningCallback,
|
||||
}
|
||||
|
||||
private fun showFeedbackDialog(grayId: Long) {
|
||||
CallerLogger.d(TAG, "showFeedbackDialog!")
|
||||
val occurrenceTime = System.currentTimeMillis()
|
||||
val topActivity = ActivityUtils.getTopActivity()
|
||||
if(closeRouting==null) {
|
||||
CallerLogger.d(TAG, "closeRouting is null!")
|
||||
closeRouting = CommonDialogStatus
|
||||
.Builder()
|
||||
.title("路线验证结束")
|
||||
@@ -100,6 +104,7 @@ class TaxiRunningView: ConstraintLayout, TaxiRunningModel.RoutingRuningCallback,
|
||||
.build(topActivity)
|
||||
}else{
|
||||
if(closeRouting?.isShowing==true){
|
||||
CallerLogger.d(TAG, "closeRouting is showing, return!")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,18 @@ import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.Guideline
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bridge.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.unmanned.passenger.ui.bar.LeftBarView
|
||||
import com.mogo.och.unmanned.taxi.passenger.R
|
||||
@@ -22,15 +27,14 @@ import kotlinx.android.synthetic.main.taxi_p_home.view.acbtn_show_hdmap
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.hdMapView
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.lbv_go2_center
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.leftEndGuideline
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.midContainer
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.midStartGuideline
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.preContainer
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.rightContainer
|
||||
|
||||
class HomeView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), HomeViewModel.HomeCallback {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), HomeViewModel.HomeCallback,
|
||||
IReceivedMsgListener {
|
||||
|
||||
|
||||
private var isAMapShow = true
|
||||
@@ -40,8 +44,7 @@ class HomeView @JvmOverloads constructor(
|
||||
|
||||
private var TAG = "HomeView"
|
||||
|
||||
private var viewModel: HomeViewModel?=null
|
||||
|
||||
private var viewModel: HomeViewModel? = null
|
||||
|
||||
|
||||
private fun initView() {
|
||||
@@ -51,7 +54,7 @@ class HomeView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initlistener() {
|
||||
lbv_go2_center.setOrderIdCallback(object : LeftBarView.LeftBarCallback{
|
||||
lbv_go2_center.setOrderIdCallback(object : LeftBarView.LeftBarCallback {
|
||||
override fun setGo2CenterClick() {
|
||||
//切换到地图中间
|
||||
hdMapView.getUI()?.let {
|
||||
@@ -64,10 +67,10 @@ class HomeView @JvmOverloads constructor(
|
||||
})
|
||||
|
||||
acbtn_show_hdmap.onClick {
|
||||
showHdMap()
|
||||
updateViewState(false)
|
||||
}
|
||||
acbtn_show_all.onClick {
|
||||
showAmapAndHdMap()
|
||||
updateViewState(true)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,50 +78,50 @@ class HomeView @JvmOverloads constructor(
|
||||
/**
|
||||
* 展示两屏幕
|
||||
*/
|
||||
fun showHdMap(){
|
||||
updateViewState(true,false,false)
|
||||
fun showHdMap() {
|
||||
// updateViewState(true,false,false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示3屏
|
||||
*/
|
||||
fun showAmapAndHdMap(){
|
||||
updateViewState(true,true,false)
|
||||
fun showAmapAndHdMap() {
|
||||
// updateViewState(true,true,false)
|
||||
}
|
||||
|
||||
fun onCreate(savedInstanceState: Bundle?) {
|
||||
hdMapView.onCreate(savedInstanceState)
|
||||
preContainer.onCreate(savedInstanceState)
|
||||
// preContainer.onCreate(savedInstanceState)
|
||||
// decContainer.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
fun onSaveInstanceState(outState: Bundle) {
|
||||
hdMapView.onSaveInstanceState(outState)
|
||||
preContainer.onSaveInstanceState(outState)
|
||||
// preContainer.onSaveInstanceState(outState)
|
||||
// decContainer.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
hdMapView.onResume()
|
||||
preContainer.onResume()
|
||||
// preContainer.onResume()
|
||||
// decContainer.onResume()
|
||||
}
|
||||
|
||||
fun onLowMemory() {
|
||||
hdMapView.onLowMemory()
|
||||
preContainer.onLowMemory()
|
||||
// preContainer.onLowMemory()
|
||||
// decContainer.onLowMemory()
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
hdMapView.onPause()
|
||||
preContainer.onPause()
|
||||
// preContainer.onPause()
|
||||
// decContainer.onPause()
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
hdMapView.onDestroy()
|
||||
preContainer.onDestroy()
|
||||
// preContainer.onDestroy()
|
||||
// decContainer.onDestroy()
|
||||
}
|
||||
|
||||
@@ -128,70 +131,30 @@ class HomeView @JvmOverloads constructor(
|
||||
ViewModelProvider(it).get(HomeViewModel::class.java)
|
||||
}
|
||||
viewModel?.setViewCallback(this)
|
||||
CallerTelematicListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private fun updateViewState(
|
||||
showHDMapView: Boolean,
|
||||
showAMapView: Boolean,
|
||||
animate: Boolean = true
|
||||
showMogoMind: Boolean,
|
||||
animate: Boolean = false
|
||||
) {
|
||||
// 展示预测地图和高精地图
|
||||
if (showHDMapView && showAMapView) {
|
||||
CallerLogger.d(TAG,"展示高德地图和高精地图${showHDMapView}_$showAMapView")
|
||||
midStartGuideline.setGuidelinePercent(0.333f)
|
||||
CallerLogger.d(TAG, "展示MogoMind${showMogoMind}")
|
||||
if (animate) {
|
||||
animateGuidelinePercent(
|
||||
leftEndGuideline,
|
||||
0.333f,
|
||||
if (showMogoMind) 0.666f else 1f,
|
||||
1000
|
||||
) {
|
||||
lbv_go2_center.visibility = GONE
|
||||
midContainer.visibility = VISIBLE
|
||||
rightContainer.visibility = if (showMogoMind) View.VISIBLE else View.GONE
|
||||
}
|
||||
} else {
|
||||
leftEndGuideline.setGuidelinePercent(0.333f)
|
||||
lbv_go2_center.visibility = GONE
|
||||
midContainer.visibility = VISIBLE
|
||||
}
|
||||
}
|
||||
// 不展示预测 展示高精
|
||||
if (showHDMapView && !showAMapView) {
|
||||
CallerLogger.d(TAG,"展示高德 不展示高精${showHDMapView}_$showAMapView")
|
||||
if (animate) {
|
||||
animateGuidelinePercent(
|
||||
leftEndGuideline,
|
||||
0.666f,
|
||||
1000,
|
||||
end = {
|
||||
lbv_go2_center.visibility = VISIBLE
|
||||
midContainer.visibility = GONE
|
||||
}
|
||||
)
|
||||
} else {
|
||||
leftEndGuideline.setGuidelinePercent(0.666f)
|
||||
lbv_go2_center.visibility = VISIBLE
|
||||
midContainer.visibility = GONE
|
||||
}
|
||||
}
|
||||
// 不展示高精 展示高德
|
||||
if (!showHDMapView && showAMapView) {
|
||||
CallerLogger.d(TAG,"展示高精 不展示高德${showHDMapView}_$showAMapView")
|
||||
if (animate) {
|
||||
midStartGuideline.setGuidelinePercent(0.0f)
|
||||
animateGuidelinePercent(
|
||||
leftEndGuideline,
|
||||
0.0f,
|
||||
1000
|
||||
) {
|
||||
lbv_go2_center.visibility = GONE
|
||||
}
|
||||
}
|
||||
else {
|
||||
leftEndGuideline.setGuidelinePercent(0.0f)
|
||||
midStartGuideline.setGuidelinePercent(0.0f)
|
||||
lbv_go2_center.visibility = GONE
|
||||
}
|
||||
leftEndGuideline.setGuidelinePercent(if (showMogoMind) 0.666f else 1f)
|
||||
rightContainer.visibility = if (showMogoMind) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,4 +219,14 @@ class HomeView @JvmOverloads constructor(
|
||||
showAmapAndHdMap()
|
||||
}
|
||||
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
if (type == TelematicConstant.CONTROL_PASSENGER_AI_SWITCH) {
|
||||
UiThreadHandler.post {
|
||||
when (String(byteArray)) {
|
||||
"0" -> updateViewState(false)
|
||||
else -> updateViewState(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,37 +22,37 @@
|
||||
app:layout_constraintGuide_percent="0.333" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/midContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="-6.5dp"
|
||||
android:layout_marginEnd="-6.5dp"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@id/rightStartGuideline"
|
||||
app:layout_constraintStart_toEndOf="@+id/midStartGuideline"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/midContainer"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginStart="-6.5dp"-->
|
||||
<!-- android:layout_marginEnd="-6.5dp"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_10"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- app:layout_constraintEnd_toStartOf="@id/rightStartGuideline"-->
|
||||
<!-- app:layout_constraintStart_toEndOf="@+id/midStartGuideline"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<com.mogo.eagle.core.function.view.PredictionLayout
|
||||
android:id="@+id/preContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_676"
|
||||
android:background="@drawable/taxi_p_home_middle_top_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!-- <com.mogo.eagle.core.function.view.PredictionLayout-->
|
||||
<!-- android:id="@+id/preContainer"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_676"-->
|
||||
<!-- android:background="@drawable/taxi_p_home_middle_top_bg"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<com.mogo.eagle.core.function.view.DecisionLayout
|
||||
android:id="@+id/decContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_676"
|
||||
android:background="@drawable/taxi_p_home_middle_bottom_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<!-- <com.mogo.eagle.core.function.view.DecisionLayout-->
|
||||
<!-- android:id="@+id/decContainer"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_676"-->
|
||||
<!-- android:background="@drawable/taxi_p_home_middle_bottom_bg"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -122,7 +122,8 @@
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:layout_marginStart="-6.5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/rightStartGuideline">
|
||||
app:layout_constraintStart_toEndOf="@id/leftEndGuideline"
|
||||
>
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.aiview.AiView
|
||||
android:id="@+id/aiView"
|
||||
@@ -135,7 +136,7 @@
|
||||
android:elevation="6dp"
|
||||
android:id="@+id/acbtn_show_hdmap"
|
||||
android:text="展示高精"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
@@ -144,7 +145,7 @@
|
||||
android:id="@+id/acbtn_show_all"
|
||||
android:elevation="6dp"
|
||||
android:text="都展示"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
@@ -380,6 +380,13 @@ class TeleMsgHandler : IMsgHandler {
|
||||
)
|
||||
}
|
||||
|
||||
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH -> {
|
||||
CallerTelematicListenerManager.invokeReceivedMsg(
|
||||
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH,
|
||||
it.body
|
||||
)
|
||||
}
|
||||
|
||||
TelematicConstant.SHOW_TRAFFIC_LIGHT -> {
|
||||
val trafficLightJson = String(it.body)
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightStatus(
|
||||
|
||||
@@ -1066,6 +1066,7 @@ class OperatePanelLayout : LinearLayout {
|
||||
private const val KEY_SWEEPER_CLOUD_CONTROL = "sweeper_cloud_control"
|
||||
private const val KEY_LOOK_AROUND_360 = "look_around_360"
|
||||
private const val KEY_DRIVE_SEAT_VIDEO_STREAM = "drive_seat_video_stream"
|
||||
private const val KEY_MOGO_MIND_SWITCH = "mogo_mind_switch"
|
||||
}
|
||||
|
||||
private var lastTimeOnSendDriveVideo = 0L
|
||||
@@ -1358,6 +1359,21 @@ class OperatePanelLayout : LinearLayout {
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_REQ, toJson(map).toByteArray())
|
||||
return false
|
||||
}
|
||||
KEY_MOGO_MIND_SWITCH -> {
|
||||
val isChecked = newValue as? Boolean ?: false
|
||||
if (isChecked) {
|
||||
CallerTelematicManager.sendMsgToAllClients(
|
||||
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH,
|
||||
"1".toByteArray()
|
||||
)
|
||||
} else {
|
||||
CallerTelematicManager.sendMsgToAllClients(
|
||||
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH,
|
||||
"0".toByteArray()
|
||||
)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
return super.onPreferenceChange(preference, newValue)
|
||||
}
|
||||
|
||||
@@ -58,5 +58,12 @@
|
||||
android:persistent="false"
|
||||
android:enabled="false"
|
||||
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="mogo_mind_switch"
|
||||
android:layout="@layout/layout_operate_panel_preference_switch_compat"
|
||||
android:title="MogoMind开关"
|
||||
android:persistent="false"
|
||||
android:enabled="true"
|
||||
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
||||
@@ -13,6 +13,7 @@ class TelematicConstant {
|
||||
const val CONTROL_PASSENGER_DRIVER_MONITOR = 105
|
||||
const val V2N_AI_ROAD_DATA_TO_PASSENGER = 106 // V2N老链路云端下发给司机屏的数据,转发给乘客端
|
||||
const val WEATHER_SWITCH_STATUS = 107 // 司机屏的天气效果开关发给乘客端
|
||||
const val CONTROL_PASSENGER_AI_SWITCH = 108
|
||||
|
||||
const val OBU_RUNREDLIGHT_WARNING = 200 //闯红灯预警开关
|
||||
const val OBU_GREENWAVE_WARNING = 201 //绿波通行开关
|
||||
|
||||
Reference in New Issue
Block a user