if (!isModule.toBoolean()) {
implementation project(':b-main')
implementation project(':b-login')
implementation project(':b-setting')
}
代理的application的作用
LoginApplicationDelegate
/**
* login组件全局应用配置
* Created by chenran3 on 2017/12/6.
*/
@EFModuleAnnotation(moduleName = "b-login",delegateName = "com.cryallen.applogin.LoginApplicationDelegate")
public class LoginApplicationDelegate implements IApplicationDelegate {
private static final String TAG = "LoginApplicationDelegate";
@Override
public void onCreate() {
EFLog.d(TAG, "*------------------onCreate()---------------->");
}
@Override
public void enterBackground() {
EFLog.d(TAG, "*------------------enterBackground()---------------->");
}
@Override
public void enterForeground() {
EFLog.d(TAG, "*------------------enterForeground()---------------->");
}
@Override
public void receiveRemoteNotification(Map, String> message) {
EFLog.d(TAG, "receiveRemoteNotification msg = " + message);
}
@Override
public void onTerminate() {
EFLog.d(TAG, "*------------------onTerminate()---------------->");
}
@Override
public void onConfigurationChanged(Configuration configuration) {
EFLog.d(TAG, "*------------------onConfigurationChanged()---------------->");
}
@Override
public void onLowMemory() {
EFLog.d(TAG, "*------------------onLowMemory()---------------->");
}
@Override
public void onTrimMemory(int var1) {
EFLog.d(TAG, "*------------------onTrimMemory()---------------->");
}
}
sourceSets {
main {
if (isModule.toBoolean()) {
manifest.srcFile 'src/main/module/AndroidManifest.xml'
} else {
manifest.srcFile 'src/main/AndroidManifest.xml'
//集成开发模式下排除debug文件夹中的所有Java文件
java {
exclude 'debug/**'
}
}
}
}
/**
*
* 加载模块信息
*/
public void loadModule() {
Context context = getApplicationContext();
appDelegateList = new ArrayList();
delegateNameList = new ArrayList();
try {
AssetManager assetManager = context.getResources().getAssets();
String[] fileList = assetManager.list("");
int fileLength = fileList.length;
for(int i = 0; i < fileLength; ++i) {
String fileName = fileList[i];
if(fileName.startsWith(MODULE_PREFIX)) {
//解析json配置文件
ModuleInfo moduleInfo = parse(assetManager.open(fileName));
if(moduleInfo == null){
continue;
}
moduleInfoList.add(moduleInfo);
delegateNameList.add(moduleInfo.getPackageName());
EFLog.d(TAG, "load Module: " + moduleInfo.getModuleName());
}
}
appDelegateList.addAll(ModuleClassUtils.getObjectsWithClassName(context, IApplicationDelegate.class, delegateNameList));
} catch (Exception e) {
e.printStackTrace();
}
}
> Task :module_bracelet:processDebugManifest
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:50:5-69 Warning:
Element uses-permission#android.permission.FLASHLIGHT at AndroidManifest.xml:50:5-69 duplicated with element declared at AndroidManifest.xml:48:5-69
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:23:9-27:56 Warning:
activity#com.tencent.bugly.beta.ui.BetaActivity@tools:name was tagged at AndroidManifest.xml:23 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:23:9-27:56 Warning:
activity#com.tencent.bugly.beta.ui.BetaActivity@tools:configChanges was tagged at AndroidManifest.xml:23 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:23:9-27:56 Warning:
activity#com.tencent.bugly.beta.ui.BetaActivity@tools:theme was tagged at AndroidManifest.xml:23 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:29:9-39:20 Warning:
provider#com.tencent.bugly.beta.utils.BuglyFileProvider@tools:name was tagged at AndroidManifest.xml:29 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:29:9-39:20 Warning:
provider#com.tencent.bugly.beta.utils.BuglyFileProvider@tools:authorities was tagged at AndroidManifest.xml:29 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:29:9-39:20 Warning:
provider#com.tencent.bugly.beta.utils.BuglyFileProvider@tools:exported was tagged at AndroidManifest.xml:29 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml:29:9-39:20 Warning:
provider#com.tencent.bugly.beta.utils.BuglyFileProvider@tools:grantUriPermissions was tagged at AndroidManifest.xml:29 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml Warning:
meta-data#android.support.FILE_PROVIDER_PATHS@tools:name was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present
/Users/mac/android-bracelet/bracelet/module_bracelet/src/main/module/AndroidManifest.xml Warning:
meta-data#android.support.FILE_PROVIDER_PATHS@tools:resource was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present
android:id="@+id/frag_bracelet_debug"
android:layout_width="match_parent"
android:name="bracelet.yuedong.com.module_bracelet.fragment.BraceletFragment"
android:layout_height="match_parent">