opt
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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" );
|
||||
|
||||
Reference in New Issue
Block a user