From 87e6fdd5dbb6d49f22504d6ec04fc8286fcb33b5 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Thu, 18 Aug 2022 16:13:51 +0800 Subject: [PATCH] =?UTF-8?q?[2.10.0]bus=E5=8F=B8=E6=9C=BA=E7=AB=AF"?= =?UTF-8?q?=E8=BF=9B=E7=AB=99"UI=E5=92=8C=E5=B1=95=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/bus/fragment/BaseBusTabFragment.java | 20 ++++++++++++++++--- .../mogo/och/bus/fragment/BusFragment.java | 3 ++- .../mogo/och/bus/presenter/BusPresenter.java | 7 ++++--- .../src/main/res/layout/bus_base_fragment.xml | 2 ++ .../src/main/res/values/colors.xml | 1 + 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index 9a54140635..b728f06a6b 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -67,7 +67,7 @@ public abstract class BaseBusTabFragment private RelativeLayout ctvAutopilotStatus; private ImageView ctvAutopilotStatusIv; private TextView ctvAutopilotStatusTv; - private TextView tvArrived; + protected TextView tvArrived; protected TextView tvOperationStatus; protected RelativeLayout mSettingBtn; protected RelativeLayout mBadcaseBtn; @@ -292,18 +292,32 @@ public abstract class BaseBusTabFragment getActivity().runOnUiThread(() -> { slidePanelView.setText(text); slidePanelView.setVisibility(View.VISIBLE); - tvArrived.setClickable(false); }); + setArrivedClikable(false); } } + /** + * 设置进站按钮状态 + * @param isClickable + */ + public void setArrivedClikable(boolean isClickable){ + getActivity().runOnUiThread(() -> { + tvArrived.setClickable(isClickable); + if (isClickable){ + tvArrived.setTextColor(getResources().getColor(R.color.bus_white)); + }else { + tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color)); + } + }); + } + /** * 隐藏滑动按钮 */ public void hideSlidePanel() { getActivity().runOnUiThread(() -> { slidePanelView.setVisibility(View.GONE); - tvArrived.setClickable(true); }); } 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 4d6f097d3b..8decd3ba90 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 @@ -310,13 +310,14 @@ public class BusFragment extends BaseBusTabFragment // 出车的时候重制站点状态 mPresenter.queryBusRoutes(); tvOperationStatus.setText("收车"); + tvArrived.setVisibility(View.VISIBLE); showPanel(); } else { AIAssist.getInstance(getContext()).speakTTSVoice("已收车"); tvOperationStatus.setText("出车"); + tvArrived.setVisibility(View.GONE); hideSlidePanel(); hidPanel(); - //移除起点终点 if (null != startStation) { setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat() diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index 28a590956d..a7351b572f 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -148,6 +148,7 @@ public class BusPresenter extends Presenter public void hideSlidePanel() { if (mView != null) { runOnUIThread(() -> mView.hideSlidePanel()); + runOnUIThread(()-> mView.setArrivedClikable(true)); } } @@ -175,9 +176,9 @@ public class BusPresenter extends Presenter currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE; // 设置UI【自动驾驶】按钮是否展示 runOnUIThread(() -> mView.onAutopilotEnableChange(true)); - if (BusOrderModel.getInstance().isGoingToNextStation()) { - runOnUIThread(() -> mView.hideSlidePanel()); - } +// if (BusOrderModel.getInstance().isGoingToNextStation()) { +// runOnUIThread(() -> mView.hideSlidePanel()); +// } if (FunctionBuildConfig.isDemoMode && ( (mCurrentStation > 0 && mCurrentStation < mStationList.size() - 1) diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml index 1c385e0809..29f8777ef4 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml @@ -79,6 +79,8 @@ android:layout_width="@dimen/module_mogo_och_operation_status_bg_width" android:layout_height="@dimen/module_mogo_och_operation_status_bg_height" android:layout_marginLeft="@dimen/module_mogo_och_margin_left" + app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom" + app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left" android:background="@drawable/bus_switch_map_bg" android:elevation="@dimen/bus_dp_10" android:padding="@dimen/bus_dp_20" diff --git a/OCH/mogo-och-bus/src/main/res/values/colors.xml b/OCH/mogo-och-bus/src/main/res/values/colors.xml index 600e6c2c33..96338fac55 100644 --- a/OCH/mogo-och-bus/src/main/res/values/colors.xml +++ b/OCH/mogo-och-bus/src/main/res/values/colors.xml @@ -44,4 +44,5 @@ #FF006D43 #FFFFE198 #FFFF9B00 + #59FFFFFF \ No newline at end of file