diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt index ef616aec9d..6ee7c9e974 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt @@ -13,9 +13,13 @@ import com.mogo.commons.mvp.IView import com.mogo.commons.mvp.MvpFragment import com.mogo.commons.mvp.Presenter import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.isCanStartAutopilot +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendPlanningCmd +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendPlanningLineChangeCmd import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView +import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener import com.mogo.eagle.core.utilcode.util.UiThreadHandler @@ -32,8 +36,13 @@ import kotlinx.android.synthetic.main.bus_base_fragment.fl_speed import kotlinx.android.synthetic.main.bus_base_fragment.mapBizView import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_arrived_tv import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_autopilot_status +import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_over_take import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_slide_panel +import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_start import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_station_panel_container +import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_stop +import kotlinx.android.synthetic.main.bus_base_fragment.module_och_bus_seat_pressure +import kotlinx.android.synthetic.main.bus_base_fragment.seatPressureSettingView import kotlinx.android.synthetic.main.bus_base_fragment.smallMapView import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxBubble import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxButton @@ -48,7 +57,8 @@ import org.greenrobot.eventbus.EventBus * * @author tongchenfei */ -abstract class BaseBusTabFragment?> : MvpFragment() { +abstract class BaseBusTabFragment?> : MvpFragment(), + ISeatPressureEventListener { //启动自驾动画 private var autopilotLoadingAnimator: ObjectAnimator? = null @@ -100,6 +110,25 @@ abstract class BaseBusTabFragment?> : MvpFragment?> : MvpFragment?> : MvpFragment + + + + + + + + + + + + + + + + + + + + + + + ?>() : - MvpFragment() { + MvpFragment() , ISeatPressureEventListener { private val TAG = "BaseBusTabFragment" @@ -114,6 +123,25 @@ abstract class CharterBaseFragment?>() : onArriveStation() } + module_mogo_och_stop.setOnClickListener { + sendPlanningCmd(1) + } + module_mogo_och_start.setOnClickListener { + sendPlanningCmd(2) + } + module_mogo_och_over_take.setOnClickListener { + sendPlanningLineChangeCmd(3) + } + //座椅压力 + module_och_bus_seat_pressure.setOnClickListener { + if (seatPressureSettingView.visibility == View.VISIBLE) { + seatPressureSettingView.visibility = View.GONE + } else { + seatPressureSettingView.visibility = View.VISIBLE + } + } + CallerSeatPressureManager.addListener(TAG, this) + //消息盒子 viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton) viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList) @@ -227,6 +255,7 @@ abstract class CharterBaseFragment?>() : smallMapView?.onDestroy() super.onDestroyView() CallerAutopilotRecordListenerManager.removeListener(TAG) + CallerSeatPressureManager.removeListener(TAG) EventBus.getDefault().unregister(this) } @@ -267,6 +296,18 @@ abstract class CharterBaseFragment?>() : super.onDestroy() } + /** + * 设置座椅是否有人状态 + * @param isPress 是否有人 + */ + override fun onUpdateBgEvent(isPress: Boolean) { + if (isPress) { + module_och_bus_seat_pressure.setBackgroundResource(R.drawable.bus_operation_status_select_bg) + } else { + module_och_bus_seat_pressure.setBackgroundResource(R.drawable.bus_operation_status_bg) + } + } + /** * bus调试面板打开关闭 */ diff --git a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml index dd34a3e11b..f1a3b4e4b4 100644 --- a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml +++ b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml @@ -251,6 +251,7 @@ android:layout_height="@dimen/dp_142"/> + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/shuttle/fragment/BaseShuttleTabFragment.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/shuttle/fragment/BaseShuttleTabFragment.java index 6043c194ec..4cda129c6e 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/shuttle/fragment/BaseShuttleTabFragment.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/shuttle/fragment/BaseShuttleTabFragment.java @@ -10,6 +10,7 @@ import android.view.ViewGroup; import android.view.animation.LinearInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -25,14 +26,17 @@ import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.config.HdMapBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; +import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; +import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView; +import com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView; import com.mogo.eagle.core.function.smp.view.SmallMapView; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener; @@ -55,7 +59,7 @@ import org.greenrobot.eventbus.EventBus; * * @author tongchenfei */ -public abstract class BaseShuttleTabFragment> extends MvpFragment { +public abstract class BaseShuttleTabFragment> extends MvpFragment implements ISeatPressureEventListener { private static final String TAG = "BaseBusTabFragment"; @@ -79,6 +83,12 @@ public abstract class BaseShuttleTabFragment { + CallerAutoPilotControlManager.INSTANCE.sendPlanningCmd(1); + }); + moduleMogoOchStart.setOnClickListener(v -> { + CallerAutoPilotControlManager.INSTANCE.sendPlanningCmd(2); + }); + moduleMogoOchOverTake.setOnClickListener(v -> { + CallerAutoPilotControlManager.INSTANCE.sendPlanningLineChangeCmd(3); + }); + //座椅压力 + moduleOchBusSeatPressure.setOnClickListener(v -> { + if(mSeatPressureSettingView.getVisibility() == View.VISIBLE){ + mSeatPressureSettingView.setVisibility(View.GONE); + }else{ + mSeatPressureSettingView.setVisibility(View.VISIBLE); + } + }); + CallerSeatPressureManager.INSTANCE.addListener(TAG, this); + FrameLayout flSpeed = findViewById(R.id.fl_speed); if (flSpeed != null) { CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(flSpeed.getContext(), flSpeed); @@ -240,6 +274,7 @@ public abstract class BaseShuttleTabFragment diff --git a/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml b/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml index 159ebca0d0..ef7b3d75dc 100644 --- a/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml +++ b/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml @@ -269,6 +269,7 @@ android:layout_height="@dimen/dp_142"/> + + + + + + + + + + + + + + + + + + + + + + > extends MvpFragment implements IMogoMapListener { +public abstract class BaseTaxiTabFragment> extends MvpFragment implements IMogoMapListener , ISeatPressureEventListener { private static final String TAG = "BaseOchFragment"; private RelativeLayout ctvAutopilotStatusRL; @@ -85,6 +90,10 @@ public abstract class BaseTaxiTabFragment { + if(seatPressureSettingView.getVisibility() == View.VISIBLE){ + seatPressureSettingView.setVisibility(View.GONE); + }else{ + seatPressureSettingView.setVisibility(View.VISIBLE); + } + }); + CallerSeatPressureManager.INSTANCE.addListener(TAG,this); + + TakeOverAutopilotView takeOverAutopilotView = new TakeOverAutopilotView(getActivity()); + takeOverAutopilotView.showFloatWindow(); } @Override @@ -227,6 +251,7 @@ public abstract class BaseTaxiTabFragment + + + + + + +