修复 模块加载 类型转换异常

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-15 18:57:07 +08:00
parent 0e119f8f55
commit da955835a2
35 changed files with 321 additions and 219 deletions

View File

@@ -22,6 +22,8 @@ public class MogoModulePaths {
private static final List<MogoModule> mModuleFunctions = new ArrayList<>();
private static final List<MogoModule> 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<MogoModule> getModuleFunctions() {
return mModuleFunctions;
}
public static List<MogoModule> getModuleFunctionServers() {
return mModuleFunctionServers;
}
}