= HashMap()
/**
- * 查询OBU状态
+ * 查询 OBU状态
*/
fun getObuStatusInfo(): ObuStatusInfo {
return mObuStatusInfo
}
/**
- * 查询OBU状态
+ * 查询 OBU状态
*/
fun getObuStatusInfoJsonString(): String {
return GsonUtils.toJson(mObuStatusInfo)
}
/**
- * 添加自动驾驶按钮选中监听
+ * 添加 OBU状态 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
@@ -49,7 +49,7 @@ object CallerObuListenerManager : CallerBase() {
}
/**
- * 删除 监听
+ * 删除 OBU状态 监听
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
@@ -57,7 +57,7 @@ object CallerObuListenerManager : CallerBase() {
}
/**
- * 删除自动驾驶按钮选中监听
+ * 删除 OBU状态 监听
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
@@ -69,19 +69,18 @@ object CallerObuListenerManager : CallerBase() {
}
/**
- * 触发自动驾驶按钮选中监听
+ * 触发 OBU状态 监听
*/
fun invokeListener() {
- LogUtils.dTag(TAG, "isChecked:$mObuStatusInfo")
invokeListener(mObuStatusInfo)
}
/**
- * 触发自动驾驶按钮选中监听
+ * 触发 OBU状态 监听
* @param obuStatusInfo 选中状态
*/
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
- LogUtils.dTag(TAG, "isChecked:$obuStatusInfo")
+ LogUtils.dTag(TAG, "obuStatusInfo:$obuStatusInfo")
mObuStatusInfo = obuStatusInfo
mObuStatusListeners.forEach {
val tag = it.key
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-ldpi/module_switch_map_angle.png b/core/mogo-core-res/src/main/function-hmi-res/drawable-mdpi/module_switch_map_angle.png
similarity index 100%
rename from modules/mogo-module-extensions/src/main/res/drawable-ldpi/module_switch_map_angle.png
rename to core/mogo-core-res/src/main/function-hmi-res/drawable-mdpi/module_switch_map_angle.png
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-mdpi/module_switch_map_angle.png b/core/mogo-core-res/src/main/function-hmi-res/drawable-xxhdpi/module_switch_map_angle.png
similarity index 100%
rename from modules/mogo-module-extensions/src/main/res/drawable-mdpi/module_switch_map_angle.png
rename to core/mogo-core-res/src/main/function-hmi-res/drawable-xxhdpi/module_switch_map_angle.png
diff --git a/core/mogo-core-res/src/main/res/values-xhdpi-2560x1440/dimens.xml b/core/mogo-core-res/src/main/res/values-xhdpi-2560x1440/dimens.xml
index a32b5ba646..044c28954c 100644
--- a/core/mogo-core-res/src/main/res/values-xhdpi-2560x1440/dimens.xml
+++ b/core/mogo-core-res/src/main/res/values-xhdpi-2560x1440/dimens.xml
@@ -32,4 +32,13 @@
44px
+ 279px
+ 119px
+ 22px
+ 36px
+ 50px
+ 60px
+
+
+
\ No newline at end of file
diff --git a/core/mogo-core-res/src/main/res/values/color.xml b/core/mogo-core-res/src/main/res/values/color.xml
index aa7e6bacf6..b2c628bf52 100644
--- a/core/mogo-core-res/src/main/res/values/color.xml
+++ b/core/mogo-core-res/src/main/res/values/color.xml
@@ -5,4 +5,6 @@
#323C6F
+ #FFFFFF
+
\ No newline at end of file
diff --git a/core/mogo-core-res/src/main/res/values/dimens.xml b/core/mogo-core-res/src/main/res/values/dimens.xml
index 8753a23a7b..7c21290aea 100644
--- a/core/mogo-core-res/src/main/res/values/dimens.xml
+++ b/core/mogo-core-res/src/main/res/values/dimens.xml
@@ -32,4 +32,13 @@
33px
+ 190px
+ 76px
+ 16px
+ 24px
+ 35px
+ 38px
+
+
+
\ No newline at end of file
diff --git a/core/mogo-core-res/src/main/res/values/string.xml b/core/mogo-core-res/src/main/res/values/string.xml
index eb4163b982..e618039a94 100644
--- a/core/mogo-core-res/src/main/res/values/string.xml
+++ b/core/mogo-core-res/src/main/res/values/string.xml
@@ -4,4 +4,7 @@
"不支持该视频。"
此文件不支持播放
+
+ 近距视角
+ 远距视角
\ No newline at end of file
diff --git a/libraries/map-custom/build.gradle b/libraries/map-custom/build.gradle
index 07236c1b18..ab34b9f21c 100644
--- a/libraries/map-custom/build.gradle
+++ b/libraries/map-custom/build.gradle
@@ -61,7 +61,9 @@ dependencies {
implementation project(':foudations:mogo-utils')
implementation project(':libraries:mogo-map-api')
implementation project(':foudations:mogo-commons')
+
implementation project(':core:mogo-core-data')
+ implementation project(':core:mogo-core-function-call')
}
implementation rootProject.ext.dependencies.mogocustommap
}
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 8525b36650..64a31a3f4c 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
@@ -17,7 +17,6 @@ import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
-import android.view.animation.Interpolator;
import android.widget.TextView;
import com.mogo.commons.FunctionBuildConfig;
@@ -33,7 +32,6 @@ import com.mogo.map.impl.custom.utils.ObjectUtils;
import com.mogo.map.impl.custom.utils.PointInterpolatorUtil;
import com.mogo.map.impl.custom.utils.ResIdCache;
import com.mogo.map.listener.MogoMapListenerHandler;
-import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -458,9 +456,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (visible && NaviClient.getInstance(getContext()).isNaviing()) {
return;
}
- // if (DebugConfig.isDebug()) {
- // Logger.d(TAG, Log.getStackTraceString(new Throwable()));
- // }
+
if (checkAMapView()) {
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
if (visible) {
@@ -504,9 +500,6 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void recoverLockMode() {
if (checkAMapView()) {
- // if ( DebugConfig.isDebug() ) {
- // Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
- // }
if (mCurrentUI == EnumMapUI.Type_VR) {
return;
}
@@ -562,7 +555,7 @@ public class AMapViewWrapper implements IMogoMapView,
try {
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion().getLeftBottomPoint());
} catch (Exception e) {
-
+ e.printStackTrace();
}
return null;
}
@@ -572,7 +565,7 @@ public class AMapViewWrapper implements IMogoMapView,
try {
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
} catch (Exception e) {
-
+ e.printStackTrace();
}
return null;
}
@@ -594,6 +587,7 @@ public class AMapViewWrapper implements IMogoMapView,
try {
return MapTools.INSTANCE.toScreenLocation(ObjectUtils.fromMogo(latLng));
} catch (Exception e) {
+ e.printStackTrace();
return null;
}
}
@@ -607,38 +601,13 @@ public class AMapViewWrapper implements IMogoMapView,
return ObjectUtils.fromAMap(
MapTools.INSTANCE.fromScreenLocation(point));
} catch (Exception e) {
+ e.printStackTrace();
return null;
}
}
return null;
}
- @Override
- public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
- long duration) {
- if (marker == null || high <= 0.0f || interpolator == null || duration < 0) {
- return;
- }
- try {
- // final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() );
- // Point point = mMapView.getMap().getProjection().toScreenLocation( latLng );
- // point.y -= WindowUtils.dip2px( getContext(), high );
- // LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point );
- // //使用TranslateAnimation,填写一个需要移动的目标点
- // Animation animation = new TranslateAnimation( target );
- // animation.setInterpolator( interpolator );
- // //整个移动所需要的时间
- // animation.setDuration( duration );
- // //设置动画
- // if ( marker instanceof AMapMarkerWrapper ) {
- // ( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation );
- // ( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation();
- // }
- } catch (Exception e) {
- Logger.e(TAG, e, "error.");
- }
- }
-
@Override
public void setRenderFps(int fps) {
if (checkAMapView()) {
@@ -833,14 +802,6 @@ public class AMapViewWrapper implements IMogoMapView,
//showSelfSpeed(location.getSpeed());
}
- private int mDrawlevel;
-
- @Override
- public void setAdasRecognizedResult(int drawlevel) {
- mDrawlevel = drawlevel;
- }
-
-
private TextView mSpeedView = null;
private int mLastYOffset = 20;
@@ -936,7 +897,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onMapStatusChanged(int type, int value) {
- // Logger.i( TAG, "mapop--onMapStatusChanged-: " + type + "," + value );
+ //Logger.i(TAG, "mapop--onMapStatusChanged-: " + type + "," + value);
}
@Override
@@ -961,7 +922,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onCameraChange(int type, int value) {
- // Logger.i( TAG, "mapop--onCameraChange-: " + type + "," + value );
+ //Logger.i(TAG, "mapop--onCameraChange-: " + type + "," + value);
}
@Override
@@ -977,24 +938,11 @@ public class AMapViewWrapper implements IMogoMapView,
}
}
- @Override
- public void setAnchorScale(float x, float y) {
- mMapView.getMapAutoViewHelper().setAnchorScale(x, y);
- }
-
- @Override
- public void setAnchorRate(float rate) {
- mMapView.getMapAutoViewHelper().setAnchorRate(rate);
- }
-
@Override
public void emphasizeMyLocation() {
}
- //目前切换完vr之后,会立即回调其他样式,这里做一个判断
- // private boolean mVrModeAutoChangedFlag = false;
-
@Override
public void onChangeMapStyle(int i) {
@@ -1012,11 +960,6 @@ public class AMapViewWrapper implements IMogoMapView,
// 进入vr模式的时候自动切换到车头朝上
change2CarUp();
}
- // else if ( i == MapAutoApi.MAP_PERSPECTIVE_2D ) {
- // mCurrentUI = EnumMapUI.CarUp_2D;
- // } else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) {
- // mCurrentUI = EnumMapUI.CarUp_3D;
- // }
if (last == mCurrentUI) {
Logger.d(TAG, "currentUI is same as last = %s", mCurrentUI);
@@ -1024,17 +967,11 @@ public class AMapViewWrapper implements IMogoMapView,
}
// vr 模式切换到普通模式下,保持之前的白天模式 wtf.
- if (last == EnumMapUI.Type_VR
- && mCurrentUI != last
- && mCurrentUI != EnumMapUI.Type_Light) {
+ if (last == EnumMapUI.Type_VR && mCurrentUI != EnumMapUI.Type_Light) {
if (mIsLightStyle) {
changeMapMode(EnumMapUI.Type_Light);
return;
}
- // if ( mVrModeAutoChangedFlag ) {
- // mVrModeAutoChangedFlag = false;
- // return;
- // }
}
Logger.d(TAG, Log.getStackTraceString(new Throwable()));
if (mCurrentUI != null) {
@@ -1066,7 +1003,6 @@ public class AMapViewWrapper implements IMogoMapView,
if (isVrMode) {
if (mCurrentUI != EnumMapUI.Type_VR) {
Logger.d(TAG, "自动切换为vr模式");
- // mVrModeAutoChangedFlag = true;
changeMapMode(EnumMapUI.Type_VR);
}
} else {
diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java
index d51e914a16..745990d9e6 100644
--- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java
+++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java
@@ -4,10 +4,8 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.location.Location;
import android.view.View;
-import android.view.animation.Interpolator;
import com.mogo.eagle.core.data.map.MogoLatLng;
-import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -221,13 +219,6 @@ public class AMapUIController implements IMogoMapUIController {
return null;
}
- @Override
- public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
- long duration) {
- if (mClient != null) {
- mClient.startJumpAnimation(marker, high, interpolator, duration);
- }
- }
@Override
public void setRenderFps(int fps) {
@@ -308,21 +299,11 @@ public class AMapUIController implements IMogoMapUIController {
return MapAutoApi.INSTANCE.getTileID(lon, lat, 13); // 13为默认获取瓦片层级级别
}
- @Override
- public void setAnchorScale(float x, float y) {
-
- }
-
@Override
public void emphasizeMyLocation() {
}
- @Override
- public void setAnchorRate(float rate) {
-
- }
-
@Override
public void rtkEnable(boolean enable) {
if (mClient != null) {
@@ -374,10 +355,4 @@ public class AMapUIController implements IMogoMapUIController {
}
}
- @Override
- public void setAdasRecognizedResult(int drawlevel) {
- if (mClient != null) {
- mClient.setAdasRecognizedResult(drawlevel);
- }
- }
}
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java
index 7df23c1442..0cfcf107b2 100644
--- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java
@@ -172,20 +172,6 @@ public interface IMogoMapUIController {
*/
MogoLatLng getLocationMogoLatLngInScreen(Point point);
- /**
- * marker 跳跃动画
- *
- * Deprecated, instead of by {@link IMogoMarker#startJumpAnimation(float, long, Interpolator, OnMarkerAnimationListener)}
- *
- * @param marker 跳跃的 marker
- * @param high 跳跃的高度
- * @param interpolator 插值器
- * @param duration 动画时间
- */
- @Deprecated
- void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
- long duration);
-
/**
* 设置刷新帧率
*/
@@ -250,8 +236,6 @@ public interface IMogoMapUIController {
*/
void changeBearing(float bearing);
- void setAdasRecognizedResult(int drawlevel);
-
/**
* 获取瓦片id
*
@@ -262,13 +246,6 @@ public interface IMogoMapUIController {
long getTileId(double lon, double lat);
- default void setAnchorScale(float x, float y) {
-
- }
-
- default void setAnchorRate(float rate) {
-
- }
default void testGpsData() {
diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java
index 1178b5c2ba..7e20185931 100644
--- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java
+++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java
@@ -4,10 +4,8 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.location.Location;
import android.view.View;
-import android.view.animation.Interpolator;
import com.mogo.eagle.core.data.map.MogoLatLng;
-import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -255,14 +253,6 @@ public class MogoMapUIController implements IMogoMapUIController {
return null;
}
- @Override
- public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator, long duration) {
- initDelegate();
- if (mDelegate != null) {
- mDelegate.startJumpAnimation(marker, high, interpolator, duration);
- }
- }
-
@Override
public void setRenderFps(int fps) {
initDelegate();
@@ -420,12 +410,4 @@ public class MogoMapUIController implements IMogoMapUIController {
mDelegate.clearRoadCacheById(id);
}
}
-
- @Override
- public void setAdasRecognizedResult(int drawlevel) {
- initDelegate();
- if (mDelegate != null) {
- mDelegate.setAdasRecognizedResult(drawlevel);
- }
- }
}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java
index c82bc91192..be70a3baf3 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java
@@ -22,6 +22,8 @@ public class MogoModulePaths {
private static final List mModuleFunctions = new ArrayList<>();
+ private static final List mModuleFunctionServers = new ArrayList<>();
+
/**
* 地图模块 fragment 路径
*/
@@ -38,17 +40,6 @@ public class MogoModulePaths {
*/
public static final String PATH_ENTRANCE = "/extension/entrance";
-
- /**
- * 添加卡片模块
- *
- * @param path
- */
- @Deprecated
- public static void addModule(String path) {
- throw new IllegalArgumentException("this method can't be invoked.");
- }
-
/**
* 添加卡片模块
*
@@ -73,6 +64,18 @@ public class MogoModulePaths {
mModuleFunctions.add(module);
}
+ /**
+ * 添加 功能服务, 不带UI Fragment的
+ *
+ * @param module 功能模块
+ */
+ public static void addModuleFunctionServer(MogoModule module) {
+ if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
+ throw new IllegalArgumentException("module path can't be empty or null or blank");
+ }
+ mModuleFunctionServers.add(module);
+ }
+
/**
* 添加基础模块
*
@@ -96,4 +99,8 @@ public class MogoModulePaths {
public static List getModuleFunctions() {
return mModuleFunctions;
}
+
+ public static List getModuleFunctionServers() {
+ return mModuleFunctionServers;
+ }
}
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_switch_map_angle.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_switch_map_angle.png
deleted file mode 100644
index 3e1b96f3e3..0000000000
Binary files a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-1920x1000/module_switch_map_angle.png and /dev/null differ
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-2560x1440/module_switch_map_angle.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-2560x1440/module_switch_map_angle.png
deleted file mode 100644
index 3e1b96f3e3..0000000000
Binary files a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi-2560x1440/module_switch_map_angle.png and /dev/null differ
diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_switch_map_angle.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_switch_map_angle.png
deleted file mode 100644
index 3e1b96f3e3..0000000000
Binary files a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_switch_map_angle.png and /dev/null differ
diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi-2560x1440/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi-2560x1440/dimens.xml
index 2b86120186..4b98d8758d 100644
--- a/modules/mogo-module-extensions/src/main/res/values-xhdpi-2560x1440/dimens.xml
+++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi-2560x1440/dimens.xml
@@ -2,12 +2,4 @@
1100px
- 279px
- 119px
- 22px
- 36px
- 50px
- 60px
-
-
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
index 0985d97ed6..50d095a929 100644
--- a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
+++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
@@ -184,11 +184,4 @@
- 190px
- 76px
- 16px
- 24px
- 35px
- 38px
-
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/values/colors.xml b/modules/mogo-module-extensions/src/main/res/values/colors.xml
index 66347a003a..6ff588cc10 100644
--- a/modules/mogo-module-extensions/src/main/res/values/colors.xml
+++ b/modules/mogo-module-extensions/src/main/res/values/colors.xml
@@ -1,6 +1,5 @@
- #FFFFFF
#BF30334C
#fff
#f1f1f1
diff --git a/modules/mogo-module-extensions/src/main/res/values/dimens.xml b/modules/mogo-module-extensions/src/main/res/values/dimens.xml
index 064dab01f5..605838bb8c 100644
--- a/modules/mogo-module-extensions/src/main/res/values/dimens.xml
+++ b/modules/mogo-module-extensions/src/main/res/values/dimens.xml
@@ -244,12 +244,4 @@
400px
300px
- 190px
- 76px
- 16px
- 24px
- 35px
- 38px
-
-
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/res/values/strings.xml b/modules/mogo-module-extensions/src/main/res/values/strings.xml
index 2ffaf6481b..9c7601fdad 100644
--- a/modules/mogo-module-extensions/src/main/res/values/strings.xml
+++ b/modules/mogo-module-extensions/src/main/res/values/strings.xml
@@ -69,7 +69,5 @@
- 提前看看出行路况,试试唤醒小智说,“中关村路况怎么样”
- 近距视角
- 远距视角
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java
index 22bd187896..c48de48d45 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesHandler.java
@@ -29,6 +29,11 @@ public interface MogoModulesHandler {
*/
void loadFunctionModules();
+ /**
+ * 架构升级v1.1加载功能模块
+ */
+ void loadFunctionModulesServer();
+
/**
* 加载地图
*
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
index 4165878884..602920c58d 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
@@ -5,8 +5,10 @@ import android.content.Context;
import androidx.fragment.app.Fragment;
+import com.alibaba.android.arouter.facade.template.IProvider;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
+import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
@@ -43,6 +45,10 @@ public class MogoModulesManager implements MogoModulesHandler {
private Map< MogoModule, IMoGoFunctionProvider> mModuleFunctionProviders = new HashMap<>();
private Map< String, IMoGoFunctionProvider> mModuleNameFunctionProviders = new HashMap<>();
+ // 架构升级后的加载功能模块的方式
+ private Map< MogoModule, IMoGoFunctionServerProvider> mModuleFunctionServerProviders = new HashMap<>();
+ private Map< String, IMoGoFunctionServerProvider> mModuleNameFunctionServerProviders = new HashMap<>();
+
private static volatile MogoModulesManager sInstance;
private MogoModulesManager() {
@@ -121,6 +127,21 @@ public class MogoModulesManager implements MogoModulesHandler {
}
}
+ @Override
+ public void loadFunctionModulesServer() {
+ final List< MogoModule > modules = MogoModulePaths.getModuleFunctionServers();
+ if ( modules != null && !modules.isEmpty() ) {
+ for ( MogoModule module : modules ) {
+ Logger.d( TAG, "module.getPath():" + module.getPath() + " name: " + module.getName() );
+ IMoGoFunctionServerProvider provider = loadFunctionServer( module.getPath() );
+ if ( provider != null ) {
+ mModuleFunctionServerProviders.put( module, provider );
+ mModuleNameFunctionServerProviders.put( module.getName(), provider );
+ }
+ }
+ }
+ }
+
@Override
public void loadMapModule( int containerId ) {
Logger.d( TAG, "loadMapModule" );
@@ -168,7 +189,7 @@ public class MogoModulesManager implements MogoModulesHandler {
continue;
}
Logger.d( TAG, "加载基本模块:%s", baseModule.getPath() );
- load( baseModule.getPath() );
+ loadBaseProvider( baseModule.getPath() );
}
}
@@ -181,6 +202,15 @@ public class MogoModulesManager implements MogoModulesHandler {
}
+ private IProvider loadBaseProvider(String path ) {
+ try {
+ return ( IProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
private IMogoModuleProvider load( String path ) {
try {
return ( IMogoModuleProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
@@ -199,6 +229,15 @@ public class MogoModulesManager implements MogoModulesHandler {
}
}
+ private IMoGoFunctionServerProvider loadFunctionServer(String path ) {
+ try {
+ return ( IMoGoFunctionServerProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
private void addFragment( IMogoModuleProvider provider, int containerId ) {
if ( provider == null ) {
Logger.e( TAG, "add fragment fail cause provider == null, container is %s", ResourcesHelper.getResNameById( getApplicationContext(), containerId ) );
@@ -272,6 +311,23 @@ public class MogoModulesManager implements MogoModulesHandler {
if ( mModuleFunctionProviders != null ) {
mModuleFunctionProviders.clear();
}
+ if ( mModuleFunctionServerProviders != null ) {
+ Collection< IMoGoFunctionServerProvider > modules = mModuleFunctionServerProviders.values();
+ if ( modules != null ) {
+ for ( IMoGoFunctionServerProvider module : modules ) {
+ try {
+ Logger.d( TAG, "destroy module: " + module.getFunctionName() );
+ module.onDestroy();
+ } catch ( Exception e ) {
+ Logger.e( TAG, e, "onDestroy" );
+ }
+ }
+ }
+ mModuleNameFunctionProviders.clear();
+ }
+ if ( mModuleFunctionServerProviders != null ) {
+ mModuleFunctionServerProviders.clear();
+ }
mActivity = null;
}
}
diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
index fe5eca8a59..79e6546233 100644
--- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
+++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
@@ -460,14 +460,7 @@ public class MogoADASController implements IMogoADASController {
@Override
public EnumMapUI getCurrentSkinMode() {
- if (!DebugConfig.isMapBased()) {
- return EnumMapUI.Type_Night;
- }
- boolean white = AdasConfigApiController.getInstance().isShowUISkinWhiteModel();
- if (!white) {
- return EnumMapUI.Type_Night;
- }
- return EnumMapUI.Type_Light;
+ return EnumMapUI.Type_VR;
}
@Override