diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperTrafficLightView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperTrafficLightView.java index 5f99d4836e..e2019626e6 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperTrafficLightView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperTrafficLightView.java @@ -4,6 +4,7 @@ import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.widget.ImageView; +import android.widget.TextView; import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; @@ -13,14 +14,14 @@ import com.mogo.och.common.module.wigets.OCHGradientTextView; import org.jetbrains.annotations.Nullable; /** - * Bus司机端:红绿灯view + * 清扫车:红绿灯view * * Created on 2022/3/29 */ public class SweeperTrafficLightView extends IViewTrafficLight { private ImageView mLightIconIV; - private OCHGradientTextView mLightTimeTV; + private TextView mLightTimeTV; private int mCurrentLightId; public SweeperTrafficLightView(@Nullable Context context) { @@ -98,9 +99,6 @@ public class SweeperTrafficLightView extends IViewTrafficLight { super.changeCountdownRed(redNum); UiThreadHandler.post(() -> { if (redNum > 0) { - mLightTimeTV.setVertrial(true); - mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.sweeper_traffic_light_red_color_up), - getResources().getColor(R.color.sweeper_traffic_light_red_color_down)}); mLightTimeTV.setText(String.valueOf(redNum)); } else { mLightTimeTV.setText(""); @@ -113,9 +111,6 @@ public class SweeperTrafficLightView extends IViewTrafficLight { super.changeCountdownGreen(greenNum); UiThreadHandler.post(() -> { if (greenNum > 0) { - mLightTimeTV.setVertrial(true); - mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.sweeper_traffic_light_green_color_up), - getResources().getColor(R.color.sweeper_traffic_light_green_color_down)}); mLightTimeTV.setText(String.valueOf(greenNum)); } else { mLightTimeTV.setText(""); @@ -128,9 +123,6 @@ public class SweeperTrafficLightView extends IViewTrafficLight { super.changeCountdownYellow(yellowNum); UiThreadHandler.post(() -> { if (yellowNum > 0) { - mLightTimeTV.setVertrial(true); - mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.sweeper_traffic_light_yellow_color_up), - getResources().getColor(R.color.sweeper_traffic_light_yellow_color_down)}); mLightTimeTV.setText(String.valueOf(yellowNum)); } else { mLightTimeTV.setText(""); diff --git a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml index 0b0646bb8b..6d4f19207e 100644 --- a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml +++ b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml @@ -89,19 +89,22 @@ android:id="@+id/sweeper_switch_model_layout" 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" android:background="@drawable/sweeper_switch_map_bg" android:elevation="@dimen/sweeper_dp_10" android:padding="@dimen/sweeper_dp_20" - app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_operation_status" - app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_operation_status" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + android:layout_marginLeft="@dimen/module_mogo_och_margin_left" + android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom" android:gravity="center" android:orientation="horizontal"> + android:layout_width="@dimen/dp_80" + android:layout_height="@dimen/dp_80" + android:layout_centerInParent="true" + android:layout_gravity="center" /> + app:layout_constraintLeft_toLeftOf="parent" + android:visibility="gone"/> @@ -149,8 +153,8 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout"> @@ -168,8 +172,8 @@ app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"> @@ -191,7 +195,8 @@ app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:textSize="@dimen/module_mogo_och_slide_panel_textSize" - tools:visibility="visible" /> + tools:visibility="visible" + />