From f63b7c8141d7efa005a8fee9b8eb9aa835f92902 Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 14 Nov 2015 19:20:39 +0100 Subject: [PATCH] Reorganize data package --- app/src/main/AndroidManifest.xml | 8 +-- .../data/{caches => cache}/CacheManager.java | 4 +- .../{helpers => database}/DatabaseHelper.java | 22 ++++---- .../{helpers => database}/DbOpenHelper.java | 6 +-- .../data/{ => database}/models/Chapter.java | 4 +- .../data/{ => database}/models/Manga.java | 4 +- .../resolvers/MangaWithUnreadGetResolver.java | 8 +-- .../tables/CategoriesTable.java | 2 +- .../{ => database}/tables/ChaptersTable.java | 2 +- .../tables/MangasCategoriesTable.java | 2 +- .../{ => database}/tables/MangasTable.java | 2 +- .../DownloadManager.java | 19 +++---- .../DownloadService.java | 5 +- .../{models => download/model}/Download.java | 7 ++- .../model}/DownloadQueue.java | 3 +- .../{helpers => network}/NetworkHelper.java | 54 +------------------ .../data/network/ProgressListener.java | 5 ++ .../data/network/ProgressResponseBody.java | 52 ++++++++++++++++++ .../PreferencesHelper.java | 4 +- .../{helpers => source}/SourceManager.java | 10 ++-- .../source}/base/BaseSource.java | 6 +-- .../{sources => data/source}/base/Source.java | 14 ++--- .../data/{models => source/model}/Page.java | 6 +-- .../source/online/english}/Batoto.java | 11 ++-- .../source/online/english}/Mangafox.java | 10 ++-- .../source/online/english}/Mangahere.java | 10 ++-- .../LibraryUpdateService.java | 8 +-- .../{events => event}/ChapterCountEvent.java | 2 +- .../DownloadChaptersEvent.java | 6 +-- .../SourceMangaChapterEvent.java | 8 +-- .../injection/component/AppComponent.java | 10 ++-- .../injection/module/DataModule.java | 12 ++--- .../ui/catalogue/CatalogueFragment.java | 2 +- .../ui/catalogue/CatalogueHolder.java | 2 +- .../ui/catalogue/CataloguePresenter.java | 8 +-- .../ui/catalogue/SourceFragment.java | 2 +- .../mangafeed/ui/catalogue/SourceHolder.java | 2 +- .../ui/catalogue/SourcePresenter.java | 6 +-- .../ui/download/DownloadAdapter.java | 2 +- .../ui/download/DownloadFragment.java | 2 +- .../mangafeed/ui/download/DownloadHolder.java | 2 +- .../ui/download/DownloadPresenter.java | 8 +-- .../mangafeed/ui/library/LibraryAdapter.java | 3 +- .../mangafeed/ui/library/LibraryFragment.java | 4 +- .../mangafeed/ui/library/LibraryHolder.java | 2 +- .../ui/library/LibraryPresenter.java | 4 +- .../mangafeed/ui/main/MainActivity.java | 2 +- .../mangafeed/ui/manga/MangaActivity.java | 2 +- .../mangafeed/ui/manga/MangaPresenter.java | 4 +- .../ui/manga/chapter/ChaptersAdapter.java | 2 +- .../ui/manga/chapter/ChaptersFragment.java | 4 +- .../ui/manga/chapter/ChaptersHolder.java | 3 +- .../ui/manga/chapter/ChaptersPresenter.java | 20 +++---- .../ui/manga/info/MangaInfoFragment.java | 2 +- .../ui/manga/info/MangaInfoPresenter.java | 6 +-- .../mangafeed/ui/reader/ReaderActivity.java | 4 +- .../mangafeed/ui/reader/ReaderPresenter.java | 16 +++--- .../ui/reader/viewer/base/BaseReader.java | 2 +- .../viewer/common/ViewPagerReaderAdapter.java | 2 +- .../common/ViewPagerReaderFragment.java | 2 +- .../viewer/horizontal/HorizontalReader.java | 2 +- .../viewer/horizontal/RightToLeftReader.java | 4 +- .../viewer/vertical/VerticalReader.java | 2 +- .../reader/viewer/webtoon/WebtoonAdapter.java | 2 +- .../reader/viewer/webtoon/WebtoonReader.java | 2 +- .../LoginDialogPreference.java | 6 +-- .../SettingsAccountsFragment.java | 8 +-- .../SettingsActivity.java | 2 +- .../SettingsDownloadsFragment.java | 4 +- .../SettingsMainFragment.java | 2 +- .../SettingsNestedFragment.java | 2 +- .../mangafeed/util/ChapterRecognition.java | 4 +- .../mangafeed/ChapterRecognitionTest.java | 4 +- 73 files changed, 248 insertions(+), 242 deletions(-) rename app/src/main/java/eu/kanade/mangafeed/data/{caches => cache}/CacheManager.java (98%) rename app/src/main/java/eu/kanade/mangafeed/data/{helpers => database}/DatabaseHelper.java (92%) rename app/src/main/java/eu/kanade/mangafeed/data/{helpers => database}/DbOpenHelper.java (84%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/models/Chapter.java (93%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/models/Manga.java (96%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/resolvers/MangaWithUnreadGetResolver.java (65%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/tables/CategoriesTable.java (86%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/tables/ChaptersTable.java (96%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/tables/MangasCategoriesTable.java (87%) rename app/src/main/java/eu/kanade/mangafeed/data/{ => database}/tables/MangasTable.java (98%) rename app/src/main/java/eu/kanade/mangafeed/data/{helpers => download}/DownloadManager.java (96%) rename app/src/main/java/eu/kanade/mangafeed/data/{services => download}/DownloadService.java (95%) rename app/src/main/java/eu/kanade/mangafeed/data/{models => download/model}/Download.java (81%) rename app/src/main/java/eu/kanade/mangafeed/data/{models => download/model}/DownloadQueue.java (91%) rename app/src/main/java/eu/kanade/mangafeed/data/{helpers => network}/NetworkHelper.java (68%) create mode 100644 app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java create mode 100644 app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java rename app/src/main/java/eu/kanade/mangafeed/data/{helpers => preference}/PreferencesHelper.java (96%) rename app/src/main/java/eu/kanade/mangafeed/data/{helpers => source}/SourceManager.java (82%) rename app/src/main/java/eu/kanade/mangafeed/{sources => data/source}/base/BaseSource.java (95%) rename app/src/main/java/eu/kanade/mangafeed/{sources => data/source}/base/Source.java (94%) rename app/src/main/java/eu/kanade/mangafeed/data/{models => source/model}/Page.java (92%) rename app/src/main/java/eu/kanade/mangafeed/{sources => data/source/online/english}/Batoto.java (97%) rename app/src/main/java/eu/kanade/mangafeed/{sources => data/source/online/english}/Mangafox.java (95%) rename app/src/main/java/eu/kanade/mangafeed/{sources => data/source/online/english}/Mangahere.java (97%) rename app/src/main/java/eu/kanade/mangafeed/data/{services => sync}/LibraryUpdateService.java (96%) rename app/src/main/java/eu/kanade/mangafeed/{events => event}/ChapterCountEvent.java (84%) rename app/src/main/java/eu/kanade/mangafeed/{events => event}/DownloadChaptersEvent.java (73%) rename app/src/main/java/eu/kanade/mangafeed/{events => event}/SourceMangaChapterEvent.java (71%) rename app/src/main/java/eu/kanade/mangafeed/ui/{preference => setting}/LoginDialogPreference.java (96%) rename app/src/main/java/eu/kanade/mangafeed/ui/{preference => setting}/SettingsAccountsFragment.java (88%) rename app/src/main/java/eu/kanade/mangafeed/ui/{preference => setting}/SettingsActivity.java (96%) rename app/src/main/java/eu/kanade/mangafeed/ui/{preference => setting}/SettingsDownloadsFragment.java (94%) rename app/src/main/java/eu/kanade/mangafeed/ui/{preference => setting}/SettingsMainFragment.java (97%) rename app/src/main/java/eu/kanade/mangafeed/ui/{preference => setting}/SettingsNestedFragment.java (96%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 832fda0768..c941898655 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,19 +39,19 @@ android:value=".ui.manga.MangaActivity" /> - - diff --git a/app/src/main/java/eu/kanade/mangafeed/data/caches/CacheManager.java b/app/src/main/java/eu/kanade/mangafeed/data/cache/CacheManager.java similarity index 98% rename from app/src/main/java/eu/kanade/mangafeed/data/caches/CacheManager.java rename to app/src/main/java/eu/kanade/mangafeed/data/cache/CacheManager.java index f43b1f1e56..2e0e3228fa 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/caches/CacheManager.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/cache/CacheManager.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.caches; +package eu.kanade.mangafeed.data.cache; import android.content.Context; @@ -15,7 +15,7 @@ import java.io.OutputStream; import java.lang.reflect.Type; import java.util.List; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.util.DiskUtils; import okio.BufferedSink; import okio.Okio; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DatabaseHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/database/DatabaseHelper.java similarity index 92% rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/DatabaseHelper.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/DatabaseHelper.java index d4e8400000..019bf6d8d7 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DatabaseHelper.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/DatabaseHelper.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.helpers; +package eu.kanade.mangafeed.data.database; import android.content.Context; @@ -16,16 +16,16 @@ import com.pushtorefresh.storio.sqlite.queries.RawQuery; import java.util.List; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.ChapterStorIOSQLiteDeleteResolver; -import eu.kanade.mangafeed.data.models.ChapterStorIOSQLiteGetResolver; -import eu.kanade.mangafeed.data.models.ChapterStorIOSQLitePutResolver; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.data.models.MangaStorIOSQLiteDeleteResolver; -import eu.kanade.mangafeed.data.models.MangaStorIOSQLitePutResolver; -import eu.kanade.mangafeed.data.resolvers.MangaWithUnreadGetResolver; -import eu.kanade.mangafeed.data.tables.ChaptersTable; -import eu.kanade.mangafeed.data.tables.MangasTable; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.ChapterStorIOSQLiteDeleteResolver; +import eu.kanade.mangafeed.data.database.models.ChapterStorIOSQLiteGetResolver; +import eu.kanade.mangafeed.data.database.models.ChapterStorIOSQLitePutResolver; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.database.models.MangaStorIOSQLiteDeleteResolver; +import eu.kanade.mangafeed.data.database.models.MangaStorIOSQLitePutResolver; +import eu.kanade.mangafeed.data.database.resolvers.MangaWithUnreadGetResolver; +import eu.kanade.mangafeed.data.database.tables.ChaptersTable; +import eu.kanade.mangafeed.data.database.tables.MangasTable; import eu.kanade.mangafeed.util.ChapterRecognition; import eu.kanade.mangafeed.util.PostResult; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DbOpenHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/database/DbOpenHelper.java similarity index 84% rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/DbOpenHelper.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/DbOpenHelper.java index 3a4de35a55..65b0cdd172 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DbOpenHelper.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/DbOpenHelper.java @@ -1,12 +1,12 @@ -package eu.kanade.mangafeed.data.helpers; +package eu.kanade.mangafeed.data.database; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.support.annotation.NonNull; -import eu.kanade.mangafeed.data.tables.ChaptersTable; -import eu.kanade.mangafeed.data.tables.MangasTable; +import eu.kanade.mangafeed.data.database.tables.ChaptersTable; +import eu.kanade.mangafeed.data.database.tables.MangasTable; public class DbOpenHelper extends SQLiteOpenHelper { diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Chapter.java b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Chapter.java similarity index 93% rename from app/src/main/java/eu/kanade/mangafeed/data/models/Chapter.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/models/Chapter.java index 2f43cd208e..eca4f5fc33 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/models/Chapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Chapter.java @@ -1,9 +1,9 @@ -package eu.kanade.mangafeed.data.models; +package eu.kanade.mangafeed.data.database.models; import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn; import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteType; -import eu.kanade.mangafeed.data.tables.ChaptersTable; +import eu.kanade.mangafeed.data.database.tables.ChaptersTable; @StorIOSQLiteType(table = ChaptersTable.TABLE) public class Chapter { diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Manga.java b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Manga.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/data/models/Manga.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/models/Manga.java index d886c30959..86ab303327 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/models/Manga.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Manga.java @@ -1,9 +1,9 @@ -package eu.kanade.mangafeed.data.models; +package eu.kanade.mangafeed.data.database.models; import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn; import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteType; -import eu.kanade.mangafeed.data.tables.MangasTable; +import eu.kanade.mangafeed.data.database.tables.MangasTable; @StorIOSQLiteType(table = MangasTable.TABLE) public class Manga { diff --git a/app/src/main/java/eu/kanade/mangafeed/data/resolvers/MangaWithUnreadGetResolver.java b/app/src/main/java/eu/kanade/mangafeed/data/database/resolvers/MangaWithUnreadGetResolver.java similarity index 65% rename from app/src/main/java/eu/kanade/mangafeed/data/resolvers/MangaWithUnreadGetResolver.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/resolvers/MangaWithUnreadGetResolver.java index f5e5eb8884..a5a2f91a65 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/resolvers/MangaWithUnreadGetResolver.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/resolvers/MangaWithUnreadGetResolver.java @@ -1,11 +1,11 @@ -package eu.kanade.mangafeed.data.resolvers; +package eu.kanade.mangafeed.data.database.resolvers; import android.database.Cursor; import android.support.annotation.NonNull; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.data.models.MangaStorIOSQLiteGetResolver; -import eu.kanade.mangafeed.data.tables.MangasTable; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.database.models.MangaStorIOSQLiteGetResolver; +import eu.kanade.mangafeed.data.database.tables.MangasTable; public class MangaWithUnreadGetResolver extends MangaStorIOSQLiteGetResolver { diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/CategoriesTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/CategoriesTable.java similarity index 86% rename from app/src/main/java/eu/kanade/mangafeed/data/tables/CategoriesTable.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/CategoriesTable.java index 5e5c56642d..bc56409e67 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/tables/CategoriesTable.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/CategoriesTable.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.tables; +package eu.kanade.mangafeed.data.database.tables; import android.support.annotation.NonNull; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/ChaptersTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/ChaptersTable.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/data/tables/ChaptersTable.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/ChaptersTable.java index 8dc9d5179d..548e6b8740 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/tables/ChaptersTable.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/ChaptersTable.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.tables; +package eu.kanade.mangafeed.data.database.tables; import android.support.annotation.NonNull; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasCategoriesTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasCategoriesTable.java similarity index 87% rename from app/src/main/java/eu/kanade/mangafeed/data/tables/MangasCategoriesTable.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasCategoriesTable.java index 9b641139cc..4799710f4b 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasCategoriesTable.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasCategoriesTable.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.tables; +package eu.kanade.mangafeed.data.database.tables; import android.support.annotation.NonNull; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasTable.java similarity index 98% rename from app/src/main/java/eu/kanade/mangafeed/data/tables/MangasTable.java rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasTable.java index 7323434134..57a1b64453 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasTable.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasTable.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.tables; +package eu.kanade.mangafeed.data.database.tables; import android.support.annotation.NonNull; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DownloadManager.java b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadManager.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/DownloadManager.java rename to app/src/main/java/eu/kanade/mangafeed/data/download/DownloadManager.java index b1cc6d4d98..b5f11659aa 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DownloadManager.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadManager.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.helpers; +package eu.kanade.mangafeed.data.download; import android.content.Context; @@ -16,14 +16,15 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.List; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Download; -import eu.kanade.mangafeed.data.models.DownloadQueue; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.data.services.DownloadService; -import eu.kanade.mangafeed.events.DownloadChaptersEvent; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.download.model.Download; +import eu.kanade.mangafeed.data.download.model.DownloadQueue; +import eu.kanade.mangafeed.data.source.model.Page; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.event.DownloadChaptersEvent; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.util.DiskUtils; import eu.kanade.mangafeed.util.DynamicConcurrentMergeOperator; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/services/DownloadService.java b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadService.java similarity index 95% rename from app/src/main/java/eu/kanade/mangafeed/data/services/DownloadService.java rename to app/src/main/java/eu/kanade/mangafeed/data/download/DownloadService.java index 730acda6e3..2b648a845d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/services/DownloadService.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadService.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.services; +package eu.kanade.mangafeed.data.download; import android.app.Service; import android.content.Context; @@ -12,8 +12,7 @@ import javax.inject.Inject; import de.greenrobot.event.EventBus; import eu.kanade.mangafeed.App; -import eu.kanade.mangafeed.data.helpers.DownloadManager; -import eu.kanade.mangafeed.events.DownloadChaptersEvent; +import eu.kanade.mangafeed.event.DownloadChaptersEvent; import eu.kanade.mangafeed.util.ContentObservable; import eu.kanade.mangafeed.util.EventBusHook; import eu.kanade.mangafeed.util.NetworkUtil; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Download.java b/app/src/main/java/eu/kanade/mangafeed/data/download/model/Download.java similarity index 81% rename from app/src/main/java/eu/kanade/mangafeed/data/models/Download.java rename to app/src/main/java/eu/kanade/mangafeed/data/download/model/Download.java index 1a8369610a..07b39908e2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/models/Download.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/download/model/Download.java @@ -1,9 +1,12 @@ -package eu.kanade.mangafeed.data.models; +package eu.kanade.mangafeed.data.download.model; import java.io.File; import java.util.List; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.model.Page; +import eu.kanade.mangafeed.data.source.base.Source; import rx.subjects.PublishSubject; public class Download { diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/DownloadQueue.java b/app/src/main/java/eu/kanade/mangafeed/data/download/model/DownloadQueue.java similarity index 91% rename from app/src/main/java/eu/kanade/mangafeed/data/models/DownloadQueue.java rename to app/src/main/java/eu/kanade/mangafeed/data/download/model/DownloadQueue.java index 9bbc8ee07e..2581f9998f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/models/DownloadQueue.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/download/model/DownloadQueue.java @@ -1,8 +1,9 @@ -package eu.kanade.mangafeed.data.models; +package eu.kanade.mangafeed.data.download.model; import java.util.ArrayList; import java.util.List; +import eu.kanade.mangafeed.data.download.model.Download; import rx.Observable; import rx.subjects.PublishSubject; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/NetworkHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/network/NetworkHelper.java similarity index 68% rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/NetworkHelper.java rename to app/src/main/java/eu/kanade/mangafeed/data/network/NetworkHelper.java index 30242c9c14..e5ae5bb5ab 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/NetworkHelper.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/network/NetworkHelper.java @@ -1,25 +1,17 @@ -package eu.kanade.mangafeed.data.helpers; +package eu.kanade.mangafeed.data.network; import com.squareup.okhttp.CacheControl; import com.squareup.okhttp.Headers; -import com.squareup.okhttp.MediaType; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.RequestBody; import com.squareup.okhttp.Response; -import com.squareup.okhttp.ResponseBody; -import java.io.IOException; import java.net.CookieManager; import java.net.CookiePolicy; import java.net.CookieStore; -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; import rx.Observable; public final class NetworkHelper { @@ -121,48 +113,4 @@ public final class NetworkHelper { return cookieManager.getCookieStore(); } - private static class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ProgressListener progressListener; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { - this.responseBody = responseBody; - this.progressListener = progressListener; - } - - @Override public MediaType contentType() { - return responseBody.contentType(); - } - - @Override public long contentLength() throws IOException { - return responseBody.contentLength(); - } - - @Override public BufferedSource source() throws IOException { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - @Override public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } - } - - public interface ProgressListener { - void update(long bytesRead, long contentLength, boolean done); - } - } diff --git a/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java new file mode 100644 index 0000000000..cdab93dcd5 --- /dev/null +++ b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java @@ -0,0 +1,5 @@ +package eu.kanade.mangafeed.data.network; + +public interface ProgressListener { + void update(long bytesRead, long contentLength, boolean done); +} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java new file mode 100644 index 0000000000..58a9654bcd --- /dev/null +++ b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java @@ -0,0 +1,52 @@ +package eu.kanade.mangafeed.data.network; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ProgressListener progressListener; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { + this.responseBody = responseBody; + this.progressListener = progressListener; + } + + @Override public MediaType contentType() { + return responseBody.contentType(); + } + + @Override public long contentLength() throws IOException { + return responseBody.contentLength(); + } + + @Override public BufferedSource source() throws IOException { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + @Override public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/PreferencesHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/PreferencesHelper.java rename to app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java index d772515c5a..a6a0417b42 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/PreferencesHelper.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.helpers; +package eu.kanade.mangafeed.data.preference; import android.content.Context; import android.content.SharedPreferences; @@ -7,7 +7,7 @@ import android.preference.PreferenceManager; import com.f2prateek.rx.preferences.RxSharedPreferences; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.util.DiskUtils; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/SourceManager.java b/app/src/main/java/eu/kanade/mangafeed/data/source/SourceManager.java similarity index 82% rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/SourceManager.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/SourceManager.java index 9087e12341..05bd4aead9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/SourceManager.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/SourceManager.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.helpers; +package eu.kanade.mangafeed.data.source; import android.content.Context; @@ -6,10 +6,10 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import eu.kanade.mangafeed.sources.Batoto; -import eu.kanade.mangafeed.sources.Mangahere; -import eu.kanade.mangafeed.sources.Mangafox; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.online.english.Batoto; +import eu.kanade.mangafeed.data.source.online.english.Mangahere; +import eu.kanade.mangafeed.data.source.online.english.Mangafox; +import eu.kanade.mangafeed.data.source.base.Source; public class SourceManager { diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/base/BaseSource.java b/app/src/main/java/eu/kanade/mangafeed/data/source/base/BaseSource.java similarity index 95% rename from app/src/main/java/eu/kanade/mangafeed/sources/base/BaseSource.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/base/BaseSource.java index 14fb794169..8526d92986 100644 --- a/app/src/main/java/eu/kanade/mangafeed/sources/base/BaseSource.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/base/BaseSource.java @@ -1,12 +1,12 @@ -package eu.kanade.mangafeed.sources.base; +package eu.kanade.mangafeed.data.source.base; import com.squareup.okhttp.Headers; import com.squareup.okhttp.Response; import java.util.List; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; import rx.Observable; public abstract class BaseSource { diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/base/Source.java b/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java similarity index 94% rename from app/src/main/java/eu/kanade/mangafeed/sources/base/Source.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java index f8040875fe..2c3398e75a 100644 --- a/app/src/main/java/eu/kanade/mangafeed/sources/base/Source.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.sources.base; +package eu.kanade.mangafeed.data.source.base; import android.content.Context; @@ -12,12 +12,12 @@ import java.util.List; import javax.inject.Inject; import eu.kanade.mangafeed.App; -import eu.kanade.mangafeed.data.caches.CacheManager; -import eu.kanade.mangafeed.data.helpers.NetworkHelper; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.cache.CacheManager; +import eu.kanade.mangafeed.data.network.NetworkHelper; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.model.Page; import rx.Observable; import rx.schedulers.Schedulers; diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Page.java b/app/src/main/java/eu/kanade/mangafeed/data/source/model/Page.java similarity index 92% rename from app/src/main/java/eu/kanade/mangafeed/data/models/Page.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/model/Page.java index 03289333c6..6ccdce66f4 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/models/Page.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/model/Page.java @@ -1,9 +1,9 @@ -package eu.kanade.mangafeed.data.models; +package eu.kanade.mangafeed.data.source.model; -import eu.kanade.mangafeed.data.helpers.NetworkHelper; +import eu.kanade.mangafeed.data.network.ProgressListener; import rx.subjects.PublishSubject; -public class Page implements NetworkHelper.ProgressListener { +public class Page implements ProgressListener { private int pageNumber; private String url; diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/Batoto.java b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Batoto.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/sources/Batoto.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Batoto.java index 7a8fde709e..b9158dd20a 100644 --- a/app/src/main/java/eu/kanade/mangafeed/sources/Batoto.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Batoto.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.sources; +package eu.kanade.mangafeed.data.source.online.english; import android.content.Context; @@ -21,10 +21,10 @@ import java.util.Date; import java.util.List; import java.util.Locale; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.base.Source; import rx.Observable; public class Batoto extends Source { @@ -400,4 +400,3 @@ public class Batoto extends Source { } } - diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/Mangafox.java b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangafox.java similarity index 95% rename from app/src/main/java/eu/kanade/mangafeed/sources/Mangafox.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangafox.java index 01e001181c..1d4fe2b470 100644 --- a/app/src/main/java/eu/kanade/mangafeed/sources/Mangafox.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangafox.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.sources; +package eu.kanade.mangafeed.data.source.online.english; import android.content.Context; @@ -10,10 +10,10 @@ import org.jsoup.select.Elements; import java.util.ArrayList; import java.util.List; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.base.Source; public class Mangafox extends Source { diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/Mangahere.java b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangahere.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/sources/Mangahere.java rename to app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangahere.java index 02a3cf2e02..2b2655c082 100644 --- a/app/src/main/java/eu/kanade/mangafeed/sources/Mangahere.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangahere.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.sources; +package eu.kanade.mangafeed.data.source.online.english; import android.content.Context; @@ -15,10 +15,10 @@ import java.util.Date; import java.util.List; import java.util.Locale; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.base.Source; import rx.Observable; public class Mangahere extends Source { diff --git a/app/src/main/java/eu/kanade/mangafeed/data/services/LibraryUpdateService.java b/app/src/main/java/eu/kanade/mangafeed/data/sync/LibraryUpdateService.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/data/services/LibraryUpdateService.java rename to app/src/main/java/eu/kanade/mangafeed/data/sync/LibraryUpdateService.java index bce498cc2b..fd618872ff 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/services/LibraryUpdateService.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/sync/LibraryUpdateService.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.data.services; +package eu.kanade.mangafeed.data.sync; import android.app.Service; import android.content.BroadcastReceiver; @@ -15,9 +15,9 @@ import javax.inject.Inject; import eu.kanade.mangafeed.App; import eu.kanade.mangafeed.BuildConfig; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.util.AndroidComponentUtil; import eu.kanade.mangafeed.util.NetworkUtil; import eu.kanade.mangafeed.util.NotificationUtil; diff --git a/app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java b/app/src/main/java/eu/kanade/mangafeed/event/ChapterCountEvent.java similarity index 84% rename from app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java rename to app/src/main/java/eu/kanade/mangafeed/event/ChapterCountEvent.java index f5de50ec90..4bed4ad880 100644 --- a/app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java +++ b/app/src/main/java/eu/kanade/mangafeed/event/ChapterCountEvent.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.events; +package eu.kanade.mangafeed.event; public class ChapterCountEvent { private int count; diff --git a/app/src/main/java/eu/kanade/mangafeed/events/DownloadChaptersEvent.java b/app/src/main/java/eu/kanade/mangafeed/event/DownloadChaptersEvent.java similarity index 73% rename from app/src/main/java/eu/kanade/mangafeed/events/DownloadChaptersEvent.java rename to app/src/main/java/eu/kanade/mangafeed/event/DownloadChaptersEvent.java index 0ff3de9789..855ec2433a 100644 --- a/app/src/main/java/eu/kanade/mangafeed/events/DownloadChaptersEvent.java +++ b/app/src/main/java/eu/kanade/mangafeed/event/DownloadChaptersEvent.java @@ -1,9 +1,9 @@ -package eu.kanade.mangafeed.events; +package eu.kanade.mangafeed.event; import java.util.List; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; public class DownloadChaptersEvent { private Manga manga; diff --git a/app/src/main/java/eu/kanade/mangafeed/events/SourceMangaChapterEvent.java b/app/src/main/java/eu/kanade/mangafeed/event/SourceMangaChapterEvent.java similarity index 71% rename from app/src/main/java/eu/kanade/mangafeed/events/SourceMangaChapterEvent.java rename to app/src/main/java/eu/kanade/mangafeed/event/SourceMangaChapterEvent.java index c26b8e920a..b08eb6fbfd 100644 --- a/app/src/main/java/eu/kanade/mangafeed/events/SourceMangaChapterEvent.java +++ b/app/src/main/java/eu/kanade/mangafeed/event/SourceMangaChapterEvent.java @@ -1,8 +1,8 @@ -package eu.kanade.mangafeed.events; +package eu.kanade.mangafeed.event; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.base.Source; public class SourceMangaChapterEvent { diff --git a/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java b/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java index f5c99ba063..893c4cfbc2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java +++ b/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java @@ -5,8 +5,8 @@ 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.data.download.DownloadService; +import eu.kanade.mangafeed.data.sync.LibraryUpdateService; import eu.kanade.mangafeed.injection.module.AppModule; import eu.kanade.mangafeed.injection.module.DataModule; import eu.kanade.mangafeed.ui.catalogue.CataloguePresenter; @@ -17,10 +17,10 @@ import eu.kanade.mangafeed.ui.manga.chapter.ChaptersPresenter; import eu.kanade.mangafeed.ui.manga.info.MangaInfoPresenter; import eu.kanade.mangafeed.ui.reader.ReaderPresenter; import eu.kanade.mangafeed.ui.catalogue.SourcePresenter; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.reader.ReaderActivity; -import eu.kanade.mangafeed.ui.preference.SettingsAccountsFragment; -import eu.kanade.mangafeed.ui.preference.SettingsDownloadsFragment; +import eu.kanade.mangafeed.ui.setting.SettingsAccountsFragment; +import eu.kanade.mangafeed.ui.setting.SettingsDownloadsFragment; @Singleton @Component( diff --git a/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java b/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java index c81f8cbb8d..a02d567c71 100644 --- a/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java +++ b/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java @@ -6,12 +6,12 @@ import javax.inject.Singleton; 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 eu.kanade.mangafeed.data.cache.CacheManager; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.download.DownloadManager; +import eu.kanade.mangafeed.data.network.NetworkHelper; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.SourceManager; /** * Provide dependencies to the DataManager, mainly Helper classes and Retrofit services. diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java index 0d76683979..61fd11891f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java @@ -21,7 +21,7 @@ import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnItemClick; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.ui.manga.MangaActivity; import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import eu.kanade.mangafeed.util.PageBundle; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java index 0ce9bb8f7d..a53502492e 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java @@ -8,7 +8,7 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Manga; import uk.co.ribot.easyadapter.ItemViewHolder; import uk.co.ribot.easyadapter.PositionInfo; import uk.co.ribot.easyadapter.annotations.LayoutId; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java index 0c5f059cf7..85dca61aa2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java @@ -9,10 +9,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import eu.kanade.mangafeed.util.PageBundle; import eu.kanade.mangafeed.util.RxPager; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java index 2c96fab898..bb74851cb5 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java @@ -13,7 +13,7 @@ import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnItemClick; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.main.MainActivity; import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java index 671242c3fc..7db940156f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java @@ -4,7 +4,7 @@ import android.view.View; import android.widget.TextView; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.source.base.Source; import uk.co.ribot.easyadapter.ItemViewHolder; import uk.co.ribot.easyadapter.PositionInfo; import uk.co.ribot.easyadapter.annotations.LayoutId; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java index a1bad5cc5c..8a32a5a6e2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java @@ -2,9 +2,9 @@ package eu.kanade.mangafeed.ui.catalogue; import javax.inject.Inject; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java index f5116d242d..25d021a2e6 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java @@ -2,7 +2,7 @@ package eu.kanade.mangafeed.ui.download; import android.content.Context; -import eu.kanade.mangafeed.data.models.Download; +import eu.kanade.mangafeed.data.download.model.Download; import uk.co.ribot.easyadapter.EasyRecyclerAdapter; public class DownloadAdapter extends EasyRecyclerAdapter { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java index 736cb25905..8cd6054e9f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java @@ -14,7 +14,7 @@ import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Download; +import eu.kanade.mangafeed.data.download.model.Download; import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java index 94526c0f66..2e3201bda8 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java @@ -5,7 +5,7 @@ import android.widget.ProgressBar; import android.widget.TextView; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Download; +import eu.kanade.mangafeed.data.download.model.Download; import uk.co.ribot.easyadapter.ItemViewHolder; import uk.co.ribot.easyadapter.PositionInfo; import uk.co.ribot.easyadapter.annotations.LayoutId; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java index 8dd19aaa4e..7eb6cfe30c 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java @@ -7,10 +7,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; -import eu.kanade.mangafeed.data.helpers.DownloadManager; -import eu.kanade.mangafeed.data.models.Download; -import eu.kanade.mangafeed.data.models.DownloadQueue; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.download.DownloadManager; +import eu.kanade.mangafeed.data.download.model.Download; +import eu.kanade.mangafeed.data.download.model.DownloadQueue; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import rx.Observable; import rx.Subscription; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java index 7338340ca1..a8eaa9907d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java @@ -6,8 +6,7 @@ import android.widget.Filterable; import java.util.List; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.ui.library.LibraryHolder; +import eu.kanade.mangafeed.data.database.models.Manga; import rx.Observable; import uk.co.ribot.easyadapter.EasyAdapter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java index 67e38db55f..e5d9191923 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java @@ -18,8 +18,8 @@ import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnItemClick; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.data.services.LibraryUpdateService; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.sync.LibraryUpdateService; import eu.kanade.mangafeed.ui.manga.MangaActivity; import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java index 5fac134d6b..adff27b124 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java @@ -8,7 +8,7 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Manga; import uk.co.ribot.easyadapter.ItemViewHolder; import uk.co.ribot.easyadapter.PositionInfo; import uk.co.ribot.easyadapter.annotations.LayoutId; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java index fc9a13a2ff..2cdac77e41 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java @@ -5,8 +5,8 @@ import android.util.SparseBooleanArray; import javax.inject.Inject; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import rx.Observable; import rx.Subscription; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java index 66fea77bd2..1344bc90bb 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java @@ -14,7 +14,7 @@ import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.ui.preference.SettingsActivity; +import eu.kanade.mangafeed.ui.setting.SettingsActivity; import eu.kanade.mangafeed.ui.base.activity.BaseActivity; import eu.kanade.mangafeed.ui.download.DownloadFragment; import eu.kanade.mangafeed.ui.library.LibraryFragment; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java index e025018b7b..0bad49da55 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java @@ -15,7 +15,7 @@ import android.view.MenuItem; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.ui.base.activity.BaseRxActivity; import eu.kanade.mangafeed.ui.manga.chapter.ChaptersFragment; import eu.kanade.mangafeed.ui.manga.info.MangaInfoFragment; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java index b7f8c5343c..e1f8cbdcbe 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java @@ -5,8 +5,8 @@ import android.os.Bundle; import javax.inject.Inject; import de.greenrobot.event.EventBus; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java index 4c5026882f..a08cabaaaf 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java @@ -9,7 +9,7 @@ import java.util.List; import eu.davidea.flexibleadapter.FlexibleAdapter; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Chapter; import eu.kanade.mangafeed.ui.base.fragment.BaseFragment; public class ChaptersAdapter extends FlexibleAdapter { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java index 347928f0ee..2589340531 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java @@ -18,8 +18,8 @@ import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.services.DownloadService; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.download.DownloadService; import eu.kanade.mangafeed.ui.manga.MangaActivity; import eu.kanade.mangafeed.ui.reader.ReaderActivity; import eu.kanade.mangafeed.ui.base.activity.BaseActivity; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java index d52b98b5e2..31657780d0 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java @@ -11,8 +11,7 @@ import android.widget.TextView; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.ui.manga.chapter.ChaptersAdapter; +import eu.kanade.mangafeed.data.database.models.Chapter; public class ChaptersHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java index 2e4d51dab9..9dd406e82c 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java @@ -8,16 +8,16 @@ import java.util.List; import javax.inject.Inject; import de.greenrobot.event.EventBus; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.helpers.DownloadManager; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.events.ChapterCountEvent; -import eu.kanade.mangafeed.events.DownloadChaptersEvent; -import eu.kanade.mangafeed.events.SourceMangaChapterEvent; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.download.DownloadManager; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.event.ChapterCountEvent; +import eu.kanade.mangafeed.event.DownloadChaptersEvent; +import eu.kanade.mangafeed.event.SourceMangaChapterEvent; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import eu.kanade.mangafeed.util.EventBusHook; import eu.kanade.mangafeed.util.PostResult; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java index d807331d86..72a985c42f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java @@ -16,7 +16,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java index 35288e2cad..b4d9c2e003 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java @@ -4,9 +4,9 @@ import android.os.Bundle; import javax.inject.Inject; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.events.ChapterCountEvent; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.event.ChapterCountEvent; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import eu.kanade.mangafeed.util.EventBusHook; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java index 04d5d77e8e..2e776f12b0 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java @@ -18,8 +18,8 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.App; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.base.activity.BaseRxActivity; import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader; import eu.kanade.mangafeed.ui.reader.viewer.horizontal.LeftToRightReader; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java index 1a88a78a0a..62ea34f4d9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java @@ -8,14 +8,14 @@ import java.util.List; import javax.inject.Inject; import de.greenrobot.event.EventBus; -import eu.kanade.mangafeed.data.helpers.DatabaseHelper; -import eu.kanade.mangafeed.data.helpers.DownloadManager; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.events.SourceMangaChapterEvent; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.database.DatabaseHelper; +import eu.kanade.mangafeed.data.download.DownloadManager; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; +import eu.kanade.mangafeed.data.source.model.Page; +import eu.kanade.mangafeed.event.SourceMangaChapterEvent; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import eu.kanade.mangafeed.util.EventBusHook; import icepick.State; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java index 4670e80568..fb0d07af4d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java @@ -5,7 +5,7 @@ import android.widget.FrameLayout; import java.util.List; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.reader.ReaderActivity; public abstract class BaseReader { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java index a2c5e7ee61..9d4d2d3feb 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java @@ -5,7 +5,7 @@ import android.support.v4.app.FragmentManager; import java.util.List; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; public class ViewPagerReaderAdapter extends SmartFragmentStatePagerAdapter { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java index abbb6c185d..aac1636cee 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java @@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.base.fragment.BaseFragment; import eu.kanade.mangafeed.ui.reader.ReaderActivity; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java index 908fac845f..aac13c9613 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java @@ -8,7 +8,7 @@ import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.reader.ReaderActivity; import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader; import eu.kanade.mangafeed.ui.reader.viewer.common.ViewPagerReaderAdapter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java index 3717e0d5e9..6a4958be9f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java @@ -6,7 +6,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.reader.ReaderActivity; public class RightToLeftReader extends HorizontalReader { @@ -20,7 +20,7 @@ public class RightToLeftReader extends HorizontalReader { ArrayList inversedPages = new ArrayList<>(pages); Collections.reverse(inversedPages); adapter.setPages(inversedPages); - viewPager.setCurrentItem(adapter.getCount()-1, false); + viewPager.setCurrentItem(adapter.getCount() - 1, false); } @Override diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java index c176014d7b..a4969ad4e9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java @@ -9,7 +9,7 @@ import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.reader.ReaderActivity; import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader; import eu.kanade.mangafeed.ui.reader.viewer.common.ViewPagerReaderAdapter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java index 5e08949222..4f5dee4b96 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.List; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter; import uk.co.ribot.easyadapter.ItemViewHolder; import uk.co.ribot.easyadapter.PositionInfo; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java index f9e0d75cc9..9329b6e0f1 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java @@ -7,7 +7,7 @@ import android.widget.FrameLayout; import java.util.List; -import eu.kanade.mangafeed.data.models.Page; +import eu.kanade.mangafeed.data.source.model.Page; import eu.kanade.mangafeed.ui.reader.ReaderActivity; import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader; import rx.Subscription; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/LoginDialogPreference.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/LoginDialogPreference.java index ca9660ff02..dfbfc07ff5 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/LoginDialogPreference.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.preference; +package eu.kanade.mangafeed.ui.setting; import android.app.AlertDialog; import android.content.Context; @@ -16,8 +16,8 @@ import com.dd.processbutton.iml.ActionProcessButton; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.util.ToastUtil; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsAccountsFragment.java similarity index 88% rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsAccountsFragment.java index 0c6dc9feaa..95cec0106a 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsAccountsFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.preference; +package eu.kanade.mangafeed.ui.setting; import android.os.Bundle; import android.preference.PreferenceFragment; @@ -10,9 +10,9 @@ import javax.inject.Inject; import eu.kanade.mangafeed.App; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.data.helpers.SourceManager; -import eu.kanade.mangafeed.sources.base.Source; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import eu.kanade.mangafeed.data.source.SourceManager; +import eu.kanade.mangafeed.data.source.base.Source; import eu.kanade.mangafeed.ui.base.activity.BaseActivity; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsActivity.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsActivity.java index f5b96e8179..becf45c763 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsActivity.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.preference; +package eu.kanade.mangafeed.ui.setting; import android.os.Bundle; import android.support.v7.widget.Toolbar; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsDownloadsFragment.java similarity index 94% rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsDownloadsFragment.java index 56d53752cc..cd0f024cfd 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsDownloadsFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.preference; +package eu.kanade.mangafeed.ui.setting; import android.os.Bundle; import android.preference.ListPreference; @@ -9,7 +9,7 @@ import javax.inject.Inject; import eu.kanade.mangafeed.App; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.data.helpers.PreferencesHelper; +import eu.kanade.mangafeed.data.preference.PreferencesHelper; import eu.kanade.mangafeed.ui.base.activity.BaseActivity; import eu.kanade.mangafeed.util.DiskUtils; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsMainFragment.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsMainFragment.java index 08333361dc..dbc92a6071 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsMainFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.preference; +package eu.kanade.mangafeed.ui.setting; import android.os.Bundle; import android.preference.PreferenceFragment; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsNestedFragment.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsNestedFragment.java index 8f429f5727..4a8209be7f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsNestedFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.preference; +package eu.kanade.mangafeed.ui.setting; import android.os.Bundle; import android.preference.PreferenceFragment; diff --git a/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java b/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java index ecc7c468f8..4ae12d3a59 100644 --- a/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java +++ b/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java @@ -5,8 +5,8 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; public class ChapterRecognition { diff --git a/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java b/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java index 165f8072d0..c2803c7e3b 100644 --- a/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java +++ b/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java @@ -3,8 +3,8 @@ package eu.kanade.mangafeed; import org.junit.Before; import org.junit.Test; -import eu.kanade.mangafeed.data.models.Chapter; -import eu.kanade.mangafeed.data.models.Manga; +import eu.kanade.mangafeed.data.database.models.Chapter; +import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.util.ChapterRecognition; import static org.hamcrest.Matchers.is;