[debug抽取view]
This commit is contained in:
yangyakun
2023-08-14 17:47:27 +08:00
committed by zhongchao
parent 204369cb00
commit 8a04707ca4
8 changed files with 213 additions and 148 deletions

View File

@@ -1,3 +0,0 @@
package com.mogo.och.bus.passenger.bean.event
data class DebugView(val type: String)

View File

@@ -19,7 +19,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.network.utils.GsonUtil
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -187,7 +186,7 @@ object CharterPassengerModel {
// 3、车控页面、
// 4、打开选择线路页面
BizLoopManager.removeLoopFunction(TAGLOGIN)
CallerLogger.d(M_BUS_P + TAG, "结束登录状态轮询")
d(M_BUS_P + TAG, "结束登录状态轮询")
// 启动订单轮
startOrderLoop()
} else {
@@ -195,7 +194,7 @@ object CharterPassengerModel {
TAGLOGIN,
LoopInfo(3, ::queryLoginStatus)
)
CallerLogger.d(M_BUS_P + TAG, "启动登录状态轮询")
d(M_BUS_P + TAG, "启动登录状态轮询")
}
}
})
@@ -225,7 +224,7 @@ object CharterPassengerModel {
}
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
CallerLogger.d(M_BUS_P + TAG, "底盘给到站信息")
d(M_BUS_P + TAG, "底盘给到站信息")
arriveDest()
}
}
@@ -323,7 +322,7 @@ object CharterPassengerModel {
//监听网络变化,避免启动机器时无网导致无法更新订单信息
private val mNetWorkIntentListener = IMogoIntentListener { intentStr, intent ->
CallerLogger.d(M_BUS_P + TAG, "onIntentReceived = %s", intentStr)
d(M_BUS_P + TAG, "onIntentReceived = %s", intentStr)
if (ConnectivityManager.CONNECTIVITY_ACTION == intentStr) {
if (NetworkUtils.isConnected(mContext)) {
queryLoginStatus()
@@ -341,7 +340,7 @@ object CharterPassengerModel {
TAGORDER,
LoopInfo(3, ::queryOrder)
)
CallerLogger.d(M_BUS_P + TAG, "启动订单轮询")
d(M_BUS_P + TAG, "启动订单轮询")
}
/**
@@ -349,7 +348,7 @@ object CharterPassengerModel {
*/
private fun endOrderLoop() {
BizLoopManager.removeLoopFunction(TAGORDER)
CallerLogger.d(M_BUS_P + TAG, "结束订单轮询")
d(M_BUS_P + TAG, "结束订单轮询")
}
/**
@@ -359,7 +358,7 @@ object CharterPassengerModel {
BusPassengerServiceManager.queryOrderInfo(
mContext, object : OchCommonServiceCallback<OrderInfoResponse> {
override fun onSuccess(data: OrderInfoResponse?) {
CallerLogger.d(M_BUS_P + TAG, "订单信息:$data")
d(M_BUS_P + TAG, "订单信息:$data")
if (data?.data == null) {
if (orderInfo != null) {
// 启动车辆服务状态
@@ -386,7 +385,7 @@ object CharterPassengerModel {
//设置车模
if (this.orderInfo?.productType != orderData.productType) {
this.carTypeChageListener?.setCarChangeListener(orderData.productType)
CallerLogger.d(M_BUS_P + TAG, "设置车模")
d(M_BUS_P + TAG, "设置车模")
}
if (this.orderInfo?.siteId != orderData.siteId) {
val coordinateConverterWgsToGcj =
@@ -440,11 +439,11 @@ object CharterPassengerModel {
)
// 小于15m到站
if (calculateLineDistance < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE && calculateLineDistance > 0) {
CallerLogger.d(M_BUS_P + TAG, "小于15米到站1")
d(M_BUS_P + TAG, "小于15米到站1")
arriveDest()
}
if (calculateLineDistance < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && calculateLineDistance > 0) {
CallerLogger.d(M_BUS_P + TAG, "小于100米到站")
d(M_BUS_P + TAG, "小于100米到站")
arriveDestSoon()
}
}
@@ -490,7 +489,7 @@ object CharterPassengerModel {
*/
private fun startCarStatusLoop() {
BizLoopManager.setLoopFunction(TAGCARSTATUS, LoopInfo(3, ::queryCarStatus))
CallerLogger.d(M_BUS_P + TAG, "启动车态轮询")
d(M_BUS_P + TAG, "启动车态轮询")
}
/**
@@ -498,7 +497,7 @@ object CharterPassengerModel {
*/
private fun endCarStatusLoop() {
BizLoopManager.removeLoopFunction(TAGCARSTATUS)
CallerLogger.d(M_BUS_P + TAG, "结束车态轮询")
d(M_BUS_P + TAG, "结束车态轮询")
}
/**
@@ -552,7 +551,7 @@ object CharterPassengerModel {
TAGCALIBRATION,
LoopInfo(120, ::queryBusinessTime, immediately = true)
)
CallerLogger.d(M_BUS_P + TAG, "启动时间校准轮询")
d(M_BUS_P + TAG, "启动时间校准轮询")
}
/**
@@ -560,7 +559,7 @@ object CharterPassengerModel {
*/
private fun endCalibrationLoop() {
BizLoopManager.removeLoopFunction(TAGCALIBRATION)
CallerLogger.d(M_BUS_P + TAG, "结束时间校准轮询")
d(M_BUS_P + TAG, "结束时间校准轮询")
}
/**
@@ -597,7 +596,7 @@ object CharterPassengerModel {
.getString(R.string.m1_end_order_5min), 2
)
VoiceManager.surplus5min(VoiceFocusManager.getVoiceCmdCallBack())
CallerLogger.d(M_BUS_P + TAG, "倒计时5分钟${it.orderNo}")
d(M_BUS_P + TAG, "倒计时5分钟${it.orderNo}")
SharedPrefs.getInstance(mContext)
.putBoolean("${it.orderNo}$min5Speak", true)
}
@@ -615,7 +614,7 @@ object CharterPassengerModel {
} else {
invokeOrderLeftTimeListeners(millisUntilFinished)
}
CallerLogger.d(M_BUS_P + TAG, "订单倒计时${millisUntilFinished}")
d(M_BUS_P + TAG, "订单倒计时${millisUntilFinished}")
}
}
}
@@ -636,8 +635,8 @@ object CharterPassengerModel {
//设置全局轨迹信息
locusInfo = data.data
CallerLogger.d(M_BUS_P + TAG, "查询自动驾驶轨迹信息")
CallerLogger.d(
d(M_BUS_P + TAG, "查询自动驾驶轨迹信息")
d(
M_BUS_P + TAG, GsonUtil.jsonFromObject(
locusInfo
)
@@ -657,7 +656,7 @@ object CharterPassengerModel {
*/
private fun startCalculateDistanceLoop() {
BizLoopManager.setLoopFunction(TAGDISTANCE, LoopInfo(1, ::calculateDistance))
CallerLogger.d(M_BUS_P + TAG, "开始路距计算")
d(M_BUS_P + TAG, "开始路距计算")
}
/**
@@ -668,7 +667,7 @@ object CharterPassengerModel {
*/
private fun endCalculateDistanceLoop() {
BizLoopManager.removeLoopFunction(TAGDISTANCE)
CallerLogger.d(M_BUS_P + TAG, "结束路距计算")
d(M_BUS_P + TAG, "结束路距计算")
}
/**
@@ -678,17 +677,17 @@ object CharterPassengerModel {
//mLocation gcj坐标
mLocationGCJ02?.let {
orderInfo?.let { order ->
CallerLogger.d(M_BUS_P + "calculateDistance", "订单信息:$order")
d(M_BUS_P + "calculateDistance", "订单信息:$order")
if (order.siteId == null || order.siteId == 0L ||
order.wgs84Lat == null || order.wgs84Lat == 0.0 ||
order.wgs84Lon == null || order.wgs84Lon == 0.0
) {
CallerLogger.d(M_BUS_P + "calculateDistance", "站点信息未获得")
d(M_BUS_P + "calculateDistance", "站点信息未获得")
return
}
newCheckedSite?.let {
if (it.siteId != order.siteId) {
CallerLogger.d(M_BUS_P + "calculateDistance", "站点和已选不吻合")
d(M_BUS_P + "calculateDistance", "站点和已选不吻合")
return
}
}
@@ -710,11 +709,11 @@ object CharterPassengerModel {
mogoLocation.longitude,
mogoLocation.latitude
)
CallerLogger.d(M_BUS_P + "calculateDistance", "两点距离和站点的直线距离:${lastSumLength}")
d(M_BUS_P + "calculateDistance", "两点距离和站点的直线距离:${lastSumLength}")
if (lastSumLength > 100) {
if (mRoutePoints == null || mRoutePoints?.size == 0) {
//ToastCharterUtils.showLong("缺少轨迹数据暂停计算")
CallerLogger.d(
d(
M_BUS_P + "calculateDistance两点距离",
"缺少轨迹数据"
)
@@ -727,11 +726,11 @@ object CharterPassengerModel {
it,
mogoLocation
)
CallerLogger.d(
d(
M_BUS_P + TAG,
"使用轨迹轨迹:${mRoutePoints?.size}--第一个点${mRoutePoints!![0]}--最后一个点:${mRoutePoints!!.last()}"
)
CallerLogger.d(M_BUS_P + "calculateDistance", "轨迹计算的距离$templastSumLength")
d(M_BUS_P + "calculateDistance", "轨迹计算的距离$templastSumLength")
if (templastSumLength > 100) {
lastSumLength = templastSumLength
}
@@ -740,16 +739,16 @@ object CharterPassengerModel {
val lastTime: Double =
lastSumLength / CharterPassengerConst.Charter_AVERAGE_SPEED * 3.6 //秒
CallerLogger.d(
d(
M_BUS_P + "calculateDistance",
"最终信息:lastSumLength: ${lastSumLength}lastTime : $lastTime thread = ${Thread.currentThread().name}"
)
if (lastSumLength < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && lastSumLength > 0) {
CallerLogger.d(M_BUS_P + TAG, "小于100米到站2")
d(M_BUS_P + TAG, "小于100米到站2")
arriveDestSoon()
}
if (lastSumLength < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE && lastSumLength > 0) {
CallerLogger.d(M_BUS_P + TAG, "小于15米到站2")
d(M_BUS_P + TAG, "小于15米到站2")
arriveDest()
return
}
@@ -766,7 +765,7 @@ object CharterPassengerModel {
private fun setOrderStatus(orderStatus: OrderStatusEnum) {
if (this.orderStatus != orderStatus) {
CallerLogger.d(M_BUS_P + TAG, "${this.orderInfo?.orderNo}新的状态:$orderStatus")
d(M_BUS_P + TAG, "${this.orderInfo?.orderNo}新的状态:$orderStatus")
this.orderStatus = orderStatus
for (callback in orderStatusChangeListeners.values) {
callback.onStatusChange(this.orderStatus)
@@ -825,7 +824,7 @@ object CharterPassengerModel {
}
}
for (mutableEntry in distanceMap) {
CallerLogger.d(M_BUS_P + TAG, "距离:${mutableEntry.key}-----第几个站点${mutableEntry.value}")
d(M_BUS_P + TAG, "距离:${mutableEntry.key}-----第几个站点${mutableEntry.value}")
}
var middle = -1
if (distanceMap.size >= 2) {
@@ -905,7 +904,7 @@ object CharterPassengerModel {
if (order != null && lineId != null && siteId != null) {
val requestSuccessSign = "${siteId}$endKey"
val requestIngSign = "${siteId}$endKeyRequestIng"//正在请求中
CallerLogger.d(
d(
M_BUS_P + BaseDPMsg.TAG,
"requestSuccessSign${isSuccess(requestSuccessSign)}---requestIngSign${
isSuccess(
@@ -983,7 +982,7 @@ object CharterPassengerModel {
OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).toByteArray()
)
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "到站发送数据${msg}")
d(M_BUS_P + BaseDPMsg.TAG, "到站发送数据${msg}")
}
RxUtils.disposeSubscribe(switchLine5minWait)
@@ -1031,7 +1030,7 @@ object CharterPassengerModel {
fun cleanbroadcastListInfo(checkSite: SiteInfoResponse.SiteInfo?) {
RxUtils.disposeSubscribe(switchLine5minWait)
switchLine5minWait = RxUtils.createSubscribe(5 * 60 * 1000) {
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "5分钟倒计时可以选择线路了")
d(M_BUS_P + BaseDPMsg.TAG, "5分钟倒计时可以选择线路了")
}
newCheckedSite = checkSite
cleanRoutePoints()
@@ -1088,7 +1087,7 @@ object CharterPassengerModel {
val parameters = initAutopilotControlParameters()
if (null == parameters) {
ToastCharterUtils.showShort("请选择站点")
CallerLogger.e(
e(
SceneConstant.M_BUS + TAG,
"行程日志-AutopilotControlParameters is empty."
)
@@ -1097,7 +1096,7 @@ object CharterPassengerModel {
ToastCharterUtils.showShort("启动自动驾驶中")
cleanRoutePoints()
startAutoPilot(parameters)
CallerLogger.d(
d(
SceneConstant.M_BUS + TAG,
"行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
@@ -1110,7 +1109,7 @@ object CharterPassengerModel {
private fun initAutopilotControlParameters(): AutopilotControlParameters? {
if (!checkCurrentOCHOrder()) {
CallerLogger.e(M_BUS_P + TAG, "no order or order is empty.")
e(M_BUS_P + TAG, "no order or order is empty.")
return null
}
mLocationGCJ02?.let {

View File

@@ -10,19 +10,14 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.function.view.SiteMarkerBean
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.event.DebugView
import com.mogo.och.bus.passenger.bean.event.EventLineSites
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
import com.mogo.och.bus.passenger.callback.IClearViewCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
import com.mogo.och.bus.passenger.ui.bottom.BottomBar
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
@@ -30,7 +25,6 @@ import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
import com.mogo.och.bus.passenger.ui.dialogfragment.M1CarUserNoOrderFragment
import com.mogo.och.bus.passenger.ui.dialogfragment.M1ContainFragment
import com.mogo.och.bus.passenger.ui.dialogfragment.NoviceGuidanceFragment
import com.mogo.och.bus.passenger.ui.statusbar.StatusBarView
import kotlinx.android.synthetic.main.m1_main_fragment.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
@@ -45,7 +39,6 @@ class MainFragment :
MvpFragment<MainFragment?, BusPassengerPresenter?>() {
private var bpFunctionGroupDialogFragment: WeakReference<M1ContainFragment>? = null
private var debugViewWatchDogFragment: WeakReference<DebugViewWatchDogFragment>? = null
private var m1CarUserNoOrderFragment: WeakReference<M1CarUserNoOrderFragment>? = null
private var noviceGuidanceFragment: WeakReference<NoviceGuidanceFragment>? = null
@@ -126,35 +119,10 @@ class MainFragment :
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mapBizView.getUI().changeZoom2(0.8f)
}
}
debug_arrive_dest.setOnClickListener {
CharterPassengerModel.arriveDest()
}
debug_show_noviceGuidance.setOnClickListener {
showNoviceGuidanceFragment()
}
debug_change_modle.setOnClickListener {
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
when (HdMapBuildConfig.currentCarVrIconRes) {
R.raw.aiqinghao -> {
mPresenter?.setCarChangeListener(OrderInfoResponse.M1_FAMILY)
}
R.raw.jiatinghao -> {
mPresenter?.setCarChangeListener(OrderInfoResponse.M1_FRIENDLY)
}
R.raw.pengyouhao -> {
mPresenter?.setCarChangeListener(0)
}
else -> {
mPresenter?.setCarChangeListener(OrderInfoResponse.M1_LOVE)
}
}
}
debug_show_endview.setOnClickListener {
showOpenAndCloseDoor()
}
fun setCarMode(type: Int){
mPresenter?.setCarChangeListener(type)
}
private fun showBizView(orderinfo:Boolean=false,softControl:Boolean=false,selectLine:Boolean=false){
@@ -183,14 +151,6 @@ class MainFragment :
M1ContainFragment.openSettingPage(childFragmentManager,parentFragmentManager,bpFunctionGroup,tab)
}
private fun showDebugView() {
if (debugViewWatchDogFragment?.get() == null) {
debugViewWatchDogFragment = WeakReference(DebugViewWatchDogFragment.newInstance())
}
val debugViewFragment = debugViewWatchDogFragment?.get()
DebugViewWatchDogFragment.showDebugView(childFragmentManager,parentFragmentManager,debugViewFragment)
}
fun setCarModle(rawInfo: Int){
mapBizView.getUI().changeCurrentIcon(rawInfo)
HdMapBuildConfig.currentCarVrIconRes = rawInfo
@@ -291,28 +251,6 @@ class MainFragment :
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun changeDebugView(debugView: DebugView) {
when (debugView.type) {
StatusBarView.bizz -> {
if(group_debug.visibility==View.GONE||
group_debug.visibility==View.INVISIBLE){
group_debug.visibility = View.VISIBLE
}else{
group_debug.visibility = View.GONE
}
}
else -> {
if (ToggleDebugView.toggleDebugView.isShowIng()) {
ToggleDebugView.toggleDebugView.dismiss()
}else {
showDebugView()
}
}
}
}
fun drawOverMapViewStation(stationsList: MutableList<SiteMarkerBean>,siteMarkers: List<SiteMarkerBean>?){
omvOverMap?.clearSiteMarkers()
omvOverMap?.clearSiteNameViews()

View File

@@ -0,0 +1,3 @@
package com.mogo.och.bus.passenger.ui.debugview
data class DebugEvent(val type: String)

View File

@@ -0,0 +1,131 @@
package com.mogo.och.bus.passenger.ui.debugview
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.FragmentActivity
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.ui.debugview.DebugView
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.ui.MainFragment
import com.mogo.och.bus.passenger.ui.statusbar.StatusBarView
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
import kotlinx.android.synthetic.main.m1_p_debug.view.debug_arrive_dest
import kotlinx.android.synthetic.main.m1_p_debug.view.debug_change_modle
import kotlinx.android.synthetic.main.m1_p_debug.view.debug_show_endview
import kotlinx.android.synthetic.main.m1_p_debug.view.debug_show_noviceGuidance
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.lang.ref.WeakReference
class DebugView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
companion object {
const val TAG = "DebugView"
}
init {
LayoutInflater.from(context).inflate(R.layout.m1_p_debug, this, true)
visibility = GONE
}
private var fragment: MainFragment?=null
private var debugViewWatchDogFragment: WeakReference<DebugViewWatchDogFragment>? = null
override fun onAttachedToWindow() {
super.onAttachedToWindow()
EventBus.getDefault().register(this)
val activityByContext = ActivityUtils.getActivityByContext(context)
if(activityByContext is FragmentActivity){
val fragment = activityByContext.supportFragmentManager.findFragmentByTag(MainFragment.TAG)
if(fragment is MainFragment){
this.fragment = fragment
}
}
debug_arrive_dest.setOnClickListener {
CharterPassengerModel.arriveDest()
}
debug_show_noviceGuidance.setOnClickListener {
fragment?.showNoviceGuidanceFragment()
}
debug_change_modle.setOnClickListener {
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
when (HdMapBuildConfig.currentCarVrIconRes) {
R.raw.aiqinghao -> {
fragment?.setCarMode(OrderInfoResponse.M1_FAMILY)
}
R.raw.jiatinghao -> {
fragment?.setCarMode(OrderInfoResponse.M1_FRIENDLY)
}
R.raw.pengyouhao -> {
fragment?.setCarMode(0)
}
else -> {
fragment?.setCarMode(OrderInfoResponse.M1_LOVE)
}
}
}
debug_show_endview.setOnClickListener {
fragment?.showOpenAndCloseDoor()
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun changeOverview(debugEvent: DebugEvent) {
when (debugEvent.type) {
StatusBarView.bizz -> {
if(visibility== View.GONE||
visibility== View.INVISIBLE){
visibility = View.VISIBLE
}else{
visibility = View.GONE
}
}
else -> {
if (ToggleDebugView.toggleDebugView.isShowIng()) {
ToggleDebugView.toggleDebugView.dismiss()
}else {
showDebugView()
}
}
}
}
private fun showDebugView() {
if (debugViewWatchDogFragment?.get() == null) {
debugViewWatchDogFragment = WeakReference(DebugViewWatchDogFragment.newInstance())
}
val debugViewFragment = debugViewWatchDogFragment?.get()
fragment?.let {
DebugViewWatchDogFragment.showDebugView(it.childFragmentManager,it.parentFragmentManager,debugViewFragment)
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
EventBus.getDefault().unregister(this)
}
}

View File

@@ -23,7 +23,8 @@ import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.event.DebugView
import com.mogo.och.bus.passenger.ui.debugview.DebugEvent
import com.mogo.och.bus.passenger.ui.debugview.DebugView
import kotlinx.android.synthetic.main.m1_statusview_datetime.view.*
import me.jessyan.autosize.utils.AutoSizeUtils
import org.greenrobot.eventbus.EventBus
@@ -52,7 +53,7 @@ class StatusBarView @JvmOverloads constructor(
mHits[mHits.size - 1] = SystemClock.uptimeMillis()
if (mHits[0] >= (SystemClock.uptimeMillis() - DURATION)) {
mHits = LongArray(COUNTS) //重新初始化数组
EventBus.getDefault().post(DebugView(type))
EventBus.getDefault().post(DebugEvent(type))
}
}

View File

@@ -145,50 +145,12 @@
app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton"
app:layout_constraintTop_toBottomOf="@+id/viewBusPM1MsgBoxButton"/>
<TextView
android:text="到站"
android:id="@+id/debug_arrive_dest"
<com.mogo.och.bus.passenger.ui.debugview.DebugView
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_47"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="展示引导页面"
android:id="@+id/debug_show_noviceGuidance"
app:layout_constraintTop_toBottomOf="@+id/debug_arrive_dest"
android:layout_marginTop="@dimen/dp_17"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="切换模型"
android:id="@+id/debug_change_modle"
app:layout_constraintTop_toBottomOf="@+id/debug_show_noviceGuidance"
android:layout_marginTop="@dimen/dp_17"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="显示结束页面"
android:id="@+id/debug_show_endview"
app:layout_constraintTop_toBottomOf="@+id/debug_change_modle"
android:layout_marginTop="@dimen/dp_17"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.Group
android:id="@+id/group_debug"
app:constraint_referenced_ids="debug_arrive_dest,debug_show_noviceGuidance,debug_change_modle,debug_show_endview"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
tools:ignore="MissingDefaultResource">
<TextView
android:text="到站"
android:id="@+id/debug_arrive_dest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="展示引导页面"
android:id="@+id/debug_show_noviceGuidance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="切换模型"
android:id="@+id/debug_change_modle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="显示结束页面"
android:id="@+id/debug_show_endview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.appcompat.widget.LinearLayoutCompat>