清扫车灯态UI修改
This commit is contained in:
@@ -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("");
|
||||
|
||||
@@ -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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sweeper_switch_model_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
<CheckedTextView
|
||||
android:id="@+id/module_mogo_och_operation_status"
|
||||
@@ -118,7 +121,8 @@
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_setting_layout"
|
||||
@@ -131,8 +135,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/sweeper_switch_model_layout">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/sweeper_setting_btn_bg" />
|
||||
@@ -149,8 +153,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/bad_case_selector"/>
|
||||
@@ -168,8 +172,8 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ai_collect_selector" />
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
|
||||
@@ -1,35 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/sweeper_traffic_light_layout_width"
|
||||
android:layout_height="@dimen/sweeper_traffic_light_layout_height"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/sweeper_traffic_light_bg_width"
|
||||
android:layout_height="@dimen/sweeper_traffic_light_bg_height"
|
||||
android:background="@drawable/bg_sweeper_traffic_light_background"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginLeft="@dimen/sweeper_traffic_light_bg_margin_left"
|
||||
android:layout_marginTop="@dimen/sweeper_traffic_light_bg_margin_top"/>
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/sweeper_traffic_light_iv"
|
||||
android:layout_width="@dimen/sweeper_traffic_light_icon_size"
|
||||
android:layout_height="@dimen/sweeper_traffic_light_icon_size"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/sweeper_light_red_nor"/>
|
||||
<TextView
|
||||
android:id="@+id/sweeper_traffic_light_time_tv"
|
||||
android:layout_width="@dimen/sweeper_traffic_light_time_view_width"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="@dimen/sweeper_traffic_light_time_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:gravity="center" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="10"
|
||||
android:textColor="@color/white"/>
|
||||
</FrameLayout>
|
||||
@@ -145,7 +145,7 @@
|
||||
<dimen name="sweeper_traffic_light_bg_height">120dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_bg_margin_left">15dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_bg_margin_top">17dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_icon_size">154dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_icon_size">100dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_time_view_width">130dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_time_size">60dp</dimen>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user