From fd7be505980e964dc568be8c1fd5a5a94b2ae256 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 29 Jun 2022 11:28:38 +0800 Subject: [PATCH] =?UTF-8?q?bus=E9=80=9F=E5=BA=A6=E8=A1=A8=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=9B=B4=E6=96=B0,=E5=86=85=E5=AE=B9=E5=91=88?= =?UTF-8?q?=E7=8E=B0=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/bus/fragment/BaseBusTabFragment.java | 16 +++++++--------- .../function/hmi/ui/widget/TrafficDataView.java | 12 ++++++++---- .../main/res/layout/hmi_steering_wheel_bus.xml | 2 +- .../main/res/layout/hmi_steering_wheel_taxi.xml | 2 +- .../src/main/res/layout/hmi_tap_position.xml | 8 ++++---- .../src/main/res/values/color.xml | 3 +-- 6 files changed, 22 insertions(+), 21 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 f4b65292b4..23f6ac1d5b 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 @@ -74,7 +74,7 @@ public abstract class BaseBusTabFragment private Group groupTestPanel; private FrameLayout flSpeed; // private BusArcView mouduleArc; - private TrafficDataView mouduleArc; + private TrafficDataView mTrafficDataView; private ImageView mUpgradeTipIv; // private BusTrafficLightView mTrafficLightView; @@ -120,7 +120,7 @@ public abstract class BaseBusTabFragment tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status); flSpeed = (FrameLayout) findViewById(R.id.fl_speed); - mouduleArc = (TrafficDataView) findViewById(R.id.bus_arc); + mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc); panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer); slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener); @@ -148,8 +148,8 @@ public abstract class BaseBusTabFragment }); if (DebugConfig.isDebug()) { - mouduleArc.setLongClickable(true); - mouduleArc.setOnLongClickListener(v -> { + mTrafficDataView.setLongClickable(true); + mTrafficDataView.setOnLongClickListener(v -> { CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏"); Intent intent = new Intent(); intent.putExtra("oper", 52); @@ -480,11 +480,9 @@ public abstract class BaseBusTabFragment */ public void updateSpeedView(float newSpeed) { int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 - mouduleArc.showWithSpeedValue(speed); - -// mouduleArc.setArcColor(Color.parseColor(speed > 60 ? "#DB3137" : "#3E77F6")); -// mouduleArc.setValues(speed); -// flSpeed.setBackgroundResource(speed > 60 ? R.drawable.bus_yi_biao_pan_bg_speeding : R.drawable.bus_yi_biao_pan_bg_nor); + if (mTrafficDataView != null){ + mTrafficDataView.updateSpeedWithValue(speed); + } } @Override diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java index 4da68513b4..ad416c2dab 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java @@ -165,11 +165,15 @@ public class TrafficDataView extends ConstraintLayout { } /** - * 车速过快 + * value呈现 */ - public void showWithSpeedValue(int newSpeed) { - speedTextView.setText(newSpeed); - speedImage.setBackgroundResource(newSpeed > 60 ? R.drawable.traffic_data_speed_warning : R.drawable.traffic_data_speed); + public void updateSpeedWithValue(int newSpeed) { + if (speedTextView != null) { + speedTextView.setText(String.valueOf(newSpeed)); + } + if (speedImage != null) { + speedImage.setBackgroundResource(newSpeed > 60 ? R.drawable.traffic_data_speed_warning : R.drawable.traffic_data_speed); + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_bus.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_bus.xml index 08ae8a038d..f8a7f886e3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_bus.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_bus.xml @@ -87,7 +87,7 @@ android:layout_width="@dimen/dp_390" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dp_42" - app:defaultColor = "@color/bus_p_default_txt_color" + app:defaultColor = "@color/p_default_txt_color" app:selectColor="@color/bus_p_select_txt_color" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_taxi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_taxi.xml index 84eda5f572..d56408fae1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_taxi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_taxi.xml @@ -88,7 +88,7 @@ android:layout_width="@dimen/dp_272" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_30" - app:defaultColor="@color/taxi_p_default_txt_color" + app:defaultColor="@color/p_default_txt_color" app:selectColor="@color/dark_mode_select_txt_color" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_tap_position.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_tap_position.xml index 9d1d739a87..263bee811c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_tap_position.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_tap_position.xml @@ -12,7 +12,7 @@ android:gravity="center" android:text="P" android:textAlignment="center" - + android:textColor="@color/p_default_txt_color" android:textSize="@dimen/dp_46" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="parent" @@ -27,7 +27,7 @@ android:gravity="center" android:text="R" android:textAlignment="center" - + android:textColor="@color/p_default_txt_color" android:textSize="@dimen/dp_46" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="parent" @@ -42,7 +42,7 @@ android:gravity="center" android:text="N" android:textAlignment="center" - + android:textColor="@color/p_default_txt_color" android:textSize="@dimen/dp_46" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="parent" @@ -57,7 +57,7 @@ android:gravity="center" android:text="D" android:textAlignment="center" - + android:textColor="@color/p_default_txt_color" android:textSize="@dimen/dp_46" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="parent" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml index 7c78ee5f7e..4cd3c89abf 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml @@ -62,8 +62,7 @@ #00FFFFFF #FF343C63 #0043FF - #6E8EC9 - #FF6E8EC9 + #FF6E8EC9 #FFFFFFFF \ No newline at end of file