Initial download manager
This commit is contained in:
@@ -5,6 +5,7 @@ import android.app.Application;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Component;
|
||||
import eu.kanade.mangafeed.data.services.DownloadService;
|
||||
import eu.kanade.mangafeed.data.services.LibraryUpdateService;
|
||||
import eu.kanade.mangafeed.injection.module.AppModule;
|
||||
import eu.kanade.mangafeed.injection.module.DataModule;
|
||||
@@ -42,6 +43,7 @@ public interface AppComponent {
|
||||
void inject(Source source);
|
||||
|
||||
void inject(LibraryUpdateService libraryUpdateService);
|
||||
void inject(DownloadService downloadService);
|
||||
|
||||
Application application();
|
||||
|
||||
|
||||
@@ -8,11 +8,10 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import eu.kanade.mangafeed.data.caches.CacheManager;
|
||||
import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
|
||||
import eu.kanade.mangafeed.data.helpers.DownloadManager;
|
||||
import eu.kanade.mangafeed.data.helpers.NetworkHelper;
|
||||
import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
|
||||
import eu.kanade.mangafeed.data.helpers.SourceManager;
|
||||
import rx.Scheduler;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Provide dependencies to the DataManager, mainly Helper classes and Retrofit services.
|
||||
@@ -32,12 +31,6 @@ public class DataModule {
|
||||
return new DatabaseHelper(app);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Scheduler provideSubscribeScheduler() {
|
||||
return Schedulers.io();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
CacheManager provideCacheManager(Application app) {
|
||||
@@ -56,4 +49,10 @@ public class DataModule {
|
||||
return new SourceManager(app);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DownloadManager provideDownloadManager(Application app, SourceManager sourceManager) {
|
||||
return new DownloadManager(app, sourceManager);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user