diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d4d21efea..832fda076 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 2e316420d..0ce9bb8f7 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 2e5441ab2..0c5f059cf 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 7c7515bda..2c96fab89 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 de0a65641..671242c3f 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 3f87ade20..a1bad5cc5 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 ce0bbb6ce..f5116d242 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 6225e0527..736cb2590 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 8843eb0fa..94526c0f6 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 cd893b9d7..8dd19aaa4 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 77bd90a9f..7338340ca 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 8324bd2c4..67e38db55 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 6cf11ad9e..5fac134d6 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 3ae59472d..fc9a13a2f 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 92aebe0fc..66fea77bd 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 6a755206b..e025018b7 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 c80897944..b7f8c5343 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 4cb0383cd..4c5026882 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 94ae24872..347928f0e 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 096736ff4..d807331d8 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 f09ffb289..35288e2ca 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 9b5f86bc7..ca9660ff0 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 0b96c2052..0c6dc9fea 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 5e7e3c751..f5b96e817 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 3699c2cda..56d53752c 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 115f37bf9..08333361d 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 cb4642993..8f429f572 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 0b624a262..04d5d77e8 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 c5ee5923d..1a88a78a0 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 36887fb68..4670e8056 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 38ef584e4..85739d0c9 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 1035bca87..a2c5e7ee6 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 4e5e21dbf..abbb6c185 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 538c130e1..908fac845 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 5054f0b26..e6df4abc0 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 000000000..f2cc87ecb
--- /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 feca69e24..3717e0d5e 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 190046746..c176014d7 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 000000000..a263a867e
--- /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 7e0b40324..5e0894922 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 f146868bc..f9e0d75cc 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 41ef89933..000000000
--- 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 423ac4f7b..5b6c958f6 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 d1adda782..8ffe5e6fb 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 03b3a3989..c9a8f85b4 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 8288a8d68..000000000
--- 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 4f27727c0..d00945fdd 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 @@
diff --git a/app/src/test/java/eu/kanade/mangafeed/MainActivityTest.java b/app/src/test/java/eu/kanade/mangafeed/MainActivityTest.java
index d24bb2dba..bfb8bd688 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;