From 4f604e828bcf39605c017ed3f7bf7647cee6ef5c Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 14 Nov 2015 17:10:55 +0100 Subject: [PATCH] Organize ui by feature instead of layer --- app/src/main/AndroidManifest.xml | 16 ++++---- .../injection/component/AppComponent.java | 28 +++++++------- .../base => base/activity}/BaseActivity.java | 2 +- .../activity}/BaseRxActivity.java | 3 +- .../base => base/fragment}/BaseFragment.java | 4 +- .../fragment}/BaseRxFragment.java | 3 +- .../base}/presenter/BasePresenter.java | 2 +- .../CatalogueFragment.java | 12 +++--- .../CatalogueHolder.java | 2 +- .../catalogue}/CataloguePresenter.java | 4 +- .../SourceFragment.java | 8 ++-- .../{holder => catalogue}/SourceHolder.java | 2 +- .../catalogue}/SourcePresenter.java | 4 +- .../DownloadAdapter.java | 3 +- .../DownloadFragment.java} | 14 +++---- .../{holder => download}/DownloadHolder.java | 2 +- .../download/DownloadPresenter.java} | 16 ++++---- .../{adapter => library}/LibraryAdapter.java | 4 +- .../LibraryFragment.java | 10 ++--- .../ui/{holder => library}/LibraryHolder.java | 2 +- .../library}/LibraryPresenter.java | 5 +-- .../ui/{activity => main}/MainActivity.java | 13 ++++--- .../MangaActivity.java} | 17 ++++----- .../manga/MangaPresenter.java} | 6 +-- .../chapter}/ChaptersAdapter.java | 10 ++--- .../chapter/ChaptersFragment.java} | 22 +++++------ .../chapter}/ChaptersHolder.java | 4 +- .../manga/chapter/ChaptersPresenter.java} | 8 ++-- .../info}/MangaInfoFragment.java | 5 +-- .../manga/info}/MangaInfoPresenter.java | 4 +- .../LoginDialogPreference.java | 2 +- .../SettingsAccountsFragment.java | 5 +-- .../SettingsActivity.java | 5 +-- .../SettingsDownloadsFragment.java | 4 +- .../SettingsMainFragment.java | 4 +- .../SettingsNestedFragment.java | 4 +- .../{activity => reader}/ReaderActivity.java | 27 +++++++------- .../reader}/ReaderPresenter.java | 4 +- .../viewer/base/BaseReader.java} | 8 ++-- .../SmartFragmentStatePagerAdapter.java | 2 +- .../common/ViewPagerReaderAdapter.java} | 9 ++--- .../common/ViewPagerReaderFragment.java} | 12 +++--- .../viewer/horizontal/HorizontalReader.java} | 37 ++++++------------- .../horizontal}/HorizontalViewPager.java | 8 ++-- .../viewer/horizontal/LeftToRightReader.java | 23 ++++++++++++ .../viewer/horizontal/RightToLeftReader.java} | 15 ++++---- .../viewer/vertical/VerticalReader.java} | 32 ++++++---------- .../viewer/vertical/VerticalViewPager.java | 19 ++++++++++ .../viewer/webtoon}/WebtoonAdapter.java | 4 +- .../viewer/webtoon/WebtoonReader.java} | 11 +++--- .../ui/viewer/LeftToRightViewer.java | 24 ------------ .../main/res/layout/activity_manga_detail.xml | 2 +- .../main/res/layout/fragment_catalogue.xml | 2 +- .../main/res/layout/fragment_manga_info.xml | 2 +- app/src/main/res/layout/fragment_source.xml | 2 +- ...oon_viewer.xml => item_webtoon_reader.xml} | 0 ...er_viewpager.xml => reader_horizontal.xml} | 4 +- ...ticalviewpager.xml => reader_vertical.xml} | 4 +- app/src/main/res/layout/viewer_webtoon.xml | 7 ---- app/src/main/res/menu/menu_manga_detail.xml | 2 +- .../eu/kanade/mangafeed/MainActivityTest.java | 2 +- 61 files changed, 245 insertions(+), 276 deletions(-) rename app/src/main/java/eu/kanade/mangafeed/ui/{activity/base => base/activity}/BaseActivity.java (94%) rename app/src/main/java/eu/kanade/mangafeed/ui/{activity/base => base/activity}/BaseRxActivity.java (96%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment/base => base/fragment}/BaseFragment.java (79%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment/base => base/fragment}/BaseRxFragment.java (96%) rename app/src/main/java/eu/kanade/mangafeed/{ => ui/base}/presenter/BasePresenter.java (95%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => catalogue}/CatalogueFragment.java (92%) rename app/src/main/java/eu/kanade/mangafeed/ui/{holder => catalogue}/CatalogueHolder.java (96%) rename app/src/main/java/eu/kanade/mangafeed/{presenter => ui/catalogue}/CataloguePresenter.java (98%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => catalogue}/SourceFragment.java (88%) rename app/src/main/java/eu/kanade/mangafeed/ui/{holder => catalogue}/SourceHolder.java (94%) rename app/src/main/java/eu/kanade/mangafeed/{presenter => ui/catalogue}/SourcePresenter.java (88%) rename app/src/main/java/eu/kanade/mangafeed/ui/{adapter => download}/DownloadAdapter.java (83%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment/DownloadQueueFragment.java => download/DownloadFragment.java} (85%) rename app/src/main/java/eu/kanade/mangafeed/ui/{holder => download}/DownloadHolder.java (97%) rename app/src/main/java/eu/kanade/mangafeed/{presenter/DownloadQueuePresenter.java => ui/download/DownloadPresenter.java} (90%) rename app/src/main/java/eu/kanade/mangafeed/ui/{adapter => library}/LibraryAdapter.java (95%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => library}/LibraryFragment.java (93%) rename app/src/main/java/eu/kanade/mangafeed/ui/{holder => library}/LibraryHolder.java (97%) rename app/src/main/java/eu/kanade/mangafeed/{presenter => ui/library}/LibraryPresenter.java (92%) rename app/src/main/java/eu/kanade/mangafeed/ui/{activity => main}/MainActivity.java (90%) rename app/src/main/java/eu/kanade/mangafeed/ui/{activity/MangaDetailActivity.java => manga/MangaActivity.java} (87%) rename app/src/main/java/eu/kanade/mangafeed/{presenter/MangaDetailPresenter.java => ui/manga/MangaPresenter.java} (88%) rename app/src/main/java/eu/kanade/mangafeed/ui/{adapter => manga/chapter}/ChaptersAdapter.java (81%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment/MangaChaptersFragment.java => manga/chapter/ChaptersFragment.java} (88%) rename app/src/main/java/eu/kanade/mangafeed/ui/{holder => manga/chapter}/ChaptersHolder.java (95%) rename app/src/main/java/eu/kanade/mangafeed/{presenter/MangaChaptersPresenter.java => ui/manga/chapter/ChaptersPresenter.java} (95%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => manga/info}/MangaInfoFragment.java (95%) rename app/src/main/java/eu/kanade/mangafeed/{presenter => ui/manga/info}/MangaInfoPresenter.java (94%) rename app/src/main/java/eu/kanade/mangafeed/ui/{dialog => preference}/LoginDialogPreference.java (98%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => preference}/SettingsAccountsFragment.java (91%) rename app/src/main/java/eu/kanade/mangafeed/ui/{activity => preference}/SettingsActivity.java (87%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => preference}/SettingsDownloadsFragment.java (94%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => preference}/SettingsMainFragment.java (93%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment => preference}/SettingsNestedFragment.java (91%) rename app/src/main/java/eu/kanade/mangafeed/ui/{activity => reader}/ReaderActivity.java (85%) rename app/src/main/java/eu/kanade/mangafeed/{presenter => ui/reader}/ReaderPresenter.java (97%) rename app/src/main/java/eu/kanade/mangafeed/ui/{viewer/base/BaseViewer.java => reader/viewer/base/BaseReader.java} (84%) rename app/src/main/java/eu/kanade/mangafeed/ui/{adapter => reader/viewer/common}/SmartFragmentStatePagerAdapter.java (96%) rename app/src/main/java/eu/kanade/mangafeed/ui/{adapter/ViewerPagerAdapter.java => reader/viewer/common/ViewPagerReaderAdapter.java} (66%) rename app/src/main/java/eu/kanade/mangafeed/ui/{fragment/ReaderPageFragment.java => reader/viewer/common/ViewPagerReaderFragment.java} (93%) rename app/src/main/java/eu/kanade/mangafeed/ui/{viewer/base/ViewPagerViewer.java => reader/viewer/horizontal/HorizontalReader.java} (65%) rename app/src/main/java/eu/kanade/mangafeed/{widget => ui/reader/viewer/horizontal}/HorizontalViewPager.java (96%) create mode 100644 app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java rename app/src/main/java/eu/kanade/mangafeed/ui/{viewer/RightToLeftViewer.java => reader/viewer/horizontal/RightToLeftReader.java} (66%) rename app/src/main/java/eu/kanade/mangafeed/ui/{viewer/VerticalViewer.java => reader/viewer/vertical/VerticalReader.java} (55%) create mode 100644 app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalViewPager.java rename app/src/main/java/eu/kanade/mangafeed/ui/{adapter => reader/viewer/webtoon}/WebtoonAdapter.java (96%) rename app/src/main/java/eu/kanade/mangafeed/ui/{viewer/WebtoonViewer.java => reader/viewer/webtoon/WebtoonReader.java} (90%) delete mode 100644 app/src/main/java/eu/kanade/mangafeed/ui/viewer/LeftToRightViewer.java rename app/src/main/res/layout/{item_webtoon_viewer.xml => item_webtoon_reader.xml} (100%) rename app/src/main/res/layout/{viewer_viewpager.xml => reader_horizontal.xml} (60%) rename app/src/main/res/layout/{viewer_verticalviewpager.xml => reader_vertical.xml} (62%) delete mode 100644 app/src/main/res/layout/viewer_webtoon.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d4d21efea9..832fda0768 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,7 +14,7 @@ android:label="@string/app_name" android:theme="@style/AppTheme" > @@ -25,23 +25,23 @@ + android:parentActivityName=".ui.main.MainActivity" > + android:value=".ui.manga.MangaActivity" /> + android:parentActivityName=".ui.main.MainActivity" > { public void onMangaClick(int position) { Manga selectedManga = adapter.getItem(position); - Intent intent = MangaDetailActivity.newIntent(getActivity(), selectedManga); - intent.putExtra(MangaDetailActivity.MANGA_ONLINE, true); + Intent intent = MangaActivity.newIntent(getActivity(), selectedManga); + intent.putExtra(MangaActivity.MANGA_ONLINE, true); startActivity(intent); } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/holder/CatalogueHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/ui/holder/CatalogueHolder.java rename to app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java index 2e316420d7..0ce9bb8f7d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/holder/CatalogueHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.holder; +package eu.kanade.mangafeed.ui.catalogue; import android.view.View; import android.widget.ImageView; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/CataloguePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java similarity index 98% rename from app/src/main/java/eu/kanade/mangafeed/presenter/CataloguePresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java index 2e5441ab2c..0c5f059cf7 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/CataloguePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.presenter; +package eu.kanade.mangafeed.ui.catalogue; import android.os.Bundle; @@ -13,7 +13,7 @@ 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.ui.fragment.CatalogueFragment; +import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import eu.kanade.mangafeed.util.PageBundle; import eu.kanade.mangafeed.util.RxPager; import icepick.State; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SourceFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java similarity index 88% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/SourceFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java index 7c7515bdaf..2c96fab898 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SourceFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.catalogue; import android.os.Bundle; import android.view.LayoutInflater; @@ -13,11 +13,9 @@ import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnItemClick; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.presenter.SourcePresenter; import eu.kanade.mangafeed.sources.base.Source; -import eu.kanade.mangafeed.ui.activity.MainActivity; -import eu.kanade.mangafeed.ui.holder.SourceHolder; -import eu.kanade.mangafeed.ui.fragment.base.BaseRxFragment; +import eu.kanade.mangafeed.ui.main.MainActivity; +import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; import uk.co.ribot.easyadapter.EasyAdapter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/holder/SourceHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java similarity index 94% rename from app/src/main/java/eu/kanade/mangafeed/ui/holder/SourceHolder.java rename to app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java index de0a65641a..671242c3fc 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/holder/SourceHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.holder; +package eu.kanade.mangafeed.ui.catalogue; import android.view.View; import android.widget.TextView; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java similarity index 88% rename from app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java index 3f87ade20f..a1bad5cc5c 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java @@ -1,11 +1,11 @@ -package eu.kanade.mangafeed.presenter; +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.ui.fragment.SourceFragment; +import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; public class SourcePresenter extends BasePresenter { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/DownloadAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java similarity index 83% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/DownloadAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java index ce0bbb6ce4..f5116d242d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/DownloadAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java @@ -1,9 +1,8 @@ -package eu.kanade.mangafeed.ui.adapter; +package eu.kanade.mangafeed.ui.download; import android.content.Context; import eu.kanade.mangafeed.data.models.Download; -import eu.kanade.mangafeed.ui.holder.DownloadHolder; import uk.co.ribot.easyadapter.EasyRecyclerAdapter; public class DownloadAdapter extends EasyRecyclerAdapter { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/DownloadQueueFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java similarity index 85% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/DownloadQueueFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java index 6225e05278..736cb25905 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/DownloadQueueFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.download; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; @@ -15,20 +15,18 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Download; -import eu.kanade.mangafeed.presenter.DownloadQueuePresenter; -import eu.kanade.mangafeed.ui.adapter.DownloadAdapter; -import eu.kanade.mangafeed.ui.fragment.base.BaseRxFragment; +import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; -@RequiresPresenter(DownloadQueuePresenter.class) -public class DownloadQueueFragment extends BaseRxFragment { +@RequiresPresenter(DownloadPresenter.class) +public class DownloadFragment extends BaseRxFragment { @Bind(R.id.download_list) RecyclerView downloadList; private LinearLayoutManager downloadListLayout; private DownloadAdapter adapter; - public static DownloadQueueFragment newInstance() { - return new DownloadQueueFragment(); + public static DownloadFragment newInstance() { + return new DownloadFragment(); } @Override diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/holder/DownloadHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/ui/holder/DownloadHolder.java rename to app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java index 8843eb0fa4..94526c0f66 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/holder/DownloadHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.holder; +package eu.kanade.mangafeed.ui.download; import android.view.View; import android.widget.ProgressBar; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/DownloadQueuePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java similarity index 90% rename from app/src/main/java/eu/kanade/mangafeed/presenter/DownloadQueuePresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java index cd893b9d72..8dd19aaa4e 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/DownloadQueuePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.presenter; +package eu.kanade.mangafeed.ui.download; import android.os.Bundle; @@ -11,7 +11,7 @@ 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.ui.fragment.DownloadQueueFragment; +import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; @@ -19,7 +19,7 @@ import rx.schedulers.Schedulers; import rx.subjects.PublishSubject; import timber.log.Timber; -public class DownloadQueuePresenter extends BasePresenter { +public class DownloadPresenter extends BasePresenter { @Inject DownloadManager downloadManager; @@ -40,7 +40,7 @@ public class DownloadQueuePresenter extends BasePresenter restartableLatestCache(GET_DOWNLOAD_QUEUE, () -> Observable.just(downloadQueue.get()), - DownloadQueueFragment::onNextDownloads, + DownloadFragment::onNextDownloads, (view, error) -> Timber.e(error.getMessage())); if (savedState == null) @@ -48,7 +48,7 @@ public class DownloadQueuePresenter extends BasePresenter } @Override - protected void onTakeView(DownloadQueueFragment view) { + protected void onTakeView(DownloadFragment view) { super.onTakeView(view); add(statusSubscription = downloadQueue.getStatusObservable() @@ -65,7 +65,7 @@ public class DownloadQueuePresenter extends BasePresenter super.onDropView(); } - private void processStatus(Download download, DownloadQueueFragment view) { + private void processStatus(Download download, DownloadFragment view) { switch (download.getStatus()) { case Download.DOWNLOADING: observeProgress(download, view); @@ -84,7 +84,7 @@ public class DownloadQueuePresenter extends BasePresenter } } - private void observeProgress(Download download, DownloadQueueFragment view) { + private void observeProgress(Download download, DownloadFragment view) { Subscription subscription = Observable.interval(50, TimeUnit.MILLISECONDS, Schedulers.newThread()) .flatMap(tick -> Observable.from(download.pages) .map(Page::getProgress) @@ -104,7 +104,7 @@ public class DownloadQueuePresenter extends BasePresenter progressSubscriptions.put(download, subscription); } - private void observePagesStatus(Download download, DownloadQueueFragment view) { + private void observePagesStatus(Download download, DownloadFragment view) { PublishSubject pageStatusSubject = PublishSubject.create(); for (Page page : download.pages) { if (page.getStatus() != Page.READY) diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/LibraryAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java similarity index 95% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/LibraryAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java index 77bd90a9f8..7338340ca1 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/LibraryAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.adapter; +package eu.kanade.mangafeed.ui.library; import android.content.Context; import android.widget.Filter; @@ -7,7 +7,7 @@ import android.widget.Filterable; import java.util.List; import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.ui.holder.LibraryHolder; +import eu.kanade.mangafeed.ui.library.LibraryHolder; import rx.Observable; import uk.co.ribot.easyadapter.EasyAdapter; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java similarity index 93% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java index 8324bd2c4e..67e38db55f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.library; import android.content.Intent; import android.os.Bundle; @@ -20,10 +20,8 @@ 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.presenter.LibraryPresenter; -import eu.kanade.mangafeed.ui.activity.MangaDetailActivity; -import eu.kanade.mangafeed.ui.adapter.LibraryAdapter; -import eu.kanade.mangafeed.ui.fragment.base.BaseRxFragment; +import eu.kanade.mangafeed.ui.manga.MangaActivity; +import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; @RequiresPresenter(LibraryPresenter.class) @@ -107,7 +105,7 @@ public class LibraryFragment extends BaseRxFragment { @OnItemClick(R.id.gridView) protected void onMangaClick(int position) { - Intent intent = MangaDetailActivity.newIntent( + Intent intent = MangaActivity.newIntent( getActivity(), adapter.getItem(position) ); diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/holder/LibraryHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/ui/holder/LibraryHolder.java rename to app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java index 6cf11ad9e9..5fac134d6b 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/holder/LibraryHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.holder; +package eu.kanade.mangafeed.ui.library; import android.view.View; import android.widget.ImageView; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java similarity index 92% rename from app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java index 3ae59472db..fc9a13a2ff 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.presenter; +package eu.kanade.mangafeed.ui.library; import android.os.Bundle; import android.util.SparseBooleanArray; @@ -7,8 +7,7 @@ import javax.inject.Inject; import eu.kanade.mangafeed.data.helpers.DatabaseHelper; import eu.kanade.mangafeed.data.helpers.PreferencesHelper; -import eu.kanade.mangafeed.ui.adapter.LibraryAdapter; -import eu.kanade.mangafeed.ui.fragment.LibraryFragment; +import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java similarity index 90% rename from app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java rename to app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java index 92aebe0fc5..66fea77bd2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.activity; +package eu.kanade.mangafeed.ui.main; import android.content.Intent; import android.os.Bundle; @@ -14,10 +14,11 @@ import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.ui.activity.base.BaseActivity; -import eu.kanade.mangafeed.ui.fragment.DownloadQueueFragment; -import eu.kanade.mangafeed.ui.fragment.LibraryFragment; -import eu.kanade.mangafeed.ui.fragment.SourceFragment; +import eu.kanade.mangafeed.ui.preference.SettingsActivity; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; +import eu.kanade.mangafeed.ui.download.DownloadFragment; +import eu.kanade.mangafeed.ui.library.LibraryFragment; +import eu.kanade.mangafeed.ui.catalogue.SourceFragment; public class MainActivity extends BaseActivity { @@ -75,7 +76,7 @@ public class MainActivity extends BaseActivity { setFragment(SourceFragment.newInstance()); break; case R.id.nav_drawer_downloads: - setFragment(DownloadQueueFragment.newInstance()); + setFragment(DownloadFragment.newInstance()); break; case R.id.nav_drawer_settings: startActivity(new Intent(this, SettingsActivity.class)); diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/activity/MangaDetailActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java similarity index 87% rename from app/src/main/java/eu/kanade/mangafeed/ui/activity/MangaDetailActivity.java rename to app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java index 6a755206b6..e025018b7b 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/activity/MangaDetailActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.activity; +package eu.kanade.mangafeed.ui.manga; import android.content.Context; import android.content.Intent; @@ -16,14 +16,13 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.presenter.MangaDetailPresenter; -import eu.kanade.mangafeed.ui.activity.base.BaseRxActivity; -import eu.kanade.mangafeed.ui.fragment.MangaChaptersFragment; -import eu.kanade.mangafeed.ui.fragment.MangaInfoFragment; +import eu.kanade.mangafeed.ui.base.activity.BaseRxActivity; +import eu.kanade.mangafeed.ui.manga.chapter.ChaptersFragment; +import eu.kanade.mangafeed.ui.manga.info.MangaInfoFragment; import nucleus.factory.RequiresPresenter; -@RequiresPresenter(MangaDetailPresenter.class) -public class MangaDetailActivity extends BaseRxActivity { +@RequiresPresenter(MangaPresenter.class) +public class MangaActivity extends BaseRxActivity { @Bind(R.id.toolbar) Toolbar toolbar; @Bind(R.id.tabs) TabLayout tabs; @@ -37,7 +36,7 @@ public class MangaDetailActivity extends BaseRxActivity { public final static String MANGA_ONLINE = "manga_online"; public static Intent newIntent(Context context, Manga manga) { - Intent intent = new Intent(context, MangaDetailActivity.class); + Intent intent = new Intent(context, MangaActivity.class); intent.putExtra(MANGA_ID, manga.id); return intent; } @@ -127,7 +126,7 @@ public class MangaDetailActivity extends BaseRxActivity { case INFO_FRAGMENT: return MangaInfoFragment.newInstance(); case CHAPTERS_FRAGMENT: - return MangaChaptersFragment.newInstance(); + return ChaptersFragment.newInstance(); default: return null; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java similarity index 88% rename from app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java index c808979449..b7f8c5343c 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.presenter; +package eu.kanade.mangafeed.ui.manga; import android.os.Bundle; @@ -7,12 +7,12 @@ 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.ui.activity.MangaDetailActivity; +import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; -public class MangaDetailPresenter extends BasePresenter { +public class MangaPresenter extends BasePresenter { @Inject DatabaseHelper db; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ChaptersAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java similarity index 81% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/ChaptersAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java index 4cb0383cd1..4c5026882f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ChaptersAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.adapter; +package eu.kanade.mangafeed.ui.manga.chapter; import android.view.LayoutInflater; import android.view.View; @@ -10,9 +10,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.ui.fragment.MangaChaptersFragment; -import eu.kanade.mangafeed.ui.fragment.base.BaseFragment; -import eu.kanade.mangafeed.ui.holder.ChaptersHolder; +import eu.kanade.mangafeed.ui.base.fragment.BaseFragment; public class ChaptersAdapter extends FlexibleAdapter { @@ -50,7 +48,7 @@ public class ChaptersAdapter extends FlexibleAdapter { void onListItemLongClick(int position); } - public MangaChaptersFragment getMangaChaptersFragment() { - return (MangaChaptersFragment) fragment; + public ChaptersFragment getMangaChaptersFragment() { + return (ChaptersFragment) fragment; } } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/MangaChaptersFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java similarity index 88% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/MangaChaptersFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java index 94ae24872c..347928f0ee 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/MangaChaptersFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.manga.chapter; import android.content.Intent; import android.os.Bundle; @@ -20,17 +20,15 @@ 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.presenter.MangaChaptersPresenter; -import eu.kanade.mangafeed.ui.activity.MangaDetailActivity; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.activity.base.BaseActivity; -import eu.kanade.mangafeed.ui.adapter.ChaptersAdapter; -import eu.kanade.mangafeed.ui.fragment.base.BaseRxFragment; +import eu.kanade.mangafeed.ui.manga.MangaActivity; +import eu.kanade.mangafeed.ui.reader.ReaderActivity; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; +import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; import rx.Observable; -@RequiresPresenter(MangaChaptersPresenter.class) -public class MangaChaptersFragment extends BaseRxFragment implements +@RequiresPresenter(ChaptersPresenter.class) +public class ChaptersFragment extends BaseRxFragment implements ActionMode.Callback, ChaptersAdapter.OnItemClickListener { @Bind(R.id.chapter_list) RecyclerView chapters; @@ -40,8 +38,8 @@ public class MangaChaptersFragment extends BaseRxFragment { +public class ChaptersPresenter extends BasePresenter { @Inject DatabaseHelper db; @Inject SourceManager sourceManager; @@ -62,7 +62,7 @@ public class MangaChaptersPresenter extends BasePresenter } @Override - protected void onTakeView(MangaChaptersFragment view) { + protected void onTakeView(ChaptersFragment view) { super.onTakeView(view); registerForStickyEvents(); } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/MangaInfoFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java similarity index 95% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/MangaInfoFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java index 096736ff4e..d807331d86 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/MangaInfoFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.manga.info; import android.os.Bundle; import android.view.LayoutInflater; @@ -17,8 +17,7 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Manga; -import eu.kanade.mangafeed.presenter.MangaInfoPresenter; -import eu.kanade.mangafeed.ui.fragment.base.BaseRxFragment; +import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment; import nucleus.factory.RequiresPresenter; @RequiresPresenter(MangaInfoPresenter.class) diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java similarity index 94% rename from app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java index f09ffb2899..35288e2cad 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.presenter; +package eu.kanade.mangafeed.ui.manga.info; import android.os.Bundle; @@ -7,7 +7,7 @@ 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.ui.fragment.MangaInfoFragment; +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/dialog/LoginDialogPreference.java b/app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java similarity index 98% rename from app/src/main/java/eu/kanade/mangafeed/ui/dialog/LoginDialogPreference.java rename to app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java index 9b5f86bc72..ca9660ff02 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/dialog/LoginDialogPreference.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.dialog; +package eu.kanade.mangafeed.ui.preference; import android.app.AlertDialog; import android.content.Context; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsAccountsFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java similarity index 91% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsAccountsFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java index 0b96c20526..0c6dc9feaa 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsAccountsFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.preference; import android.os.Bundle; import android.preference.PreferenceFragment; @@ -13,8 +13,7 @@ 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.ui.activity.base.BaseActivity; -import eu.kanade.mangafeed.ui.dialog.LoginDialogPreference; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; import rx.Observable; public class SettingsAccountsFragment extends PreferenceFragment { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/activity/SettingsActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java similarity index 87% rename from app/src/main/java/eu/kanade/mangafeed/ui/activity/SettingsActivity.java rename to app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java index 5e7e3c751e..f5b96e8179 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/activity/SettingsActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.activity; +package eu.kanade.mangafeed.ui.preference; import android.os.Bundle; import android.support.v7.widget.Toolbar; @@ -7,8 +7,7 @@ import android.view.MenuItem; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.ui.activity.base.BaseActivity; -import eu.kanade.mangafeed.ui.fragment.SettingsMainFragment; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; public class SettingsActivity extends BaseActivity { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsDownloadsFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java similarity index 94% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsDownloadsFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java index 3699c2cda4..56d53752cc 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsDownloadsFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.preference; import android.os.Bundle; import android.preference.ListPreference; @@ -10,7 +10,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.ui.activity.base.BaseActivity; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; import eu.kanade.mangafeed.util.DiskUtils; public class SettingsDownloadsFragment extends PreferenceFragment { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsMainFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java similarity index 93% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsMainFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java index 115f37bf9e..08333361dc 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsMainFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java @@ -1,10 +1,10 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.preference; import android.os.Bundle; import android.preference.PreferenceFragment; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.ui.activity.base.BaseActivity; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; public class SettingsMainFragment extends PreferenceFragment { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsNestedFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java similarity index 91% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsNestedFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java index cb46429935..8f429f5727 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/SettingsNestedFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java @@ -1,9 +1,9 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.preference; import android.os.Bundle; import android.preference.PreferenceFragment; -import eu.kanade.mangafeed.ui.activity.base.BaseActivity; +import eu.kanade.mangafeed.ui.base.activity.BaseActivity; public class SettingsNestedFragment extends PreferenceFragment { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/activity/ReaderActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java similarity index 85% rename from app/src/main/java/eu/kanade/mangafeed/ui/activity/ReaderActivity.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java index 0b624a2621..04d5d77e8e 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/activity/ReaderActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.activity; +package eu.kanade.mangafeed.ui.reader; import android.content.Context; import android.content.Intent; @@ -20,13 +20,12 @@ 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.presenter.ReaderPresenter; -import eu.kanade.mangafeed.ui.activity.base.BaseRxActivity; -import eu.kanade.mangafeed.ui.viewer.LeftToRightViewer; -import eu.kanade.mangafeed.ui.viewer.RightToLeftViewer; -import eu.kanade.mangafeed.ui.viewer.VerticalViewer; -import eu.kanade.mangafeed.ui.viewer.WebtoonViewer; -import eu.kanade.mangafeed.ui.viewer.base.BaseViewer; +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; +import eu.kanade.mangafeed.ui.reader.viewer.horizontal.RightToLeftReader; +import eu.kanade.mangafeed.ui.reader.viewer.vertical.VerticalReader; +import eu.kanade.mangafeed.ui.reader.viewer.webtoon.WebtoonReader; import nucleus.factory.RequiresPresenter; @RequiresPresenter(ReaderPresenter.class) @@ -37,7 +36,7 @@ public class ReaderActivity extends BaseRxActivity { @Inject PreferencesHelper prefs; - private BaseViewer viewer; + private BaseReader viewer; private boolean isFullscreen; private static final int LEFT_TO_RIGHT = 1; @@ -146,16 +145,16 @@ public class ReaderActivity extends BaseRxActivity { enableFullScreen(); } - private BaseViewer getViewer() { + private BaseReader getViewer() { switch (prefs.getDefaultViewer()) { case LEFT_TO_RIGHT: default: - return new LeftToRightViewer(this, container); + return new LeftToRightReader(this, container); case RIGHT_TO_LEFT: - return new RightToLeftViewer(this, container); + return new RightToLeftReader(this, container); case VERTICAL: - return new VerticalViewer(this, container); + return new VerticalReader(this, container); case WEBTOON: - return new WebtoonViewer(this, container); + return new WebtoonReader(this, container); } } diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java index c5ee5923da..1a88a78a0a 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.presenter; +package eu.kanade.mangafeed.ui.reader; import android.os.Bundle; @@ -16,7 +16,7 @@ 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.ui.activity.ReaderActivity; +import eu.kanade.mangafeed.ui.base.presenter.BasePresenter; import eu.kanade.mangafeed.util.EventBusHook; import icepick.State; import rx.Observable; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/BaseViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java similarity index 84% rename from app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/BaseViewer.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java index 36887fb688..4670e80568 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/BaseViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.viewer.base; +package eu.kanade.mangafeed.ui.reader.viewer.base; import android.view.MotionEvent; import android.widget.FrameLayout; @@ -6,15 +6,15 @@ import android.widget.FrameLayout; import java.util.List; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; +import eu.kanade.mangafeed.ui.reader.ReaderActivity; -public abstract class BaseViewer { +public abstract class BaseReader { protected ReaderActivity activity; protected FrameLayout container; protected int currentPosition; - public BaseViewer(ReaderActivity activity, FrameLayout container) { + public BaseReader(ReaderActivity activity, FrameLayout container) { this.activity = activity; this.container = container; } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/SmartFragmentStatePagerAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/SmartFragmentStatePagerAdapter.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/SmartFragmentStatePagerAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/SmartFragmentStatePagerAdapter.java index 38ef584e43..85739d0c93 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/SmartFragmentStatePagerAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/SmartFragmentStatePagerAdapter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.adapter; +package eu.kanade.mangafeed.ui.reader.viewer.common; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ViewerPagerAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java similarity index 66% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/ViewerPagerAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java index 1035bca87d..a2c5e7ee61 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ViewerPagerAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.adapter; +package eu.kanade.mangafeed.ui.reader.viewer.common; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; @@ -6,13 +6,12 @@ import android.support.v4.app.FragmentManager; import java.util.List; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.fragment.ReaderPageFragment; -public class ViewerPagerAdapter extends SmartFragmentStatePagerAdapter { +public class ViewPagerReaderAdapter extends SmartFragmentStatePagerAdapter { private List pages; - public ViewerPagerAdapter(FragmentManager fragmentManager) { + public ViewPagerReaderAdapter(FragmentManager fragmentManager) { super(fragmentManager); } @@ -26,7 +25,7 @@ public class ViewerPagerAdapter extends SmartFragmentStatePagerAdapter { @Override public Fragment getItem(int position) { - return ReaderPageFragment.newInstance(pages.get(position)); + return ViewPagerReaderFragment.newInstance(pages.get(position)); } public List getPages() { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java similarity index 93% rename from app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java index 4e5e21dbf6..abbb6c185d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.fragment; +package eu.kanade.mangafeed.ui.reader.viewer.common; import android.os.Bundle; import android.support.annotation.Nullable; @@ -19,15 +19,15 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.fragment.base.BaseFragment; +import eu.kanade.mangafeed.ui.base.fragment.BaseFragment; +import eu.kanade.mangafeed.ui.reader.ReaderActivity; import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; import rx.subjects.PublishSubject; -public class ReaderPageFragment extends BaseFragment { +public class ViewPagerReaderFragment extends BaseFragment { @Bind(R.id.page_image_view) SubsamplingScaleImageView imageView; @Bind(R.id.progress_container) LinearLayout progressContainer; @@ -39,8 +39,8 @@ public class ReaderPageFragment extends BaseFragment { private Subscription progressSubscription; private Subscription statusSubscription; - public static ReaderPageFragment newInstance(Page page) { - ReaderPageFragment fragment = new ReaderPageFragment(); + public static ViewPagerReaderFragment newInstance(Page page) { + ViewPagerReaderFragment fragment = new ViewPagerReaderFragment(); fragment.setPage(page); return fragment; } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java similarity index 65% rename from app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java index 538c130e1a..908fac845f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.viewer.base; +package eu.kanade.mangafeed.ui.reader.viewer.horizontal; import android.view.MotionEvent; import android.widget.FrameLayout; @@ -9,39 +9,30 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.adapter.ViewerPagerAdapter; -import eu.kanade.mangafeed.widget.HorizontalViewPager; +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; -public abstract class ViewPagerViewer extends BaseViewer { +public abstract class HorizontalReader extends BaseReader { @Bind(R.id.view_pager) HorizontalViewPager viewPager; - protected ViewerPagerAdapter adapter; - public ViewPagerViewer(ReaderActivity activity, FrameLayout container) { + protected ViewPagerReaderAdapter adapter; + + public HorizontalReader(ReaderActivity activity, FrameLayout container) { super(activity, container); - activity.getLayoutInflater().inflate(R.layout.viewer_viewpager, container); + activity.getLayoutInflater().inflate(R.layout.reader_horizontal, container); ButterKnife.bind(this, container); - adapter = new ViewerPagerAdapter(activity.getSupportFragmentManager()); + adapter = new ViewPagerReaderAdapter(activity.getSupportFragmentManager()); viewPager.setAdapter(adapter); viewPager.setOffscreenPageLimit(3); - viewPager.addOnPageChangeListener(new HorizontalViewPager.OnPageChangeListener() { - @Override - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - - } - + viewPager.addOnPageChangeListener(new HorizontalViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { currentPosition = position; updatePageNumber(); } - - @Override - public void onPageScrollStateChanged(int state) { - - } }); viewPager.setOnChapterBoundariesOutListener(new HorizontalViewPager.OnChapterBoundariesOutListener() { @Override @@ -56,11 +47,7 @@ public abstract class ViewPagerViewer extends BaseViewer { }); viewPager.setOnChapterSingleTapListener(activity::onCenterSingleTap); } - - public HorizontalViewPager getViewPager() { - return viewPager; - } - + @Override public int getTotalPages() { return adapter.getCount(); diff --git a/app/src/main/java/eu/kanade/mangafeed/widget/HorizontalViewPager.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalViewPager.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/widget/HorizontalViewPager.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalViewPager.java index 5054f0b266..e6df4abc0d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/widget/HorizontalViewPager.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalViewPager.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.widget; +package eu.kanade.mangafeed.ui.reader.viewer.horizontal; import android.content.Context; import android.support.v4.view.ViewPager; @@ -84,13 +84,13 @@ public class HorizontalViewPager extends ViewPager { } public interface OnChapterBoundariesOutListener { - public void onFirstPageOutEvent(); + void onFirstPageOutEvent(); - public void onLastPageOutEvent(); + void onLastPageOutEvent(); } public interface OnChapterSingleTapListener { - public void onSingleTap(); + void onSingleTap(); } public void setOnChapterBoundariesOutListener(OnChapterBoundariesOutListener onChapterBoundariesOutListener) { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java new file mode 100644 index 0000000000..f2cc87ecbb --- /dev/null +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java @@ -0,0 +1,23 @@ +package eu.kanade.mangafeed.ui.reader.viewer.horizontal; + +import android.widget.FrameLayout; + +import eu.kanade.mangafeed.ui.reader.ReaderActivity; + +public class LeftToRightReader extends HorizontalReader { + + public LeftToRightReader(ReaderActivity activity, FrameLayout container) { + super(activity, container); + } + + @Override + public void onFirstPageOut() { + // TODO + } + + @Override + public void onLastPageOut() { + // TODO + } + +} diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/RightToLeftViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java similarity index 66% rename from app/src/main/java/eu/kanade/mangafeed/ui/viewer/RightToLeftViewer.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java index feca69e245..3717e0d5e9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/RightToLeftViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.viewer; +package eu.kanade.mangafeed.ui.reader.viewer.horizontal; import android.widget.FrameLayout; @@ -7,12 +7,11 @@ import java.util.Collections; import java.util.List; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.viewer.base.ViewPagerViewer; +import eu.kanade.mangafeed.ui.reader.ReaderActivity; -public class RightToLeftViewer extends ViewPagerViewer { +public class RightToLeftReader extends HorizontalReader { - public RightToLeftViewer(ReaderActivity activity, FrameLayout container) { + public RightToLeftReader(ReaderActivity activity, FrameLayout container) { super(activity, container); } @@ -21,7 +20,7 @@ public class RightToLeftViewer extends ViewPagerViewer { ArrayList inversedPages = new ArrayList<>(pages); Collections.reverse(inversedPages); adapter.setPages(inversedPages); - getViewPager().setCurrentItem(adapter.getCount()-1, false); + viewPager.setCurrentItem(adapter.getCount()-1, false); } @Override @@ -31,12 +30,12 @@ public class RightToLeftViewer extends ViewPagerViewer { @Override public void onFirstPageOut() { - + // TODO } @Override public void onLastPageOut() { - + // TODO } } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java similarity index 55% rename from app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java index 190046746b..c176014d7b 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.viewer; +package eu.kanade.mangafeed.ui.reader.viewer.vertical; import android.support.v4.view.ViewPager; import android.view.MotionEvent; @@ -10,40 +10,30 @@ import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.adapter.ViewerPagerAdapter; -import eu.kanade.mangafeed.ui.viewer.base.BaseViewer; -import fr.castorflex.android.verticalviewpager.VerticalViewPager; +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; -public class VerticalViewer extends BaseViewer { +public class VerticalReader extends BaseReader { @Bind(R.id.view_pager) VerticalViewPager viewPager; - private ViewerPagerAdapter adapter; - public VerticalViewer(ReaderActivity activity, FrameLayout container) { + private ViewPagerReaderAdapter adapter; + + public VerticalReader(ReaderActivity activity, FrameLayout container) { super(activity, container); - activity.getLayoutInflater().inflate(R.layout.viewer_verticalviewpager, container); + activity.getLayoutInflater().inflate(R.layout.reader_vertical, container); ButterKnife.bind(this, container); - adapter = new ViewerPagerAdapter(activity.getSupportFragmentManager()); + adapter = new ViewPagerReaderAdapter(activity.getSupportFragmentManager()); viewPager.setAdapter(adapter); viewPager.setOffscreenPageLimit(3); - viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { - @Override - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - - } - + viewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { currentPosition = position; updatePageNumber(); } - - @Override - public void onPageScrollStateChanged(int state) { - - } }); } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalViewPager.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalViewPager.java new file mode 100644 index 0000000000..a263a867e5 --- /dev/null +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalViewPager.java @@ -0,0 +1,19 @@ +package eu.kanade.mangafeed.ui.reader.viewer.vertical; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.GestureDetector; + +public class VerticalViewPager extends fr.castorflex.android.verticalviewpager.VerticalViewPager { + + private GestureDetector gestureDetector; + + public VerticalViewPager(Context context, AttributeSet attrs) { + super(context, attrs); + gestureDetector = new GestureDetector(getContext(), new ReaderViewGestureListener()); + } + + private class ReaderViewGestureListener extends GestureDetector.SimpleOnGestureListener { + // TODO + } +} diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/WebtoonAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java similarity index 96% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/WebtoonAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java index 7e0b403248..5e08949222 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/WebtoonAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.adapter; +package eu.kanade.mangafeed.ui.reader.viewer.webtoon; import android.content.Context; import android.view.View; @@ -47,7 +47,7 @@ public class WebtoonAdapter extends BaseEasyRecyclerAdapter { notifyItemChanged(page.getPageNumber()); } - @LayoutId(R.layout.item_webtoon_viewer) + @LayoutId(R.layout.item_webtoon_reader) static class ImageViewHolder extends ItemViewHolder { @ViewId(R.id.page_image_view) SubsamplingScaleImageView imageView; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/WebtoonViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java similarity index 90% rename from app/src/main/java/eu/kanade/mangafeed/ui/viewer/WebtoonViewer.java rename to app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java index f146868bc0..f9e0d75cc9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/WebtoonViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java @@ -1,4 +1,4 @@ -package eu.kanade.mangafeed.ui.viewer; +package eu.kanade.mangafeed.ui.reader.viewer.webtoon; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; @@ -8,14 +8,13 @@ import android.widget.FrameLayout; import java.util.List; import eu.kanade.mangafeed.data.models.Page; -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.adapter.WebtoonAdapter; -import eu.kanade.mangafeed.ui.viewer.base.BaseViewer; +import eu.kanade.mangafeed.ui.reader.ReaderActivity; +import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.subjects.PublishSubject; -public class WebtoonViewer extends BaseViewer { +public class WebtoonReader extends BaseReader { private RecyclerView recycler; private LinearLayoutManager layoutManager; @@ -23,7 +22,7 @@ public class WebtoonViewer extends BaseViewer { private List pages; private Subscription subscription; - public WebtoonViewer(ReaderActivity activity, FrameLayout container) { + public WebtoonReader(ReaderActivity activity, FrameLayout container) { super(activity, container); recycler = new RecyclerView(activity); diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/LeftToRightViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/viewer/LeftToRightViewer.java deleted file mode 100644 index 41ef89933b..0000000000 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/LeftToRightViewer.java +++ /dev/null @@ -1,24 +0,0 @@ -package eu.kanade.mangafeed.ui.viewer; - -import android.widget.FrameLayout; - -import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.viewer.base.ViewPagerViewer; - -public class LeftToRightViewer extends ViewPagerViewer { - - public LeftToRightViewer(ReaderActivity activity, FrameLayout container) { - super(activity, container); - } - - @Override - public void onFirstPageOut() { - - } - - @Override - public void onLastPageOut() { - - } - -} diff --git a/app/src/main/res/layout/activity_manga_detail.xml b/app/src/main/res/layout/activity_manga_detail.xml index 423ac4f7b2..5b6c958f6f 100644 --- a/app/src/main/res/layout/activity_manga_detail.xml +++ b/app/src/main/res/layout/activity_manga_detail.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - tools:context="eu.kanade.mangafeed.ui.activity.MangaDetailActivity" + tools:context="eu.kanade.mangafeed.ui.manga.MangaActivity" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:orientation="vertical"> diff --git a/app/src/main/res/layout/fragment_catalogue.xml b/app/src/main/res/layout/fragment_catalogue.xml index d1adda782e..8ffe5e6fb5 100644 --- a/app/src/main/res/layout/fragment_catalogue.xml +++ b/app/src/main/res/layout/fragment_catalogue.xml @@ -5,7 +5,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" - tools:context="eu.kanade.mangafeed.ui.fragment.CatalogueFragment"> + tools:context="eu.kanade.mangafeed.ui.catalogue.CatalogueFragment"> + tools:context="eu.kanade.mangafeed.ui.catalogue.CatalogueFragment"> + tools:context="eu.kanade.mangafeed.ui.catalogue.SourceFragment"> - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/viewer_verticalviewpager.xml b/app/src/main/res/layout/reader_vertical.xml similarity index 62% rename from app/src/main/res/layout/viewer_verticalviewpager.xml rename to app/src/main/res/layout/reader_vertical.xml index 03b3a39897..c9a8f85b40 100644 --- a/app/src/main/res/layout/viewer_verticalviewpager.xml +++ b/app/src/main/res/layout/reader_vertical.xml @@ -1,8 +1,8 @@ - - + diff --git a/app/src/main/res/layout/viewer_webtoon.xml b/app/src/main/res/layout/viewer_webtoon.xml deleted file mode 100644 index 8288a8d683..0000000000 --- a/app/src/main/res/layout/viewer_webtoon.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/menu_manga_detail.xml b/app/src/main/res/menu/menu_manga_detail.xml index 4f27727c03..d00945fdd3 100644 --- a/app/src/main/res/menu/menu_manga_detail.xml +++ b/app/src/main/res/menu/menu_manga_detail.xml @@ -1,7 +1,7 @@ + tools:context="eu.kanade.mangafeed.ui.manga.MangaActivity"> diff --git a/app/src/test/java/eu/kanade/mangafeed/MainActivityTest.java b/app/src/test/java/eu/kanade/mangafeed/MainActivityTest.java index d24bb2dba8..bfb8bd688b 100644 --- a/app/src/test/java/eu/kanade/mangafeed/MainActivityTest.java +++ b/app/src/test/java/eu/kanade/mangafeed/MainActivityTest.java @@ -13,7 +13,7 @@ import org.robolectric.Robolectric; import org.robolectric.RobolectricGradleTestRunner; import org.robolectric.annotation.Config; -import eu.kanade.mangafeed.ui.activity.MainActivity; +import eu.kanade.mangafeed.ui.main.MainActivity; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertTrue;