Search in sources :

Example 1 with HttpModule

use of com.tool.common.di.module.HttpModule in project MVPFrames by RockyQu.

the class AppDelegate method onCreate.

@Override
public void onCreate(Application application) {
    this.application = application;
    component = DaggerAppComponent.builder().appModule(new AppModule(application)).httpModule(// Http模块
    new HttpModule()).appConfigModule(// 全局配置
    getAppConfigModule(application, modules)).build();
    component.inject(this);
    // 存放配置接口ConfigModule
    component.extras().put(ConfigModule.class.getName(), modules);
    this.modules = null;
    // 注入Activity生命周期
    application.registerActivityLifecycleCallbacks(activityLifecycle);
    for (Application.ActivityLifecycleCallbacks lifecycle : activityLifecycles) {
        application.registerActivityLifecycleCallbacks(lifecycle);
    }
    // 内存回收管理接口
    componentCallbacks = new AppComponentCallbacks(application, component);
    application.registerComponentCallbacks(componentCallbacks);
    // 注入Application生命周期
    for (ApplicationLifecycles lifecycle : applicationLifecycles) {
        lifecycle.onCreate(application);
    }
}
Also used : AppModule(com.tool.common.di.module.AppModule) AppConfigModule(com.tool.common.di.module.AppConfigModule) ConfigModule(com.tool.common.integration.ConfigModule) HttpModule(com.tool.common.di.module.HttpModule) Application(android.app.Application)

Aggregations

Application (android.app.Application)1 AppConfigModule (com.tool.common.di.module.AppConfigModule)1 AppModule (com.tool.common.di.module.AppModule)1 HttpModule (com.tool.common.di.module.HttpModule)1 ConfigModule (com.tool.common.integration.ConfigModule)1