This commit is contained in:
wangcongtao
2019-12-24 15:49:57 +08:00
parent 80cc1248b2
commit fea6d0bc61
133 changed files with 4878 additions and 194 deletions

View File

@@ -0,0 +1,20 @@
package com.mogo.service.module;
/**
* @author congtaowang
* @since 2019-12-23
* <p>
* 卡片生命周期
*/
public interface IMogoModuleLifecycle {
/**
* 卡片在最前面,可操作地图
*/
void onPerform();
/**
* 卡片不可用任何卡片的操作都会被launcher忽略
*/
void onDisable();
}

View File

@@ -0,0 +1,78 @@
package com.mogo.service.module;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.map.listener.IMogoMapListener;
/**
* @author congtaowang
* @since 2019-12-24
* <p>
* 模块 UI 接口
*/
public interface IMogoModuleProvider extends IProvider {
/**
* fragment 提供者
*/
int TYPE_FRAGMENT = 1;
/**
* view 提供者
*/
int TYPE_VIEW = 2;
/**
* 创建卡片
*
* @param context
* @return
*/
Fragment createFragment( Context context, Bundle data );
/**
* 创建view
*
* @param context
* @return
*/
View createView( Context context );
/**
* 唯一标识
*
* @return
*/
@NonNull
String getModuleName();
/**
* 生命周期控制方法
*
* @return
*/
IMogoModuleLifecycle getCardLifecycle();
/**
* 地图监听对象
*
* @return
*/
IMogoMapListener getMapListener();
/**
* 是哪种类型的提供者
* <p>
* {@link #TYPE_FRAGMENT}
* {@link #TYPE_VIEW}
*
* @return
*/
int getType();
}