From 04cc428f3e8027d72cae671a58522b10f67dd8cf Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Mon, 9 Oct 2023 14:48:07 +0800 Subject: [PATCH] =?UTF-8?q?[6.1.0]=20=E9=AB=98=E5=BE=B7=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E4=B8=BB=E7=BA=BF=E7=A8=8B=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/TaxiBeingServerdOrdersFragment.java | 19 +++++++++----- .../taxi/ui/task/TaxiCurrentTaskFragment.kt | 26 ++++++++++--------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/TaxiBeingServerdOrdersFragment.java b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/TaxiBeingServerdOrdersFragment.java index 7dae3b8fa4..36c6e5f812 100644 --- a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/TaxiBeingServerdOrdersFragment.java +++ b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/TaxiBeingServerdOrdersFragment.java @@ -343,15 +343,20 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment } private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) { - AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); - double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude(); - double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude(); + double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude(); + double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude(); - CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude); - NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude); - NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng); - AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng); + CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude); + NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude); + NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng); + AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng); + } + }); AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay); AmapNaviToDestinationModel.getInstance(getContext()).setTaxiNaviChangedCallback(this); } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt index 1f7b1cf37a..72a2601d09 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt @@ -594,18 +594,20 @@ class TaxiCurrentTaskFragment : BaseFragment(), } private fun startNaviToStation(isVoicePlay: Boolean, stationLat: Double, stationLng: Double) { - AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi() - val mCurLatitude = getChassisLocationGCJ02().latitude - val mCurLongitude = getChassisLocationGCJ02().longitude - d( - TAG, - "currentLatLng=$mCurLatitude $mCurLongitude" - ) - val startNaviLatLng = NaviLatLng(mCurLatitude, mCurLongitude) - val endNaviLatLng = NaviLatLng(stationLat, stationLng) - AmapNaviToDestinationModel.getInstance(context).initAMapNavi(startNaviLatLng, endNaviLatLng) - AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(isVoicePlay) - AmapNaviToDestinationModel.getInstance(context).setTaxiNaviChangedCallback(this) + UiThreadHandler.post{ + AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi() + val mCurLatitude = getChassisLocationGCJ02().latitude + val mCurLongitude = getChassisLocationGCJ02().longitude + d( + TAG, + "currentLatLng=$mCurLatitude $mCurLongitude" + ) + val startNaviLatLng = NaviLatLng(mCurLatitude, mCurLongitude) + val endNaviLatLng = NaviLatLng(stationLat, stationLng) + AmapNaviToDestinationModel.getInstance(context).initAMapNavi(startNaviLatLng, endNaviLatLng) + AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(isVoicePlay) + AmapNaviToDestinationModel.getInstance(context).setTaxiNaviChangedCallback(this) + } } /**