From bcfc108b499d1b7d0f192b1c5040a0ca411e847b Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Tue, 27 Sep 2022 19:49:58 +0800 Subject: [PATCH] =?UTF-8?q?[2.11.0/1.6.0]=201=E3=80=81bus=E5=8F=B8?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E7=82=B9=E5=87=BB=E5=BC=80=E5=90=AF=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=A9=BE=E9=A9=B6=E5=8E=BB=E9=99=A4=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=202=E3=80=81bus=E5=8F=B8=E6=9C=BA=E7=AB=AF=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=BC=98=E5=8C=96=203=E3=80=81taxi=E5=8F=B8?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E6=96=87=E5=AD=97=EF=BC=9A=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/fragment/BusFragment.java | 3 +- .../com/mogo/och/bus/model/BusOrderModel.java | 12 ++++--- .../mogo/och/bus/ui/BusStationCommonItem.kt | 32 +++++++++++-------- .../res/layout/bus_stations_common_item.xml | 7 ++-- .../src/main/res/values/strings.xml | 2 +- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index 1ecb1d6cbe..2c05ef5b73 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -241,7 +241,8 @@ public class BusFragment extends BaseBusTabFragment secondStationItem.setVisibility(View.VISIBLE); thirdStationItem.showOrHideStationArrowBg(false); - if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0){ + if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0 + || (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){ firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start)); }else { firstStationItem.setStationTag(""); diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java index c3025f3916..e76b271851 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java @@ -643,10 +643,10 @@ public class BusOrderModel { isArrivedStation = false; CallerLogger.INSTANCE.d( M_BUS + TAG, "自动驾驶开启开往下一站====" ); //需要更改当前站和下一站的状态 然后渲染 - leaveStationSuccess(isRestart); - queryBusRoutes(); startOrStopQueryPassengerWriteOff(false); + leaveStationSuccess(isRestart); leaveTTSTips(finalNextStationName); + queryBusRoutes(); } @Override public void onFail(String failMsg) { @@ -733,7 +733,9 @@ public class BusOrderModel { } } - if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED){ //默认是第一站到站查询 + if (backgroundCurrentStationIndex == 0 && + stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED + && !stationList.get(0).isLeaving()){ //默认是第一站到站查询 startOrStopQueryPassengerWriteOff(true); } @@ -782,7 +784,9 @@ public class BusOrderModel { */ public void restartAutopilot() { CallerLogger.INSTANCE.d( M_BUS + TAG, "重启自动驾驶===" + isGoingToNextStation ); - autoDriveToNextStation(true); + //只去启动自动驾驶,不再去上报离站 + startAutopilot(true); +// autoDriveToNextStation(true); } /** diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusStationCommonItem.kt b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusStationCommonItem.kt index 1d63fc9f5a..5f87a25d7a 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusStationCommonItem.kt +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusStationCommonItem.kt @@ -5,6 +5,8 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.widget.ImageView import android.widget.LinearLayout +import androidx.core.content.ContextCompat +import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.bus.R import com.mogo.och.common.module.utils.BlinkAnimationUtil import kotlinx.android.synthetic.main.bus_stations_common_item.view.* @@ -33,21 +35,25 @@ class BusStationCommonItem @JvmOverloads constructor( fun setStationPointBg(type: Int){ // 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站 - BlinkAnimationUtil.clearAnimation(busCircleIv) + UiThreadHandler.post(Runnable { + BlinkAnimationUtil.clearAnimation(busCircleIv) - when(type){ - 0 -> { - busCircleIv.setImageResource(R.drawable.icon_point_grey_bus) - - } - 1 -> { - busCircleIv.setImageResource(R.drawable.icon_point_green_bus) + when(type){ + 0 -> { + busCircleIv.setImageDrawable(null) + busCircleIv.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_point_grey_bus)) + } + 1 -> { + busCircleIv.setImageDrawable(null) + busCircleIv.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_point_green_bus)) BlinkAnimationUtil.setAnimation(busCircleIv) - } - 2 -> { - busCircleIv.setImageResource(R.drawable.icon_point_blue_bus) - } - } + } + 2 -> { + busCircleIv.setImageDrawable(null) + busCircleIv.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_point_blue_bus)) + } + } + }) } fun getCircleImageView() : ImageView{ diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_stations_common_item.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_stations_common_item.xml index 9d224448db..c7fe3c3432 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/bus_stations_common_item.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/bus_stations_common_item.xml @@ -3,6 +3,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto"> + + @@ -54,7 +56,6 @@ android:layout_height="wrap_content" android:textSize="@dimen/bus_station_tag_txt_size" android:textColor="@color/bus_station_tag_txt_un_color" - android:text="@string/bus_station_txt_tag_start" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="@+id/busCircleIv" app:layout_constraintBottom_toBottomOf="@+id/busCircleIv"/> diff --git a/OCH/mogo-och-taxi/src/main/res/values/strings.xml b/OCH/mogo-och-taxi/src/main/res/values/strings.xml index 891e3168a3..ba114d72bd 100644 --- a/OCH/mogo-och-taxi/src/main/res/values/strings.xml +++ b/OCH/mogo-och-taxi/src/main/res/values/strings.xml @@ -20,7 +20,7 @@ 确认 开始服务 自驾模式 - 人工模式 + 安全模式 跳过乘客验证 等待乘客开始行程 请等待乘客启动自动驾驶,或您自行启动