From 8d0d82459f145181becc5c40015c76a02e783f83 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Fri, 3 Mar 2023 14:41:28 +0800 Subject: [PATCH] =?UTF-8?q?[M2]=20=E5=A4=84=E7=90=86=E5=81=B6=E7=8E=B0?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E8=AE=A2=E5=8D=95=E4=B9=98=E5=AE=A2=E5=B1=8F?= =?UTF-8?q?=E4=B8=8D=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bus/passenger/model/PM2DrivingModel.kt | 29 +++++++++++++------ .../common/module/wigets/MarqueeTextView.java | 14 +++++++++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt index 51a719c2e1..be783c6187 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt @@ -290,18 +290,21 @@ class PM2DrivingModel private constructor() { PM2ServiceManager.queryDriverSiteByCoordinate(it, object : OchCommonServiceCallback{ 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) { diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java index bc1d6a489b..8b141d5ded 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java @@ -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() {