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 2dba29c568..59820ddffe 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 @@ -142,6 +142,7 @@ public abstract class BaseBusTabFragment mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() { @Override public void onClickImpl(View v) { + IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController(); if (controller != null) { //切换地图的远近视图 @@ -192,6 +193,10 @@ public abstract class BaseBusTabFragment debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) ); + findViewById(R.id.btnAutopilotPingxing).setOnClickListener(view -> + debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) + ); + // 模拟 自动驾驶网约车回调数据 findViewById(R.id.btnAutopilotArrive).setOnClickListener(view -> debugArrivedStation() @@ -392,23 +397,28 @@ public abstract class BaseBusTabFragment ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable)); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv)); ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon); - ctvAutopilotStatus.setSelected(false); +// ctvAutopilotStatus.setSelected(false); ctvAutopilotStatus.setClickable(true); + ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_0_1_status_bg)); } else { ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal)); ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot); - ctvAutopilotStatus.setClickable(true); if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用 - ctvAutopilotStatus.setSelected(false); +// ctvAutopilotStatus.setSelected(false); + ctvAutopilotStatus.setClickable(true); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv)); + ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_0_1_status_bg)); } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) { ctvAutopilotStatusTv.setText(R.string.bus_loading_autopilot_runnig_tv); - ctvAutopilotStatus.setSelected(true); + ctvAutopilotStatus.setClickable(true); + ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_2_status_bg)); +// ctvAutopilotStatus.setSelected(true); } else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING == autopilotStatus){ ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver); - ctvAutopilotStatusTv.setBackground(getContext().getDrawable(R.drawable.pingxingjiashi)); + ctvAutopilotStatus.setClickable(false); + ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.pingxingjiashi)); } } @@ -420,14 +430,14 @@ public abstract class BaseBusTabFragment ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon); ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal)); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv)); - ctvAutopilotStatus.setSelected(false); +// ctvAutopilotStatus.setSelected(false); ctvAutopilotStatus.setClickable(false); } else { ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon); ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal)); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv)); ctvAutopilotStatus.setClickable(false); - ctvAutopilotStatus.setSelected(false); +// ctvAutopilotStatus.setSelected(false); } UiThreadHandler.postDelayed(new Runnable() { @Override @@ -505,7 +515,7 @@ public abstract class BaseBusTabFragment isAnimateRunning = true; ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv)); ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal)); - ctvAutopilotStatus.setSelected(false); +// ctvAutopilotStatus.setSelected(false); ctvAutopilotStatus.setClickable(true); ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon); if (autopilotLoadingAnimator == null) { diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_0_1_status_bg.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_0_1_status_bg.xml new file mode 100644 index 0000000000..21c3611ffe --- /dev/null +++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_0_1_status_bg.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_2_status_bg.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_2_status_bg.xml new file mode 100644 index 0000000000..1b95919363 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_2_status_bg.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml deleted file mode 100644 index ad57da1c3a..0000000000 --- a/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - 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 d1fa36e48b..04f8739e01 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 @@ -171,7 +171,7 @@ android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width" android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height" android:layout_marginLeft="@dimen/dp_13" - android:background="@drawable/bus_autopilot_status_bg" + android:background="@drawable/bus_autopilot_0_1_status_bg" android:gravity="center" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toBottomOf="@+id/fl_speed" @@ -363,6 +363,16 @@ app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable" app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" /> +