This commit is contained in:
wangcongtao
2020-01-05 16:24:07 +08:00
parent a0aa63b89b
commit 323376dcec
77 changed files with 2518 additions and 567 deletions

View File

@@ -0,0 +1,51 @@
package com.mogo.module.common;
/**
* @author congtaowang
* @since 2020-01-03
* <p>
* 模块类型
*/
public interface ModuleType {
/**
* 卡片类型 - fragment
*/
int TYPE_CARD_FRAGMENT = 1;
/**
* 卡片类型 - view
*/
@Deprecated
int TYPE_CARD_VIEW = 2;
/**
* 服务类型的模块
*/
int TYPE_SERVICE = 3;
/**
* APP 列表模块
*/
int TYPE_APP_LIST = 4;
/**
* 小智语音形象
*/
int TYPE_VOICE = 5;
/**
* 地图模块
*/
int TYPE_MAP = 6;
/**
* 导航模块
*/
int TYPE_NAVI = 7;
/**
* 小智、天气、时间等
*/
int TYPE_EXTENSION = 8;
}

View File

@@ -18,6 +18,10 @@ public class MogoModule {
*/
private String mName;
/**
* @param path 模块加载路径
* @param name 模块名称
*/
public MogoModule( String path, String name ) {
this.mPath = path;
this.mName = name;

View File

@@ -29,13 +29,21 @@ public class MogoModulePaths {
@Keep
public static final String PATH_MODULE_APPS = "/appslist/ui";
/**
* 添加卡片模块
*
* @param path
*/
@Deprecated
public static void addModule( String path ) {
if ( TextUtils.isEmpty( path.replace( " ", "" ) ) ) {
throw new IllegalArgumentException( "module path can't be empty or null or blank" );
}
mMogoModules.add( new MogoModule( path, "" ) );
throw new IllegalArgumentException( "this method can't be invoked." );
}
/**
* 添加卡片模块
*
* @param module
*/
public static void addModule( MogoModule module ) {
if ( module == null || TextUtils.isEmpty( module.getPath().replace( " ", "" ) ) ) {
throw new IllegalArgumentException( "module path can't be empty or null or blank" );