diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java index e82be6de13..b5cdcd7e41 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java @@ -20,7 +20,6 @@ import androidx.constraintlayout.widget.Group; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; -import com.mogo.commons.module.intent.IntentManager; import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; @@ -32,10 +31,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; -import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener; -import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.MogoMapUIController; import com.mogo.map.MogoMarkerManager; @@ -46,6 +43,7 @@ import com.mogo.och.sweeper.R; import com.mogo.och.sweeper.bean.SweeperRoutesResult; import com.mogo.och.sweeper.constant.SweeperConst; import com.mogo.och.sweeper.model.SweeperOrderModel; +import com.mogo.och.sweeper.view.SweeperTrafficDataView; import com.mogo.och.sweeper.util.BDRouteDataTestUtils; import com.mogo.och.sweeper.view.SlidePanelView; @@ -76,7 +74,7 @@ public abstract class BaseSweeperTabFragment { + if (tapPositionView != null) { + tapPositionView.updateWithGear(gear); + } + }); + } + + @Override + public void onAutopilotDataException(long timestamp) { + + } + + @Override + public void onAutopilotAcc(float carAcc) { + + } + + @Override + public void onAutopilotBrake(float brake) { + CallerLogger.INSTANCE.d(TAG, "刹车:" + brake); + } + + @Override + public void onAutopilotThrottle(float throttle) { + CallerLogger.INSTANCE.d(TAG, "油门:" + throttle); + } + + }; + /** + * 限速监听 + */ + private final LimitingVelocityListener limitingVelocityListener = new LimitingVelocityListener(){ + + @Override + public void onLimitingVelocityChange(int limitingVelocity) { + //设置限速 + sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity); + } + }; + /** + * 速度设置 + */ + public void updateSpeedWithValue(int newSpeed) { + if (speedTextView != null) { + speedTextView.setText(String.valueOf(newSpeed)); + } + if (speedImage != null) { + speedImage.setBackgroundResource(newSpeed > 60 ? R.drawable.sweeper_traffic_data_speed_warning :R.drawable.sweeper_bg_traffic_data_speed); + } + } +} 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/view/SweeperTrafficLightView.java similarity index 97% rename from OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperTrafficLightView.java rename to OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficLightView.java index e2019626e6..adbc4ad114 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/view/SweeperTrafficLightView.java @@ -1,4 +1,4 @@ -package com.mogo.och.sweeper.ui; +package com.mogo.och.sweeper.view; import android.content.Context; import android.util.AttributeSet; @@ -9,12 +9,11 @@ import android.widget.TextView; import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.och.sweeper.R; -import com.mogo.och.common.module.wigets.OCHGradientTextView; import org.jetbrains.annotations.Nullable; /** - * 清扫车:红绿灯view + * 清扫车:红绿灯view- * * Created on 2022/3/29 */ diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/TurnSignalView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/TurnSignalView.java new file mode 100644 index 0000000000..9ad5640dca --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/TurnSignalView.java @@ -0,0 +1,62 @@ +package com.mogo.och.sweeper.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import com.mogo.och.sweeper.R; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +public class TurnSignalView extends LinearLayout { + private ImageView turnLeftView; + private ImageView turnRightView; + public TurnSignalView(Context context) { + super(context); + } + + public TurnSignalView(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + initView(context); + } + + public TurnSignalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public TurnSignalView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + private void initView(@NonNull Context context) { + LayoutInflater.from(context).inflate(R.layout.sweeper_turn_signal, this); + turnLeftView = findViewById(R.id.turnLeftView); + turnRightView = findViewById(R.id.turnRightView); + } + + /** + * 展示左转向灯 + */ + public void showLeftSignal(){ + turnLeftView.setSelected(true); + turnRightView.setSelected(false); + } + + /** + * 展示右转向灯 + */ + public void showRightSignal(){ + turnLeftView.setSelected(false); + turnRightView.setSelected(true); + } + + /** + * 默认情况及其直行时 + */ + public void showDirection(){ + turnLeftView.setSelected(false); + turnRightView.setSelected(false); + } +} diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_bg_traffic_data.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_bg_traffic_data.png new file mode 100644 index 0000000000..6349c77a8c Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_bg_traffic_data.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_bg_traffic_data_speed.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_bg_traffic_data_speed.png new file mode 100644 index 0000000000..32151e5ada Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_bg_traffic_data_speed.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_traffic_data_speed_warning.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_traffic_data_speed_warning.png new file mode 100644 index 0000000000..f68278023c Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_traffic_data_speed_warning.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_left_nor.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_left_nor.png new file mode 100644 index 0000000000..05e741771b Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_left_nor.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_left_select.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_left_select.png new file mode 100644 index 0000000000..74ffe011f8 Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_left_select.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_right_nor.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_right_nor.png new file mode 100644 index 0000000000..ae19bd2d81 Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_right_nor.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_right_select.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_right_select.png new file mode 100644 index 0000000000..b6c41d676e Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/turn_signal_right_select.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_bg_waring_limiting_velocity.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_bg_waring_limiting_velocity.xml new file mode 100644 index 0000000000..aea70cad45 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_bg_waring_limiting_velocity.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/turn_signal_left_selector.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/turn_signal_left_selector.xml new file mode 100755 index 0000000000..45c8f084e4 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/turn_signal_left_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/turn_signal_right_selector.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/turn_signal_right_selector.xml new file mode 100755 index 0000000000..97e3b8de55 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/turn_signal_right_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file 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 6d4f19207e..aa7a2a60ad 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 @@ -15,12 +15,12 @@ app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent"> - + - + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_data.xml b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_data.xml new file mode 100644 index 0000000000..70cf4a311c --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_data.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_light_view.xml b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_light_view.xml index a827393d7d..f7c111451a 100644 --- a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_light_view.xml +++ b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_traffic_light_view.xml @@ -1,12 +1,12 @@ + android:layout_width="match_parent" + android:layout_height="match_parent"> + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/values/dimens.xml b/OCH/mogo-och-sweeper/src/main/res/values/dimens.xml index baef598b89..f70fac49fa 100644 --- a/OCH/mogo-och-sweeper/src/main/res/values/dimens.xml +++ b/OCH/mogo-och-sweeper/src/main/res/values/dimens.xml @@ -145,7 +145,7 @@ 120dp 15dp 17dp - 100dp + 140dp 130dp 60dp