Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0

This commit is contained in:
yangyakun
2023-02-02 12:02:37 +08:00
19 changed files with 358 additions and 24 deletions

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.och.bus.passenger">
</manifest>

View File

@@ -12,7 +12,7 @@ import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.step
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment
import com.mogo.och.bus.passenger.ui.BusPM2BaseFragment
/**
* 网约车-Bus-乘客端
@@ -23,7 +23,7 @@ import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment
class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
private var mActivity: FragmentActivity? = null
private var mContainerId = 0
private var mPassengerFragment: BusPassengerRouteFragment? = null
private var mPM2Fragment: BusPM2BaseFragment? = null
override fun createCoverage(activity: FragmentActivity, containerId: Int) {}
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
mActivity = activity
@@ -32,7 +32,7 @@ class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
}
override val functionName: String
get() = "och-bus-passenger-m1"
get() = "och-bus-passenger-m2"
override fun onDestroy() {
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
@@ -64,21 +64,21 @@ class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
}
private fun showFragment() {
if (mPassengerFragment == null) {
if (mPM2Fragment == null) {
d(SceneConstant.M_TAXI_P + TAG, "准备add fragment======")
mPassengerFragment = BusPassengerRouteFragment()
mPM2Fragment = BusPM2BaseFragment()
mActivity!!.supportFragmentManager.beginTransaction()
.add(mContainerId, mPassengerFragment!!).commitAllowingStateLoss()
.add(mContainerId, mPM2Fragment!!).commitAllowingStateLoss()
return
}
d(SceneConstant.M_TAXI_P + TAG, "准备show fragment")
mActivity!!.supportFragmentManager.beginTransaction().show(mPassengerFragment!!)
mActivity!!.supportFragmentManager.beginTransaction().show(mPM2Fragment!!)
.commitAllowingStateLoss()
}
private fun hideFragment() {
if (mPassengerFragment != null) {
mActivity!!.supportFragmentManager.beginTransaction().hide(mPassengerFragment!!)
if (mPM2Fragment != null) {
mActivity!!.supportFragmentManager.beginTransaction().hide(mPM2Fragment!!)
.commitAllowingStateLoss()
}
}

View File

@@ -0,0 +1,45 @@
package com.mogo.och.bus.passenger.model
import com.mogo.commons.module.status.IMogoStatusChangedListener
import com.mogo.commons.module.status.StatusDescriptor
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import mogo.telematics.pad.MessagePad
/**
* @author: wangmingjun
* @date: 2023/1/31
*/
class BusPM2Model private constructor() {
companion object {
val TAG = BusPM2Model::class.java.simpleName
val instance: BusPM2Model by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
BusPM2Model()
}
}
init {
initListener()
}
private fun initListener(){
CallerAutoPilotStatusListenerManager.addListener(TAG,mAutoPilotStatusListener)
}
private val mAutoPilotStatusListener : IMoGoAutopilotStatusListener =
object : IMoGoAutopilotStatusListener {
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
super.onAutopilotArriveAtStation(arrivalNotification)
//todo 自动驾驶到站接口
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
super.onAutopilotStatusResponse(autoPilotStatusInfo)
//todo 自动驾驶状态展示, 注意美化模式下的处理
}
}
}

View File

@@ -0,0 +1,7 @@
package com.mogo.och.bus.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.BusPM2DrivingInfoFragment
class BusPM2DrivingPresenter(view: BusPM2DrivingInfoFragment?) :
Presenter<BusPM2DrivingInfoFragment?>(view)

View File

@@ -0,0 +1,7 @@
package com.mogo.och.bus.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.BusPM2MapFragment
class BusPM2MapPresenter(view: BusPM2MapFragment?) :
Presenter<BusPM2MapFragment?>(view)

View File

@@ -0,0 +1,7 @@
package com.mogo.och.bus.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.BusPM2BaseFragment
class BusPM2Presenter(view: BusPM2BaseFragment?) :
Presenter<BusPM2BaseFragment?>(view)

View File

@@ -0,0 +1,7 @@
package com.mogo.och.bus.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.video.BusPM2VideoFragment
class BusPM2VideoPresenter(view: BusPM2VideoFragment?) :
Presenter<BusPM2VideoFragment?>(view)

View File

@@ -1,7 +0,0 @@
package com.mogo.och.bus.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment
class BusPassengerPresenter(view: BusPassengerRouteFragment?) :
Presenter<BusPassengerRouteFragment?>(view)

View File

@@ -3,22 +3,21 @@ package com.mogo.och.bus.passenger.ui
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.call.map.CallerSmpManager.hidePanel
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
import com.mogo.och.bus.passenger.presenter.BusPM2Presenter
/**
* @author: wangmingjun
* @date: 2022/4/12
*/
class BusPassengerRouteFragment :
MvpFragment<BusPassengerRouteFragment?, BusPassengerPresenter?>() {
class BusPM2BaseFragment :
MvpFragment<BusPM2BaseFragment?, BusPM2Presenter?>() {
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
private val mPrevAPStatus = -1
override fun getLayoutId(): Int {
return R.layout.bus_p_fragment
return R.layout.bus_p_m2_fragment
}
override fun getTagName(): String {
@@ -30,11 +29,11 @@ class BusPassengerRouteFragment :
hidePanel()
}
override fun createPresenter(): BusPassengerPresenter {
return BusPassengerPresenter(this)
override fun createPresenter(): BusPM2Presenter {
return BusPM2Presenter(this)
}
companion object {
private val TAG = BusPassengerRouteFragment::class.java.simpleName
private val TAG = BusPM2BaseFragment::class.java.simpleName
}
}

View File

@@ -0,0 +1,37 @@
package com.mogo.och.bus.passenger.ui
import com.mogo.commons.mvp.MvpFragment
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.BusPM2DrivingPresenter
/**
* @author: wangmingjun
* @date: 2022/4/12
*/
class BusPM2DrivingInfoFragment :
MvpFragment<BusPM2DrivingInfoFragment?, BusPM2DrivingPresenter?>() {
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
override fun getLayoutId(): Int {
return R.layout.bus_p_m2_driving_info_fragment
}
override fun getTagName(): String {
return TAG
}
override fun initViews() {
}
override fun createPresenter(): BusPM2DrivingPresenter {
return BusPM2DrivingPresenter(this)
}
companion object {
private val TAG = BusPM2DrivingInfoFragment::class.java.simpleName
}
}

View File

@@ -0,0 +1,37 @@
package com.mogo.och.bus.passenger.ui
import com.mogo.commons.mvp.MvpFragment
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.BusPM2MapPresenter
/**
* @author: wangmingjun
* @date: 2022/4/12
*/
class BusPM2MapFragment :
MvpFragment<BusPM2MapFragment?, BusPM2MapPresenter?>() {
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
override fun getLayoutId(): Int {
return R.layout.bus_p_m2_driving_info_fragment
}
override fun getTagName(): String {
return TAG
}
override fun initViews() {
}
override fun createPresenter(): BusPM2MapPresenter {
return BusPM2MapPresenter(this)
}
companion object {
private val TAG = BusPM2MapFragment::class.java.simpleName
}
}

View File

@@ -0,0 +1,36 @@
package com.mogo.och.bus.passenger.ui.video
import com.mogo.commons.mvp.MvpFragment
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.BusPM2VideoPresenter
/**
* @author: wangmingjun
* @date: 2022/4/12
*/
class BusPM2VideoFragment :
MvpFragment<BusPM2VideoFragment?, BusPM2VideoPresenter?>() {
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
override fun getLayoutId(): Int {
return R.layout.bus_p_m2_video_fragment
}
override fun getTagName(): String {
return TAG
}
override fun initViews() {
}
override fun createPresenter(): BusPM2VideoPresenter {
return BusPM2VideoPresenter(this)
}
companion object {
private val TAG = BusPM2VideoFragment::class.java.simpleName
}
}

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 行车卡片--><!-- 全览地图带站点-->
<TextView
android:id="@+id/bus_p_speed_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_40"
android:includeFontPadding="false"
android:letterSpacing="-0.05"
android:text="0"
android:textColor="@color/bus_p_speed_txt_color"
android:textSize="@dimen/bus_p_speed_txt_size"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 行车卡片--><!-- 全览地图带站点-->
<!-- 高精地图-->
<!-- 图片或视频广告-->
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 图片或视频广告-->
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 图片或视频广告-->
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="bus_p_speed_txt_color">#2D3E5F</color>
<color name="bus_p_traffic_light_bg_color">#CCE9EFFC</color>
<color name="bus_p_traffic_light_bg_stroke">#C7D2E1</color>
<color name="bus_p_driver_number_plate_color">#2D3E5F</color>
<color name="bus_p_line_name_color">#0043FF</color>
<color name="bus_p_line_operation_time_color">#2D3E5F</color>
<color name="bus_p_no_data_color">#596A8A</color>
<color name="bus_p_station_circle_color">#D8E5F8</color>
<color name="bus_p_start_station_circle_borner_color">#FFB327</color>
<color name="bus_p_station_txt_color">#2D3E5F</color>
<color name="bus_p_current_station_txt_color">#0043FF</color>
<color name="bus_p_middle_station_circle_color2">#276AFE</color>
<color name="bus_p_middle_station_circle_color1">#0043FF</color>
<color name="bus_p_end_station_circle_borner_color">#276AFE</color>
<color name="bus_p_start_tag_bg_color1">#FFC125</color>
<color name="bus_p_start_tag_bg_color2">#FF8131</color>
<color name="bus_p_end_tag_bg_color1">#31BFF2</color>
<color name="bus_p_end_tag_bg_color2">#3257E9</color>
<color name="bus_p_end_tag_txt_color">#FFFFFF</color>
<color name="bus_p_tag_line_color">#CDDBF6</color>
<color name="bus_p_panel_cur_txt_color">#2D3E5F</color>
<color name="bus_p_panel_cur_station_txt_color">#0043FF</color>
<color name="bus_p_panel_cur_station_tips_color">#2D3E5F</color>
<color name="bus_p_panel_cur_station_panel_color">#E6E9EFFC</color>
<color name="bus_p_route_view_left_edge_shadow">#33394C63</color>
<color name="bus_p_traffic_txt_color">#2D3E5F</color>
<color name="bus_p_panel_edge_shadow">#33394C63</color>
</resources>

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="bus_p_route_info_panel_width">700dp</dimen>
<dimen name="bus_p_auto_icon_margin_top">40dp</dimen>
<dimen name="bus_p_route_info_margin_right">40dp</dimen>
<dimen name="bus_p_route_info_margin_left">40dp</dimen>
<dimen name="bus_p_route_info_margin_bottom">40dp</dimen>
<dimen name="bus_p_route_info_margin_top">110dp</dimen>
<dimen name="bus_p_route_line_info_height">224dp</dimen>
<dimen name="bus_p_route_line_map_view_height">510dp</dimen>
<dimen name="bus_p_route_line_dividing_view_height">3dp</dimen>
<dimen name="bus_p_route_traffic_light_view_width">158dp</dimen>
<dimen name="bus_p_route_traffic_light_view_height">90dp</dimen>
<dimen name="bus_p_route_traffic_light_view_corner">45dp</dimen>
<dimen name="bus_p_traffic_light_bg_width">158dp</dimen>
<dimen name="bus_p_traffic_light_bg_height">90dp</dimen>
<dimen name="bus_p_traffic_light_time_size">45dp</dimen>
<dimen name="bus_p_traffic_light_time_view_width">90dp</dimen>
<dimen name="bus_p_traffic_light_icon_size">90dp</dimen>
<dimen name="bus_p_traffic_light_bg_stroke_width">3dp</dimen>
<dimen name="bus_p_route_dividing_line2_margin_top">224dp</dimen>
<dimen name="bus_p_driver_number_plate_margin_top">50dp</dimen>
<dimen name="bus_p_driver_number_plate_margin_bottom">50dp</dimen>
<dimen name="bus_p_driver_number_plate_size">44dp</dimen>
<dimen name="bus_p_line_operation_time_margin_top">130dp</dimen>
<dimen name="bus_p_line_operation_time_size">38dp</dimen>
<dimen name="bus_p_no_data_size">36dp</dimen>
<dimen name="bus_p_speed_txt_size">110dp</dimen>
<dimen name="bus_p_speed_unit_txt_size">42dp</dimen>
<dimen name="bus_p_station_circle_borner_size">4dp</dimen>
<dimen name="bus_p_station_circle_radius_size">10dp</dimen>
<dimen name="bus_p_station_circle_width_height">20dp</dimen>
<dimen name="bus_p_station_tag_width_height">60dp</dimen>
<dimen name="bus_p_station_tag_radius_size">30dp</dimen>
<dimen name="bus_p_cur_station_circle_width">20dp</dimen>
<dimen name="bus_p_cur_station_circle_height">50dp</dimen>
<dimen name="bus_p_mid_station_circle_cor">6dp</dimen>
<dimen name="bus_p_station_txt_size">50dp</dimen>
<dimen name="bus_p_station_tag_txt_size">36dp</dimen>
<dimen name="bus_p_station_item_height">80dp</dimen>
<dimen name="bus_p_station_item_middle_height">100dp</dimen>
<dimen name="bus_p_station_tag_line_height">80dp</dimen>
<dimen name="bus_p_station_tag_line_height1">60dp</dimen>
<dimen name="bus_p_station_tag_line_width">6dp</dimen>
<dimen name="bus_p_curent_station_panel_width">685dp</dimen>
<dimen name="bus_p_curent_station_panel_height">309dp</dimen>
<dimen name="bus_p_curent_station_panel_margin">50dp</dimen>
<dimen name="bus_p_curent_station_panel_margin_left">10dp</dimen>
<dimen name="bus_p_curent_station_txt_size">44dp</dimen>
<dimen name="bus_p_curent_station_txt_size1">55dp</dimen>
<dimen name="bus_p_curent_station_tip_size1">40dp</dimen>
<dimen name="bus_p_curent_station_txt_width">584dp</dimen>
<dimen name="bus_p_station_txt_width">550dp</dimen>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="bus_p_speed_unit_txt">KM/H</string>
<string name="bus_p_no_out">您已收车</string>
<string name="bus_p_no_task">暂无班次</string>
<string name="bus_p_start_station_txt_tag"></string>
<string name="bus_p_end_station_txt_tag"></string>
<string name="bus_p_cur_station_title">到达站:</string>
<string name="bus_p_cur_next_station_title">下一站:</string>
<string name="bus_p_cur_station_title_init">始发站:</string>
<string name="bus_p_cur_station_arrived_tip">请携带好随身物品下车。</string>
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>
</resources>