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 b5cdcd7e41..628d8ba6f8 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 @@ -16,6 +16,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.Group; import com.mogo.commons.AbsMogoApplication; @@ -43,6 +44,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.ui.SweeperOperatePanelView; import com.mogo.och.sweeper.view.SweeperTrafficDataView; import com.mogo.och.sweeper.util.BDRouteDataTestUtils; import com.mogo.och.sweeper.view.SlidePanelView; @@ -72,11 +74,12 @@ public abstract class BaseSweeperTabFragment { + if (mOperatePanel.getVisibility()==View.VISIBLE){ + mOperatePanel.setVisibility(View.GONE); + }else{ + mOperatePanel.setVisibility(View.VISIBLE); + } + }); if (DebugConfig.isDebug()) { mTrafficDataView.setLongClickable(true); @@ -161,11 +168,7 @@ public abstract class BaseSweeperTabFragment cleanModeBtnViewIds = Arrays.asList( @@ -146,6 +148,8 @@ public class SweeperOperatePanelView extends LinearLayout { mLoadingContainer = findViewById(R.id.loading_hint_container); mLoadingHintTop = findViewById(R.id.loading_hint_top); mLoadingHintBottom = findViewById(R.id.loading_hint_bottom); + mBtnCancel = findViewById(R.id.btn_operate_panel_cancel); + mBtnReset = findViewById(R.id.btn_operate_panel_reset); initViewListener(); } @@ -160,6 +164,8 @@ public class SweeperOperatePanelView extends LinearLayout { setClickListener(mBtnCleanDirectionBothSide, (v) -> onCleanDirectionBtnClick(v)); setClickListener(mBtnCleanIntensityStandard, (v) -> onCleanIntensityBtnClick(v)); setClickListener(mBtnCleanIntensityStrong, (v) -> onCleanIntensityBtnClick(v)); + setClickListener(mBtnReset, (v) -> onOperateReset()); + setClickListener(mBtnCancel, (v) -> onOperateCancel()); } /** @@ -1016,6 +1022,18 @@ public class SweeperOperatePanelView extends LinearLayout { ); } + /** + * 取消关闭面板 + */ + private void onOperateCancel(){ + this.setVisibility(View.GONE); + } + /** + * 复位 + */ + private void onOperateReset(){ + + } private final static SweeperOperateCmdHandler mSweeperOperateCmdHandler = new SweeperOperateCmdHandler(); private static CmdRequestCallback mCurrentCmdRequestCallback;//发送命令后的回调 private boolean mSyncingVehicleState;//第一次进入页面时,同步底盘状态的标志位 diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/bg_sweeper_operate_panel.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/bg_sweeper_operate_panel.png new file mode 100644 index 0000000000..943c88912d Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/bg_sweeper_operate_panel.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_clean_mode_icon.png b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_clean_mode_icon.png new file mode 100644 index 0000000000..cd3c35fe82 Binary files /dev/null and b/OCH/mogo-och-sweeper/src/main/res/drawable-xhdpi/sweeper_clean_mode_icon.png differ diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_shape_clean_mode.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_shape_clean_mode.xml new file mode 100644 index 0000000000..57588e065f --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_shape_clean_mode.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_shape_work_mode.xml similarity index 55% rename from OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel.xml rename to OCH/mogo-och-sweeper/src/main/res/drawable/bg_shape_work_mode.xml index c9f7378baa..dc38f6a174 100644 --- a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel.xml +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_shape_work_mode.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_default.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_default.xml index 84464f5307..3de0910dcd 100644 --- a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_default.xml +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_default.xml @@ -3,5 +3,4 @@ android:shape="rectangle"> - \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_disabled.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_disabled.xml index a5cb095bc8..16e880f1a2 100644 --- a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_disabled.xml +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_disabled.xml @@ -3,5 +3,4 @@ android:shape="rectangle"> - \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_pressed.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_pressed.xml index 8d7970361a..4e57ba75b0 100644 --- a/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_pressed.xml +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/bg_sweeper_operate_panel_btn_pressed.xml @@ -1,7 +1,6 @@ - + - \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_oprate_panel_cancel_btn.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_oprate_panel_cancel_btn.xml new file mode 100644 index 0000000000..7728783fa7 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_oprate_panel_cancel_btn.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_oprate_panel_reset_btn.xml b/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_oprate_panel_reset_btn.xml new file mode 100644 index 0000000000..a0be0f0b9e --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_oprate_panel_reset_btn.xml @@ -0,0 +1,6 @@ + + + + + + \ 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 aa7a2a60ad..5e7db992a8 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 @@ -30,7 +30,8 @@ app:layout_constraintLeft_toLeftOf="parent" android:layout_marginLeft="@dimen/dp_13" android:gravity="center" - tools:visibility="visible" > + tools:visibility="visible" + android:visibility="gone"> - + + + + + + + @@ -67,11 +145,10 @@ android:id="@+id/module_mogo_och_sweeper_operate_panel" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_24" android:layout_marginStart="@dimen/dp_8" - app:layout_constraintLeft_toRightOf="@id/fl_speed" - app:layout_constraintTop_toTopOf="@id/fl_speed" - tools:background="#f00" + app:layout_constraintLeft_toRightOf="@id/sweeper_cl_work_mode" + app:layout_constraintTop_toTopOf="@id/sweeper_cl_work_mode" + android:visibility="gone" tools:visibility="visible" /> + android:layout_width="@dimen/dp_957" + android:layout_height="@dimen/dp_758" + android:background="@drawable/bg_sweeper_operate_panel"> + app:layout_constraintTop_toTopOf="parent" + android:visibility="gone"/> + app:layout_constraintTop_toTopOf="@id/hint_clean_work" + android:visibility="gone"/> + app:layout_constraintTop_toTopOf="parent" + android:paddingStart="@dimen/dp_90" + /> + app:layout_constraintTop_toBottomOf="@id/hint_clean_mode" + app:layout_constraintStart_toStartOf="parent" + android:layout_marginTop="@dimen/dp_17" + /> + app:layout_constraintTop_toBottomOf="@id/hint_clean_mode" + app:layout_constraintStart_toEndOf="@+id/btn_clean_mode_pure_sweep" + android:layout_marginTop="@dimen/dp_17" + android:layout_marginStart="@dimen/dp_46"/> + app:layout_constraintTop_toBottomOf="@id/hint_clean_mode" + app:layout_constraintStart_toEndOf="@+id/btn_clean_mode_pure_wash" + android:layout_marginTop="@dimen/dp_17" + android:layout_marginStart="@dimen/dp_46"/> + android:layout_marginTop="@dimen/dp_17" + android:layout_marginStart="@dimen/dp_46" + app:layout_constraintTop_toBottomOf="@id/hint_clean_mode" + app:layout_constraintStart_toEndOf="@+id/btn_clean_mode_sweep_wash" + android:layout_marginEnd="@dimen/dp_20"/> @@ -167,19 +165,20 @@ android:id="@+id/btn_clean_direction_left_side" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/dp_28" android:background="@drawable/sweeper_operate_panel_btn2_bg_selector" android:enabled="false" android:gravity="center" - android:paddingStart="@dimen/dp_32" + android:paddingStart="@dimen/dp_48" android:paddingTop="@dimen/dp_12" - android:paddingEnd="@dimen/dp_32" + android:paddingEnd="@dimen/dp_48" android:paddingBottom="@dimen/dp_12" + android:layout_marginStart="@dimen/dp_90" + android:textColor="@color/white" android:text="左侧" - android:textColor="#000000" android:textSize="@dimen/sweeper_operate_panel_btn_text_size" - app:layout_constraintLeft_toRightOf="@id/hint_clean_direction" - app:layout_constraintTop_toTopOf="@id/hint_clean_direction" /> + app:layout_constraintTop_toBottomOf="@+id/hint_clean_direction" + app:layout_constraintStart_toStartOf="parent" + android:layout_marginTop="@dimen/dp_17"/> + app:layout_constraintTop_toBottomOf="@+id/hint_clean_direction" + app:layout_constraintStart_toEndOf="@+id/btn_clean_direction_left_side"/> + app:layout_constraintStart_toEndOf="@+id/btn_clean_direction_right_side" + app:layout_constraintTop_toBottomOf="@id/hint_clean_direction" /> @@ -245,19 +242,20 @@ android:id="@+id/btn_clean_intensity_standard" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/dp_28" android:background="@drawable/sweeper_operate_panel_btn2_bg_selector" android:enabled="false" android:gravity="center" - android:paddingStart="@dimen/dp_32" + android:paddingStart="@dimen/dp_48" android:paddingTop="@dimen/dp_12" - android:paddingEnd="@dimen/dp_32" + android:paddingEnd="@dimen/dp_48" android:paddingBottom="@dimen/dp_12" + android:layout_marginStart="@dimen/dp_90" + android:textColor="@color/white" + android:layout_marginTop="@dimen/dp_17" android:text="标准" - android:textColor="#000000" android:textSize="@dimen/sweeper_operate_panel_btn_text_size" - app:layout_constraintLeft_toRightOf="@id/hint_clean_intensity" - app:layout_constraintTop_toTopOf="@id/hint_clean_intensity" /> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/hint_clean_intensity" /> - + app:layout_constraintTop_toBottomOf="@id/hint_clean_intensity" /> + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/values/colors.xml b/OCH/mogo-och-sweeper/src/main/res/values/colors.xml index 855ffb1a50..a25b9b762b 100644 --- a/OCH/mogo-och-sweeper/src/main/res/values/colors.xml +++ b/OCH/mogo-och-sweeper/src/main/res/values/colors.xml @@ -48,9 +48,9 @@ #7DE261 #f00 #BF30334C - #ffffff + #548DB8 #1FA7FF - #80ffffff + #3769B5 #BF30334C \ 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 f70fac49fa..5a73ebcb09 100644 --- a/OCH/mogo-och-sweeper/src/main/res/values/dimens.xml +++ b/OCH/mogo-och-sweeper/src/main/res/values/dimens.xml @@ -149,6 +149,6 @@ 130dp 60dp - 16dp - 36dp + 13dp + 32dp \ No newline at end of file