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 2a672ce3b3..f4b65292b4 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 @@ -73,8 +73,8 @@ public abstract class BaseBusTabFragment private FrameLayout flStationPanelContainer; private Group groupTestPanel; private FrameLayout flSpeed; - private BusArcView mouduleArc; - private TrafficDataView dataView; +// private BusArcView mouduleArc; + private TrafficDataView mouduleArc; 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 = (BusArcView) findViewById(R.id.bus_arc); + mouduleArc = (TrafficDataView) findViewById(R.id.bus_arc); panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer); slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener); @@ -480,11 +480,11 @@ public abstract class BaseBusTabFragment */ public void updateSpeedView(float newSpeed) { int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 -// dataView.showWithSpeedValue(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); +// 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); } @Override 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 6cd385a177..87e3d95737 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 @@ -17,16 +17,16 @@ app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent"> - - + - - + + + diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java index f82b4e3db7..4e4f7402fc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java @@ -218,7 +218,7 @@ public class SteeringWheelView extends ConstraintLayout { ThreadUtils.runOnUiThread(new Runnable() { @Override public void run() { - Log.d(TAG, "档位" + gear.toString()); + Log.d(TAG, "乘客屏档位" + gear.toString()); if (tapPositionView != null) { tapPositionView.updateWithGear(gear); } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TapPositionView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TapPositionView.java index 26f625e0d4..d5560f4139 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TapPositionView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TapPositionView.java @@ -32,160 +32,56 @@ public class TapPositionView extends ConstraintLayout { private TextView tabN; private TextView tabD; private TypedArray typedArray; + public TapPositionView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); - Log.d(TAG, "2"); LayoutInflater.from(context).inflate(R.layout.hmi_tap_position, this); tabP = findViewById(R.id.tap_p); tabR = findViewById(R.id.tap_r); tabN = findViewById(R.id.tap_n); tabD = findViewById(R.id.tap_d); - typedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView); - + typedArray = context.obtainStyledAttributes(attrs, R.styleable.TapPositionView); } public void updateWithGear(@NotNull Chassis.GearPosition gear) { if (tabP != null && tabR != null && tabN != null && tabD != null) { - if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { - taxiGear(gear); - } else { - busGear(gear); + int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1); + int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1); + Log.d(TAG, "gear:" + gear); + switch (gear) { + case GEAR_NONE: + tabP.setTextColor(defaultColor); + tabR.setTextColor(defaultColor); + tabN.setTextColor(defaultColor); + tabD.setTextColor(defaultColor); + break; + case GEAR_P: + tabP.setTextColor(selectColor); + tabR.setTextColor(defaultColor); + tabN.setTextColor(defaultColor); + tabD.setTextColor(defaultColor); + break; + case GEAR_R: + tabR.setTextColor(selectColor); + tabP.setTextColor(defaultColor); + tabN.setTextColor(defaultColor); + tabD.setTextColor(defaultColor); + break; + case GEAR_N: + tabN.setTextColor(selectColor); + tabR.setTextColor(defaultColor); + tabP.setTextColor(defaultColor); + tabD.setTextColor(defaultColor); + break; + case GEAR_D: + tabD.setTextColor(selectColor); + tabN.setTextColor(defaultColor); + tabR.setTextColor(defaultColor); + tabP.setTextColor(defaultColor); + break; + default: + break; } } } - - private void busGear(@NotNull Chassis.GearPosition gear) { - switch (gear) { - case GEAR_NONE: - tabP.setTextColor(Color.parseColor("#6E8EC9")); - tabR.setTextColor(Color.parseColor("#6E8EC9")); - tabN.setTextColor(Color.parseColor("#6E8EC9")); - tabD.setTextColor(Color.parseColor("#6E8EC9")); - break; - case GEAR_P: - tabP.setTextColor(Color.parseColor("#0043FF")); - tabR.setTextColor(Color.parseColor("#6E8EC9")); - tabN.setTextColor(Color.parseColor("#6E8EC9")); - tabD.setTextColor(Color.parseColor("#6E8EC9")); - break; - case GEAR_R: - tabR.setTextColor(Color.parseColor("#0043FF")); - tabP.setTextColor(Color.parseColor("#6E8EC9")); - tabN.setTextColor(Color.parseColor("#6E8EC9")); - tabD.setTextColor(Color.parseColor("#6E8EC9")); - break; - case GEAR_N: - tabN.setTextColor(Color.parseColor("#0043FF")); - tabR.setTextColor(Color.parseColor("#6E8EC9")); - tabP.setTextColor(Color.parseColor("#6E8EC9")); - tabD.setTextColor(Color.parseColor("#6E8EC9")); - break; - case GEAR_D: - tabD.setTextColor(Color.parseColor("#0043FF")); - tabN.setTextColor(Color.parseColor("#6E8EC9")); - tabR.setTextColor(Color.parseColor("#6E8EC9")); - tabP.setTextColor(Color.parseColor("#6E8EC9")); - break; - default: - break; - } - } - - - private void taxiGear(@NotNull Chassis.GearPosition gear) { - switch (gear) { - case GEAR_NONE: - tabP.setTextColor(Color.parseColor("#FF6E8EC9")); - tabR.setTextColor(Color.parseColor("#FF6E8EC9")); - tabN.setTextColor(Color.parseColor("#FF6E8EC9")); - tabD.setTextColor(Color.parseColor("#FF6E8EC9")); - break; - case GEAR_P: - tabP.setTextColor(Color.parseColor("#FFFFFFFF")); - tabR.setTextColor(Color.parseColor("#FF6E8EC9")); - tabN.setTextColor(Color.parseColor("#FF6E8EC9")); - tabD.setTextColor(Color.parseColor("#FF6E8EC9")); - break; - case GEAR_R: - tabR.setTextColor(Color.parseColor("#FFFFFFFF")); - tabP.setTextColor(Color.parseColor("#FF6E8EC9")); - tabN.setTextColor(Color.parseColor("#FF6E8EC9")); - tabD.setTextColor(Color.parseColor("#FF6E8EC9")); - break; - case GEAR_N: - tabN.setTextColor(Color.parseColor("#FFFFFFFF")); - tabR.setTextColor(Color.parseColor("#FF6E8EC9")); - tabP.setTextColor(Color.parseColor("#FF6E8EC9")); - tabD.setTextColor(Color.parseColor("#FF6E8EC9")); - break; - case GEAR_D: - tabD.setTextColor(Color.parseColor("#FFFFFFFF")); - tabN.setTextColor(Color.parseColor("#FF6E8EC9")); - tabR.setTextColor(Color.parseColor("#FF6E8EC9")); - tabP.setTextColor(Color.parseColor("#FF6E8EC9")); - break; - default: - break; - } - } - - /** - * 司机屏档位信息 - */ - public void updateWithGearForDriverPanel(@NotNull Chassis.GearPosition gear) { - if (tabP != null && tabR != null && tabN != null && tabD != null) { - if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { - busDriverPanel(gear); - } else { - busDriverPanel(gear); - } - } - } - - private void busDriverPanel(@NotNull Chassis.GearPosition gear) { - Log.d(TAG, "gear" + gear.toString()); - tabP.setTextSize(36f); - tabR.setTextSize(36f); - tabN.setTextSize(36f); - tabD.setTextSize(36f); - int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1); - int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1); - - switch (gear) { - case GEAR_NONE: - tabP.setTextColor(Color.parseColor("#FFF")); - tabR.setTextColor(Color.parseColor("#FFF")); - tabN.setTextColor(Color.parseColor("#FFF")); - tabD.setTextColor(Color.parseColor("#FFF")); - break; - case GEAR_P: - tabP.setTextColor(Color.parseColor("#343c63")); - tabR.setTextColor(Color.parseColor("#FFF")); - tabN.setTextColor(Color.parseColor("#FFF")); - tabD.setTextColor(Color.parseColor("#FFF")); - break; - case GEAR_R: - tabR.setTextColor(Color.parseColor("#343c63")); - tabP.setTextColor(Color.parseColor("#FFF")); - tabN.setTextColor(Color.parseColor("#FFF")); - tabD.setTextColor(Color.parseColor("#FFF")); - break; - case GEAR_N: - tabN.setTextColor(Color.parseColor("#343c63")); - tabR.setTextColor(Color.parseColor("#FFF")); - tabP.setTextColor(Color.parseColor("#FFF")); - tabD.setTextColor(Color.parseColor("#FFF")); - break; - case GEAR_D: - tabD.setTextColor(selectColor); - tabN.setTextColor(defaultColor); - tabR.setTextColor(defaultColor); - tabP.setTextColor(defaultColor); - break; - default: - break; - } - } - - } 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 5e68d0b30b..f63f0f3a3b 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 @@ -5,6 +5,8 @@ import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -29,6 +31,9 @@ import chassis.Chassis; public class TrafficDataView extends ConstraintLayout { private static final String TAG = "TrafficDataView"; private TapPositionView tapPositionView; + private TextView speedTextView; + private TextView accTextView; + private ImageView speedImage; //圆弧颜色 private int mArcColor; @@ -52,15 +57,17 @@ public class TrafficDataView extends ConstraintLayout { private void initView(@NonNull Context context) { if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { - LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this); +// LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this); } else { } LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this); tapPositionView = findViewById(R.id.traffic_position); + speedImage = findViewById(R.id.speedImage); + speedTextView = findViewById(R.id.speedTextView); + accTextView = findViewById(R.id.speedAccTextView); } private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() { - /** * 车辆转向灯 * @param lightSwitch @@ -110,7 +117,7 @@ public class TrafficDataView extends ConstraintLayout { public void run() { Log.d(TAG, "司机屏档位" + gear.toString()); if (tapPositionView != null) { - tapPositionView.updateWithGearForDriverPanel(gear); + tapPositionView.updateWithGear(gear); } } }); @@ -144,8 +151,9 @@ public class TrafficDataView extends ConstraintLayout { /** * 车速过快 */ - public void showWithSpeedValue(int newSpeed){ - + public void showWithSpeedValue(int newSpeed) { + speedTextView.setText(newSpeed); + 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/drawable-xhdpi-2560x1440/traffic_data_speed_warning.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_speed_warning.png new file mode 100644 index 0000000000..487b0fde2a Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_speed_warning.png differ 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 3ca69fddfc..08ae8a038d 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,6 +87,8 @@ 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:selectColor="@color/bus_p_select_txt_color" app:layout_constraintBottom_toBottomOf="parent" 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_steering_wheel_taxi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_steering_wheel_taxi.xml index 9fe0f33c09..84eda5f572 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,6 +88,8 @@ 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:selectColor="@color/dark_mode_select_txt_color" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/steering_circular_alpha" /> 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 5ed8d38be7..9d1d739a87 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="#6E8EC9" + 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="#6E8EC9" + 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="#6E8EC9" + 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="#0043FF" + 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/layout/hmi_traffic_data.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_traffic_data.xml index 7ab9138996..f1d4760c56 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_traffic_data.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_traffic_data.xml @@ -46,8 +46,8 @@ #E63B4577 #555C7E #3B4577 - #FF343C63 + #FF343C63 \ No newline at end of file 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 0987758510..7c78ee5f7e 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 @@ -60,5 +60,10 @@ #D945D3FF #D93261B6 #00FFFFFF - #FF343C63 + #FF343C63 + #0043FF + #6E8EC9 + #FF6E8EC9 + #FFFFFFFF + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index f271a51d52..74e949014f 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -282,7 +282,7 @@ public class AMapCustomView //导航全程光柱 options.setTrafficBarEnabled(false); //指南针 - options.setCompassEnabled(false); +// options.setCompassEnabled(false); options.setTilt((int) tilt); //自车车标 options.setCarBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.module_small_map_view_my_location_logo)); @@ -295,7 +295,10 @@ public class AMapCustomView //路线纹理自定义 RouteOverlayOptions routeOverlayOptions = new RouteOverlayOptions(); routeOverlayOptions.setTurnArrowIs3D(false); + routeOverlayOptions.setUnknownTraffic(BitmapFactory.decodeResource(getResources(),R.drawable.custtexture_no));//未知路段 routeOverlayOptions.setSmoothTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.amap_custom_smooth_route)); + routeOverlayOptions.setJamTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_bad));//拥堵路段 + routeOverlayOptions.setVeryJamTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_grayred));//超级拥堵路段 routeOverlayOptions.setPassRoute(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_slow));//走过的路段 options.setRouteOverlayOptions(routeOverlayOptions); mAMapNaviView.setViewOptions(options); diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi-2560x1440/custtexture_no.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi-2560x1440/custtexture_no.png new file mode 100644 index 0000000000..40521d0788 Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi-2560x1440/custtexture_no.png differ