Merge branch 'dev_RoboBus_P_230213_1.0.2' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback
|
||||
import com.mogo.och.bus.passenger.model.BusPassengerModel
|
||||
import com.mogo.och.bus.passenger.ui.BusPassengerFunctionDeviceFragment
|
||||
import com.mogo.och.common.module.manager.OCHM1LightAirconditionDoorStatusManager
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<BusPassengerFunctionDeviceFragment?>(view),
|
||||
@@ -18,6 +19,7 @@ class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragme
|
||||
|
||||
private var subscribe: Disposable? = null
|
||||
private var subscribeDoorStatus: Disposable? = null
|
||||
private var gnssSpeed =0.0
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BusPassengerFunctionDevicePresenter"
|
||||
@@ -26,6 +28,19 @@ class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragme
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
OCHM1LightAirconditionDoorStatusManager.addListener(TAG, this)
|
||||
BusPassengerModel.setControllerStatusCallback(TAG,object :
|
||||
IBusPassengerControllerStatusCallback{
|
||||
override fun onVRModeChanged(isVRMode: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged(location: MogoLocation?) {
|
||||
location?.let {
|
||||
gnssSpeed = it.gnssInfo.vehicleSpeed
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
@@ -44,6 +59,11 @@ class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragme
|
||||
}
|
||||
|
||||
fun openDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if(!canOpenOrCloseDoor.isNullOrEmpty()){
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
AdasManager.getInstance().sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
@@ -58,6 +78,11 @@ class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragme
|
||||
}
|
||||
|
||||
fun closeDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if(!canOpenOrCloseDoor.isNullOrBlank()){
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
AdasManager.getInstance().sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
@@ -71,6 +96,14 @@ class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragme
|
||||
}
|
||||
}
|
||||
|
||||
private fun canOpenOrCloseDoor():String?{
|
||||
if(gnssSpeed==0.0){
|
||||
return null
|
||||
}else{
|
||||
return "速度:${gnssSpeed}车辆正在运行、请稍后再试"
|
||||
}
|
||||
}
|
||||
|
||||
// 靠边停车
|
||||
fun startStopSide() {
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
|
||||
@@ -314,11 +314,11 @@ class BusPassengerFunctionSoftFragment :
|
||||
if(enable){
|
||||
adapter.setEnable(true)
|
||||
iv_temperature_select.visibility = View.VISIBLE
|
||||
rb_wind_speed_low.setTextColor(ContextCompat.getColor(requireContext(),R.color.bus_p_m1_6647576e))
|
||||
rb_wind_speed_low.setTextColor(ContextCompat.getColorStateList(requireContext(),R.color.bus_p_function_airconditon_pattern_text_color_selector))
|
||||
}else{
|
||||
adapter.setEnable(false)
|
||||
iv_temperature_select.visibility = View.GONE
|
||||
rb_wind_speed_low.setTextColor(ContextCompat.getColor(requireContext(),R.color.bus_p_function_airconditon_pattern_text_color_selector))
|
||||
rb_wind_speed_low.setTextColor(ContextCompat.getColor(requireContext(),R.color.bus_p_m1_6647576e))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ class BusPassengerFunctionSoftFragment :
|
||||
mAudioManager?.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC,
|
||||
currnetValue,
|
||||
AudioManager.FLAG_SHOW_UI
|
||||
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,16 +54,16 @@ class BusPassengerRouteFragment :
|
||||
true
|
||||
}
|
||||
omvOverMap.hideResetView()
|
||||
viewDriverMsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
|
||||
viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
|
||||
override fun showMsgBoxList(show: Boolean) {
|
||||
if (show) {
|
||||
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.isShowData(false)
|
||||
viewBusPM1MsgBoxList.visibility = View.VISIBLE
|
||||
viewBusPM1MsgBoxBubble.visibility = View.GONE
|
||||
viewBusPM1MsgBoxBubble.isShowData(false)
|
||||
} else {
|
||||
viewDriverMsgBoxList.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.isShowData(true)
|
||||
viewBusPM1MsgBoxList.visibility = View.GONE
|
||||
viewBusPM1MsgBoxBubble.visibility = View.VISIBLE
|
||||
viewBusPM1MsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public class HorizontalDecoration extends RecyclerView.ItemDecoration {
|
||||
/**
|
||||
* 第一个视图和最后一个视图偏移的距离
|
||||
*/
|
||||
private int distance = 0;
|
||||
private static int distance = 0;
|
||||
private static final String TAG = "HorizontalDecoration";
|
||||
|
||||
/**
|
||||
|
||||
@@ -164,36 +164,6 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<!--消息盒子打开视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="450dp"
|
||||
android:layout_height="520dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginEnd="@dimen/dp_34"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewDriverMsgBoxButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewDriverMsgBoxButton" />
|
||||
|
||||
<!--消息盒子气泡视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="450dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_34"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewDriverMsgBoxButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewDriverMsgBoxButton"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cb_bp_video_player"
|
||||
android:src="@drawable/bus_p_function_bottom_information_bg_selector"
|
||||
@@ -222,5 +192,35 @@
|
||||
android:layout_width="@dimen/dp_181"
|
||||
android:layout_height="@dimen/dp_179"/>
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
|
||||
android:id="@+id/viewBusPM1MsgBoxButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<!--消息盒子打开视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxListView
|
||||
android:id="@+id/viewBusPM1MsgBoxList"
|
||||
android:layout_width="450dp"
|
||||
android:layout_height="520dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginEnd="@dimen/dp_34"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewBusPM1MsgBoxButton" />
|
||||
|
||||
<!--消息盒子气泡视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxBubbleView
|
||||
android:id="@+id/viewBusPM1MsgBoxBubble"
|
||||
android:layout_width="450dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_34"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewBusPM1MsgBoxButton"/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user