[6.5.1_exam]Bus考试
This commit is contained in:
@@ -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<V : IView?, P : Presenter<V>?> : MvpFragment<V, P>() {
|
||||
abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V, P>(),
|
||||
ISeatPressureEventListener {
|
||||
|
||||
//启动自驾动画
|
||||
private var autopilotLoadingAnimator: ObjectAnimator? = null
|
||||
@@ -100,6 +110,25 @@ abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
override fun initViews(savedInstanceState: Bundle?) {
|
||||
@@ -145,6 +174,7 @@ abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V
|
||||
smallMapView!!.onDestroy()
|
||||
}
|
||||
EventBus.getDefault().unregister(this)
|
||||
CallerSeatPressureManager.removeListener(TAG)
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
@@ -437,4 +467,17 @@ abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V
|
||||
"SMd5DPQP:" + if (routesResult == null) "" else routesResult.txtFileMd5DPQP
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置座椅是否有人状态
|
||||
* @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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -287,6 +287,7 @@
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.drawline.LineView
|
||||
android:id="@+id/lineView"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
|
||||
android:layout_marginStart="-11dp"
|
||||
@@ -294,6 +295,99 @@
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_stop"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/lineView">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:text="停车"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_start"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_stop">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:text="出发"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_over_take"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_start">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:text="超车"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_och_bus_seat_pressure"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bus_operation_status_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_over_take"
|
||||
app:layout_constraintTop_toTopOf="@id/module_mogo_och_over_take"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_over_take">
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_seat_pressure"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!--座椅压力设置-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView
|
||||
android:id="@+id/seatPressureSettingView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/module_och_bus_seat_pressure"
|
||||
app:layout_constraintBottom_toBottomOf="@id/module_och_bus_seat_pressure"
|
||||
app:layout_constraintStart_toEndOf="@id/module_och_bus_seat_pressure"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user