diff --git a/OCH/mogo-och-bus-passenger/build.gradle b/OCH/mogo-och-bus-passenger/build.gradle index c820ef0373..d4c7294545 100644 --- a/OCH/mogo-och-bus-passenger/build.gradle +++ b/OCH/mogo-och-bus-passenger/build.gradle @@ -74,6 +74,8 @@ dependencies { implementation rootProject.ext.dependencies.androidxconstraintlayout implementation rootProject.ext.dependencies.amapnavi3dmap implementation project(":OCH:mogo-och-common-module") + compileOnly project(":libraries:mogo-map") + if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogo_core_function_v2x }else { diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java index 291a58f01d..4eca36933e 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java @@ -1,15 +1,13 @@ package com.mogo.och.bus.passenger; +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P; + import android.content.Context; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.commons.module.status.IMogoStatusChangedListener; -import com.mogo.commons.module.status.MogoStatusManager; -import com.mogo.commons.module.status.StatusDescriptor; -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.och.bus.passenger.constant.BusPassengerConst; @@ -18,17 +16,13 @@ import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P; - -import java.util.Objects; - /** * 网约车-Bus-乘客端 * * Created on 2022/3/29 */ @Route(path = BusPassengerConst.PATH) -public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener { +public class MogoOCHBusPassenger implements IMogoOCH { private static final String TAG = MogoOCHBusPassenger.class.getSimpleName(); private FragmentActivity mActivity; @@ -45,8 +39,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) { this.mActivity = activity; this.mContainerId = containerId; - -// UiThreadHandler.post(() -> stepIntoVrMode()); + showFragment(); return null; } @@ -65,18 +58,6 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener @Override public void init(Context context) { - MogoStatusManager.getInstance().registerStatusChangedListener("OchBus",StatusDescriptor.VR_MODE, this); - } - - @Override - public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { - if (descriptor == StatusDescriptor.VR_MODE) { - if (isTrue){ - showFragment(); - }else { - hideFragment(); - } - } } /** @@ -84,7 +65,6 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener */ private void stepIntoVrMode() { CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" ); - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(true); // 白天模式 CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑 } diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java index 40983fa135..457fb25a60 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java @@ -8,6 +8,7 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.core.widget.ContentLoadingProgressBar; import com.mogo.commons.mvp.IView; @@ -15,8 +16,8 @@ import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerSmpManager; +import com.mogo.eagle.core.function.view.MapBizView; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.och.bus.passenger.R; @@ -31,6 +32,7 @@ import com.mogo.och.common.module.utils.NumberFormatUtil; public abstract class BusPassengerBaseFragment> extends MvpFragment { private static final String TAG = BusPassengerBaseFragment.class.getSimpleName(); + private MapBizView mapBizView; private TextView mCurrentArriveStation; private TextView mCurrentArriveStationTitle; private TextView mCurrentArriveTip; @@ -55,12 +57,12 @@ public abstract class BusPassengerBaseFragment + + + + + + + + { - if (descriptor == StatusDescriptor.VR_MODE) { - // 进入vr模式默认显示网约车小巴fragment - if (isTrue) { - showFragment(); - } else { - hideFragment(); - } - } else if (MogoStatusManager.getInstance().isVrMode()) { - // topView进行展示时推出网约车界面,但是不隐藏整个fragment - if (busFragment != null && isTrue) { - busFragment.hideOchBus(); - } - } - }; - @Override public void createCoverage(FragmentActivity activity, int containerId) { @@ -108,19 +86,15 @@ public class BusProvider implements IMogoOCH { @Nullable @Override public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) { - this.containerId = integer; this.activity = fragmentActivity; - -// UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L ); + showFragment(); return null; } @Override public void onDestroy() { //若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠 - MogoStatusManager.getInstance().unregisterStatusChangedListener("OchBus" - , StatusDescriptor.VR_MODE, statusChangedListener); if (activity == null) return; activity.finish(); } 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 c02b82fc7a..2a112d9695 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 @@ -33,6 +33,8 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView; import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView; +import com.mogo.eagle.core.function.smp.view.SmallMapView; +import com.mogo.eagle.core.function.view.MapBizView; 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.UiThreadHandler; @@ -72,6 +74,7 @@ public abstract class BaseBusTabFragment protected RelativeLayout mBadcaseBtn; protected RelativeLayout mAICollectBtn; private FrameLayout flStationPanelContainer; + private MapBizView mapBizView; private Group groupTestPanel; private TrafficDataView mTrafficDataView; // private BusTrafficLightView mTrafficLightView; @@ -80,6 +83,8 @@ public abstract class BaseBusTabFragment private ImageView mSwitchMapModeImage; private LinearLayout mSwitchMapModeLayout; + protected SmallMapView smallMapView; + //消息盒子 private DriverMsgBoxButtonView viewDriverMsgBoxButton; private DriverMsgBoxListView viewDriverMsgBoxList; @@ -106,6 +111,7 @@ public abstract class BaseBusTabFragment @Override protected void initViews() { + mapBizView = findViewById(R.id.mapBizView); groupTestPanel = findViewById(R.id.groupTestPanel); slidePanelView = findViewById(R.id.module_mogo_och_slide_panel); ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status); @@ -218,6 +224,22 @@ public abstract class BaseBusTabFragment viewDriverMsgBoxBubble.isShowData(true); } }); + + smallMapView = findViewById(R.id.smallMapView); + } + + @Override + protected void initViews(Bundle savedInstanceState) { + super.initViews(savedInstanceState); + mapBizView.onCreate(savedInstanceState); + smallMapView.onCreateView(savedInstanceState); + } + + @Override + public void onResume() { + super.onResume(); + mapBizView.onResume(); + smallMapView.onResume(); } @Nullable @@ -247,14 +269,33 @@ public abstract class BaseBusTabFragment BDRouteDataTestUtils.converToRouteData(); } + @Override + public void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + mapBizView.onSaveInstanceState(outState); + } + + @Override + public void onLowMemory() { + super.onLowMemory(); + mapBizView.onLowMemory(); + } + + @Override + public void onPause() { + super.onPause(); + mapBizView.onPause(); + smallMapView.onPause(); + } + @Override public void onDestroyView() { + mapBizView.onDestroy(); super.onDestroyView(); CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG); EventBus.getDefault().unregister(this); } - @Override public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) { // if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) { @@ -266,7 +307,6 @@ public abstract class BaseBusTabFragment public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) { } - /** * 测试到站 */ @@ -500,6 +540,7 @@ public abstract class BaseBusTabFragment @Override public void onDestroy() { super.onDestroy(); + smallMapView.onDestroy(); MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG); } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index c526af30b7..43cb2e1f91 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -18,7 +18,6 @@ import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.temp.EventLogout; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.function.call.map.CallerHDMapManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.call.map.CallerSmpManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -436,7 +435,7 @@ public class BusFragment extends BaseBusTabFragment } //清除鹰眼右下角小地图轨迹 - CallerSmpManager.clearPolyline(); + smallMapView.clearPolyline(); } /** @@ -472,7 +471,7 @@ public class BusFragment extends BaseBusTabFragment .latitude(lat) .longitude(longi); IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options); - CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo( + CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo( longi,lat,-1); if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空 marker.setRotateAngle(centerLine.getAngle().floatValue()); 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 a505aa4059..92952c1214 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 @@ -5,32 +5,60 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="@dimen/dp_72"> - + + + + + android:layout_height="match_parent" /> + + + + + + + + + + app:layout_constraintTop_toTopOf="parent" /> + tools:visibility="visible" /> + app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" /> + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@+id/fl_speed" + tools:visibility="visible"> + app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container" + tools:visibility="visible" /> - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + app:layout_constraintLeft_toLeftOf="parent" /> + @@ -378,4 +406,15 @@ ,btnAutopilotRunning,btnAutopilotRoute" tools:visibility="visible" /> + + \ No newline at end of file diff --git a/OCH/mogo-och-common-module/build.gradle b/OCH/mogo-och-common-module/build.gradle index 9c0565d4bc..30165c39bd 100644 --- a/OCH/mogo-och-common-module/build.gradle +++ b/OCH/mogo-och-common-module/build.gradle @@ -71,6 +71,7 @@ dependencies { api project(':core:mogo-core-function-call') implementation project(':core:function-impl:mogo-core-function-v2x') api project(':core:function-impl:mogo-core-function-hmi') + api project(':core:function-impl:mogo-core-function-map') } implementation project(':libraries:mogo-adas') diff --git a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml index 1a29fb3639..1328ee37a5 100644 --- a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml +++ b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml @@ -16,7 +16,6 @@ + + { - if (descriptor == StatusDescriptor.VR_MODE) { - // 进入vr模式默认显示网约车小巴fragment - if (isTrue) { - showFragment(); - } else { - hideFragment(); - } - } else if (MogoStatusManager.getInstance().isVrMode()) { - // topView进行展示时推出网约车界面,但是不隐藏整个fragment - if (sweeperFragment != null && isTrue) { - sweeperFragment.hideOchSweeper(); - } - } - }; - @Override public void createCoverage(FragmentActivity activity, int containerId) { @@ -99,11 +65,9 @@ public class SweeperProvider implements IMogoOCH { @Nullable @Override public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) { - this.containerId = integer; this.activity = fragmentActivity; - -// UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L ); + showFragment(); return null; } 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 bf3f058cf5..473ab89f04 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 @@ -5,6 +5,7 @@ import static com.mogo.och.sweeper.constant.SweeperConst.TIMER_START_AUTOPILOT_I import android.animation.ObjectAnimator; import android.content.Intent; +import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.animation.LinearInterpolator; @@ -31,6 +32,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; +import com.mogo.eagle.core.function.smp.view.SmallMapView; +import com.mogo.eagle.core.function.view.MapBizView; 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.UiThreadHandler; @@ -71,6 +74,7 @@ public abstract class BaseSweeperTabFragment - - + - + + + + + + + + + + + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@+id/fl_speed" + tools:visibility="visible"> @@ -118,8 +140,8 @@ 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" + android:layout_marginTop="@dimen/dp_24" app:layout_constraintLeft_toRightOf="@id/fl_speed" app:layout_constraintTop_toTopOf="@id/fl_speed" tools:background="#f00" @@ -127,40 +149,43 @@ + app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container" + tools:visibility="visible" /> - + + + + - - + app:layout_constraintLeft_toLeftOf="parent" /> + + + android:src="@drawable/bad_case_selector" /> @@ -246,8 +271,7 @@ 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" />