[M2] 处理偶现结束订单乘客屏不更新问题

This commit is contained in:
wangmingjun
2023-03-03 14:41:28 +08:00
parent 3769f191c0
commit 8d0d82459f
2 changed files with 34 additions and 9 deletions

View File

@@ -290,18 +290,21 @@ class PM2DrivingModel private constructor() {
PM2ServiceManager.queryDriverSiteByCoordinate(it,
object : OchCommonServiceCallback<PM2RoutesResponse>{
override fun onSuccess(data: PM2RoutesResponse?) {
if (data == null || data.result == null
||data.result.equals(routesResult)) return
if (data.result.sites == null) {
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate ===== 没有路线")
routesResult = null
mNextStationIndex = 0
isGoingToNextStation = false
startOrStopCalculateRouteInfo(false)
mDrivingInfoCallback?.showNoTaskView(true)
if (data == null || data.result == null){
if (routesResult != null) {
routesResult == null
updateLocalOrder()
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate= result is null")
return
}
return
}
if (data.result != null && data.result.equals(routesResult)){
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate= not update")
return
}
routesResult = data.result
updatePassengerRouteInfo(data.result)
}
@@ -321,6 +324,14 @@ class PM2DrivingModel private constructor() {
}
}
private fun updateLocalOrder(){
routesResult = null
mNextStationIndex = 0
isGoingToNextStation = false
startOrStopCalculateRouteInfo(false)
mDrivingInfoCallback?.showNoTaskView(true)
}
private fun updatePassengerRouteInfo(result: PM2RoutesResult) {
mDrivingInfoCallback?.updateLine(result.name, result.runningDur)
if (result.sites != null) {

View File

@@ -2,6 +2,7 @@ package com.mogo.och.common.module.wigets;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.ViewDebug;
import android.widget.TextView;
@@ -50,6 +51,19 @@ public class MarqueeTextView extends androidx.appcompat.widget.AppCompatTextView
return true;
}
@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
if (focused)
super.onFocusChanged(true, direction, previouslyFocusedRect);
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
if (hasWindowFocus){}
super.onWindowFocusChanged(true);
}
@Override
@ViewDebug.ExportedProperty
public boolean isSelected() {