diff --git a/OCH/mogo-och-bus-passenger/build.gradle b/OCH/mogo-och-bus-passenger/build.gradle index 8749b55ad1..294c1c9b8f 100644 --- a/OCH/mogo-och-bus-passenger/build.gradle +++ b/OCH/mogo-och-bus-passenger/build.gradle @@ -52,6 +52,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/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java index 5cf0a93b79..4eca36933e 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java @@ -8,9 +8,6 @@ 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.setting.CallerMoGoUiSettingManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.och.bus.passenger.constant.BusPassengerConst; @@ -25,7 +22,7 @@ import org.jetbrains.annotations.Nullable; * 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; @@ -42,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; } @@ -62,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(); - } - } } /** diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java index c9abd42c76..457fb25a60 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java +++ b/OCH/mogo-och-bus-passenger/src/main/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,14 +16,13 @@ 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; import com.mogo.och.bus.passenger.constant.BusPassengerConst; import com.mogo.och.common.module.utils.NumberFormatUtil; -import com.mogo.och.common.module.wigets.OCHBorderShadowLayout; /** * Created on 2022/3/31 @@ -32,6 +32,7 @@ import com.mogo.och.common.module.wigets.OCHBorderShadowLayout; 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; @@ -56,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) { @@ -106,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 fa5adf8e1a..bde6c18c30 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,7 @@ 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.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 +73,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; @@ -106,6 +108,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); @@ -220,6 +223,18 @@ public abstract class BaseBusTabFragment }); } + @Override + protected void initViews(Bundle savedInstanceState) { + super.initViews(savedInstanceState); + mapBizView.onCreate(savedInstanceState); + } + + @Override + public void onResume() { + super.onResume(); + mapBizView.onResume(); + } + @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container @@ -247,14 +262,32 @@ 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(); + } + @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 +299,6 @@ public abstract class BaseBusTabFragment public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) { } - /** * 测试到站 */ 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 46ccc88b5b..4ff307b81c 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; @@ -471,7 +470,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..f140f6a4e2 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" /> + 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) { @@ -96,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..e74b7ebbf6 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,7 @@ 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.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 +73,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" />