From 57dbfbba3e97ee1e52d86b6f4dd9075fbea1fa75 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Wed, 5 Jan 2022 18:28:43 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E5=A2=9E=E5=8A=A0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=BB=B6=E6=97=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=A8=B3?= =?UTF-8?q?=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../function/main/MainMoGoApplication.java | 4 +- .../mogo/map/impl/custom/AMapViewWrapper.java | 86 ------------------- .../src/main/AndroidManifest.xml | 1 + .../com/mogo/module/main/MainActivity.java | 7 +- 4 files changed, 8 insertions(+), 90 deletions(-) diff --git a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 56b849f3e7..e90232a84a 100644 --- a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -340,12 +340,12 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, PushUIConstants.NAME)); // 碰撞报警模块 MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "IMogoCrashWarnProvider")); - // ADAS模块(旧,慢慢被 域控制器模块 替换掉) - MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider")); // 前方碰撞预警 MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider")); // 全局语音唤醒 MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake")); + // ADAS模块(旧,慢慢被 域控制器模块 替换掉) + MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider")); if (!DebugConfig.isLauncher()) { PersistentManager.getInstance().initManager(this); diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index e122a48d7c..c6027d1739 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -5,19 +5,14 @@ import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT; import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT; import android.content.Context; -import android.graphics.Color; import android.graphics.Point; import android.graphics.Rect; -import android.graphics.Typeface; import android.location.Location; import android.os.Bundle; import android.os.Trace; -import android.text.TextUtils; import android.util.Log; import android.view.MotionEvent; import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.commons.debug.DebugConfig; @@ -113,7 +108,6 @@ public class AMapViewWrapper implements IMogoMapView, private boolean mMapLoaded = false; private boolean mIsFirstLocated = true; private boolean mIsDelayed = false; - private Marker mSelfMarker; public AMapViewWrapper(MapAutoView mMapView) { startTime = System.currentTimeMillis(); @@ -274,7 +268,6 @@ public class AMapViewWrapper implements IMogoMapView, mMapView.setOnMapClickListener(null); mMapView.getLocationClient().unRegisterListener(this); mMapView.setOnCameraChangeListener(null); - mSelfMarker = null; Logger.d(TAG, "map onDestroy"); } } @@ -798,85 +791,6 @@ public class AMapViewWrapper implements IMogoMapView, MapStyleController.getInstance().onLocationChanged(location, this); } } - - if (mSelfMarker == null) { - try { - mSelfMarker = mMapView.getMapAutoViewHelper().getMyLocationStyle().getSelfMarker(); - mSelfMarker.setInfoWindowEnable(true); - } catch (Exception e) { - e.printStackTrace(); - } - } else { -// 通过不同的方向类型来改变车模,目前暂定三种模型,drawlevel 1 绿,2 黄,3 红,绿色的时候需要把相应的切换为默认模型 -// Logger.d("liyz", " mDrawlevel = " + mDrawlevel); -// if (mDrawlevel == 1 && isShowWarn) { -// mSelfMarker.marker3DIcon(R.raw.car); -// isShowWarn = false; -// } else if (mDrawlevel == 2) { //不处理 -// -// } else if (mDrawlevel == 3 && !isShowWarn) { -// //继续判断相应的方位,目前是只有 前方 TODO -// mSelfMarker.marker3DIcon(R.raw.qfpz); -// isShowWarn = true; -// } -// -// UiThreadHandler.postDelayed(() -> { -// if (!isShowWarn) { -// mSelfMarker.marker3DIcon(R.raw.qfpz); -// isShowWarn = true; -// } -// }, 6_000L); - - } - //showSelfSpeed(location.getSpeed()); - } - - private TextView mSpeedView = null; - private int mLastYOffset = 20; - - private void showSelfSpeed(float speed) { - - if (!checkAMapView()) { - return; - } - - if (mSelfMarker == null) { - return; - } - if (mCurrentUI != EnumMapUI.Type_VR) { - mSelfMarker.hideInfoWindow(); - return; - } - - int speedIntVal = (int) (speed * 3.6); - if (speedIntVal <= 0) { - mSelfMarker.hideInfoWindow(); - return; - } - - String speedVal = String.valueOf(speedIntVal); - String infoResName = ResIdCache.getVal(speedVal); - int offset = 20; - if (!mMapView.getMapAutoViewHelper().getLockMode()) { - offset = 30; - } - if (offset != mLastYOffset) { - mLastYOffset = offset; - } - mSelfMarker.setInfoWindowOffset(0, offset); - if (TextUtils.isEmpty(infoResName)) { - if (mSpeedView == null) { - mSpeedView = new TextView(mMapView.getContext()); - mSpeedView.setTextColor(Color.WHITE); - mSpeedView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); - mSpeedView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); - } - mSpeedView.setText(speedVal); - mSelfMarker.setInfoWindowView(mSpeedView); - ResIdCache.putVal(speedVal, mSelfMarker.getMarkeOptions().getMarkerInfoName()); - } else { - mSelfMarker.setMarkerInfoName(infoResName); - } } @Override diff --git a/modules/mogo-module-main/src/main/AndroidManifest.xml b/modules/mogo-module-main/src/main/AndroidManifest.xml index 90e40ed1eb..669e61422b 100644 --- a/modules/mogo-module-main/src/main/AndroidManifest.xml +++ b/modules/mogo-module-main/src/main/AndroidManifest.xml @@ -1,6 +1,7 @@ + implement loadOthersModules(); loadFunctionFragment(); } - }, 1000); + }, 3000); Log.i(TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms"); }); loadFunctionMapView(); @@ -288,7 +290,6 @@ public class MainActivity extends MvpActivity implement // 启动一些基本的服务:定位等 startBaseService(); - } private void initAdasControlStatusListener() { @@ -318,6 +319,7 @@ public class MainActivity extends MvpActivity implement @Override public void loadFunctionFragment() { + Logger.d(TAG,"loadFunctionFragment……"); // 加载 HMI 图层 BaseFragment fragmentHdMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation(); addFragment(fragmentHdMap, fragmentHdMap.getTagName(), R.id.module_main_id_waring_fragment); @@ -457,6 +459,7 @@ public class MainActivity extends MvpActivity implement SchemeIntent.getInstance().clear(); FloatingViewHandler.clear(); mServiceApis.getShareManager().releaseContext(); + ProcessUtils.killAllBackgroundProcesses(); } @Override