[M2] 增加乘客屏M2
This commit is contained in:
@@ -51,6 +51,12 @@ android {
|
||||
buildConfigField 'int', 'NEW_TEST', '1'
|
||||
}
|
||||
|
||||
// bus 乘客屏M2
|
||||
m2 {
|
||||
dimension "product"
|
||||
buildConfigField 'int', 'NEW_TEST', '1'
|
||||
}
|
||||
|
||||
// 接驳车
|
||||
shuttle {
|
||||
dimension "product"
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.mogo.och.bus.passenger
|
||||
|
||||
import android.content.Context
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.stepInDayMode
|
||||
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
|
||||
|
||||
/**
|
||||
* 网约车-Bus-乘客端
|
||||
*
|
||||
* Created on 2022/3/29
|
||||
*/
|
||||
@Route(path = BusPassengerConst.PATH)
|
||||
class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
|
||||
private var mActivity: FragmentActivity? = null
|
||||
private var mContainerId = 0
|
||||
private var mPassengerFragment: BusPassengerRouteFragment? = null
|
||||
override fun createCoverage(activity: FragmentActivity, containerId: Int) {}
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
mActivity = activity
|
||||
mContainerId = containerId!!
|
||||
return null
|
||||
}
|
||||
|
||||
override val functionName: String
|
||||
get() = "och-bus-passenger-m1"
|
||||
|
||||
override fun onDestroy() {
|
||||
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
mActivity?.finish()
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
MogoStatusManager.getInstance()
|
||||
.registerStatusChangedListener("OchBus", StatusDescriptor.VR_MODE, this)
|
||||
}
|
||||
|
||||
override fun onStatusChanged(descriptor: StatusDescriptor, isTrue: Boolean) {
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
showFragment()
|
||||
} else {
|
||||
hideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private fun stepIntoVrMode() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "进入vr模式")
|
||||
getMapUIController()?.stepInVrMode(true) // 白天模式
|
||||
stepInDayMode() //白天模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private fun showFragment() {
|
||||
if (mPassengerFragment == null) {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "准备add fragment======")
|
||||
mPassengerFragment = BusPassengerRouteFragment()
|
||||
mActivity!!.supportFragmentManager.beginTransaction()
|
||||
.add(mContainerId, mPassengerFragment!!).commitAllowingStateLoss()
|
||||
return
|
||||
}
|
||||
d(SceneConstant.M_TAXI_P + TAG, "准备show fragment")
|
||||
mActivity!!.supportFragmentManager.beginTransaction().show(mPassengerFragment!!)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
private fun hideFragment() {
|
||||
if (mPassengerFragment != null) {
|
||||
mActivity!!.supportFragmentManager.beginTransaction().hide(mPassengerFragment!!)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = MogoOCHBusPassenger::class.java.simpleName
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
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)
|
||||
@@ -0,0 +1,40 @@
|
||||
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
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/4/12
|
||||
*/
|
||||
class BusPassengerRouteFragment :
|
||||
MvpFragment<BusPassengerRouteFragment?, BusPassengerPresenter?>() {
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
* @param status 2 - running 1 - enable 2 - disable
|
||||
*/
|
||||
private val mPrevAPStatus = -1
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.bus_p_fragment
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
//隐藏小地图
|
||||
hidePanel()
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerPresenter {
|
||||
return BusPassengerPresenter(this)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = BusPassengerRouteFragment::class.java.simpleName
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -248,6 +248,7 @@ android {
|
||||
apply from: "./productFlavors/fPadLenovoOchTaxi.gradle"
|
||||
apply from: "./productFlavors/fPadLenovoOchBusPassenger.gradle"
|
||||
apply from: "./productFlavors/fPadLenovoOchBusPassengerM1.gradle"
|
||||
apply from: "./productFlavors/fPadLenovoOchBusPassengerM2.gradle"
|
||||
apply from: "./productFlavors/fPadLenovoOchBusShuttlePassenger.gradle"
|
||||
apply from: "./productFlavors/fPadLenovoOchTaxiPassenger.gradle"
|
||||
apply from: "./productFlavors/fPadLenovoOchSweeper.gradle"
|
||||
@@ -293,6 +294,7 @@ android {
|
||||
}else if(names.contains("fPadLenovoOchBusPassenger")){
|
||||
}else if(names.contains("fMultiDisplayOchBus")){
|
||||
}else if(names.contains("fPadLenovoOchBusPassengerM1")){
|
||||
}else if(names.contains("fPadLenovoOchBusPassengerM2")){
|
||||
}else {
|
||||
setIgnore(true)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ project.dependencies {
|
||||
// Bus乘客端
|
||||
fPadLenovoOchBusPassengerImplementation(rootProject.ext.dependencies.mogoochbus)
|
||||
fPadLenovoOchBusPassengerM1Implementation(rootProject.ext.dependencies.mogoochbus)
|
||||
fPadLenovoOchBusPassengerM2Implementation(rootProject.ext.dependencies.mogoochbus)
|
||||
|
||||
// taxi司机端
|
||||
fPadLenovoOchTaxiImplementation(rootProject.ext.dependencies.mogoochtaxi)
|
||||
@@ -39,6 +40,7 @@ project.dependencies {
|
||||
// Bus乘客端
|
||||
fPadLenovoOchBusPassengerImplementation (project(':OCH:mogo-och-bus-passenger'))
|
||||
fPadLenovoOchBusPassengerM1Implementation (project(':OCH:mogo-och-bus-passenger'))
|
||||
fPadLenovoOchBusPassengerM2Implementation (project(':OCH:mogo-och-bus-passenger'))
|
||||
|
||||
// taxi司机端
|
||||
fPadLenovoOchTaxiImplementation (project(':OCH:mogo-och-taxi'))
|
||||
|
||||
37
app/productFlavors/fPadLenovoOchBusPassengerM2.gradle
Normal file
37
app/productFlavors/fPadLenovoOchBusPassengerM2.gradle
Normal file
@@ -0,0 +1,37 @@
|
||||
project.android.productFlavors {
|
||||
// 衡阳-联想Pad-网约车-小巴车-乘客端
|
||||
fPadLenovoOchBusPassengerM2 {
|
||||
externalNativeBuild {
|
||||
ndk {
|
||||
// 设置支持的SO库架构
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
|
||||
// 应用包名
|
||||
applicationId rootProject.ext.android.fLauncherApplicationId
|
||||
dimension "product"
|
||||
matchingFallbacks = ['m2']
|
||||
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
|
||||
//高德地图鉴权信息
|
||||
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue, CHANNEL_VALUE: "fPadLenovoOchBusPassenger",ACTIVITY_ROOT:true]
|
||||
|
||||
// 是否需要实时上报坐标
|
||||
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
|
||||
// GPS数据提供源: 0-Android系统,1-工控机,2-OBU
|
||||
buildConfigField 'int', 'GPS_PROVIDER', "1"
|
||||
|
||||
// 构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE', "\"Bus_Passenger_M2\""
|
||||
// 连接的工控机IP地址
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.103\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user