From 1929eea19d3f0009a7269a32a3c50e3377484530 Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 17 Oct 2015 16:33:29 +0200 Subject: [PATCH] Delete old BasePresenter --- .../mangafeed/presenter/BasePresenter.java | 12 +++-------- .../mangafeed/presenter/BasePresenter2.java | 20 ------------------- .../mangafeed/presenter/LibraryPresenter.java | 2 +- .../presenter/MangaCataloguePresenter.java | 2 +- .../presenter/MangaChaptersPresenter.java | 2 +- .../presenter/MangaDetailPresenter.java | 2 +- .../presenter/MangaInfoPresenter.java | 2 +- .../mangafeed/presenter/SourcePresenter.java | 2 +- .../mangafeed/ui/activity/MainActivity.java | 6 +++--- 9 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter2.java diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter.java index 615543d8ac..6cacb8dd8e 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter.java @@ -1,9 +1,10 @@ package eu.kanade.mangafeed.presenter; import de.greenrobot.event.EventBus; -import rx.subscriptions.CompositeSubscription; +import nucleus.presenter.RxPresenter; +import nucleus.view.ViewWithPresenter; -public class BasePresenter { +public class BasePresenter extends RxPresenter { public void registerForStickyEvents() { EventBus.getDefault().registerSticky(this); @@ -16,11 +17,4 @@ public class BasePresenter { public void unregisterForEvents() { EventBus.getDefault().unregister(this); } - - protected CompositeSubscription subscriptions = new CompositeSubscription(); - - public void destroySubscriptions() { - subscriptions.unsubscribe(); - } - } diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter2.java b/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter2.java deleted file mode 100644 index c862dbf627..0000000000 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/BasePresenter2.java +++ /dev/null @@ -1,20 +0,0 @@ -package eu.kanade.mangafeed.presenter; - -import de.greenrobot.event.EventBus; -import nucleus.presenter.RxPresenter; -import nucleus.view.ViewWithPresenter; - -public class BasePresenter2 extends RxPresenter { - - public void registerForStickyEvents() { - EventBus.getDefault().registerSticky(this); - } - - public void registerForEvents() { - EventBus.getDefault().register(this); - } - - public void unregisterForEvents() { - EventBus.getDefault().unregister(this); - } -} diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java index 2b1dd9df6e..213cd9ecb2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java @@ -15,7 +15,7 @@ import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; import uk.co.ribot.easyadapter.EasyAdapter; -public class LibraryPresenter extends BasePresenter2 { +public class LibraryPresenter extends BasePresenter { @Inject DatabaseHelper db; @Inject PreferencesHelper prefs; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaCataloguePresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaCataloguePresenter.java index 0cccaaaa26..72141b24cb 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaCataloguePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaCataloguePresenter.java @@ -2,6 +2,6 @@ package eu.kanade.mangafeed.presenter; import eu.kanade.mangafeed.ui.activity.MangaCatalogueActivity; -public class MangaCataloguePresenter extends BasePresenter2 { +public class MangaCataloguePresenter extends BasePresenter { } diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java index 2545a1b409..5e3de9e6db 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java @@ -2,5 +2,5 @@ package eu.kanade.mangafeed.presenter; import eu.kanade.mangafeed.ui.fragment.MangaChaptersFragment; -public class MangaChaptersPresenter extends BasePresenter2 { +public class MangaChaptersPresenter extends BasePresenter { } diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java index 95c406df0a..0833f067da 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaDetailPresenter.java @@ -7,7 +7,7 @@ import eu.kanade.mangafeed.data.models.Manga; import eu.kanade.mangafeed.ui.activity.MangaDetailActivity; import eu.kanade.mangafeed.view.MangaDetailView; -public class MangaDetailPresenter extends BasePresenter2 { +public class MangaDetailPresenter extends BasePresenter { private MangaDetailView view; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java index 5c2588a8d7..7913925da9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java @@ -8,7 +8,7 @@ import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; -public class MangaInfoPresenter extends BasePresenter2 { +public class MangaInfoPresenter extends BasePresenter { @Inject DatabaseHelper db; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java index baa4e05240..7a267392ae 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/SourcePresenter.java @@ -7,7 +7,7 @@ import eu.kanade.mangafeed.sources.Source; import eu.kanade.mangafeed.ui.fragment.SourceFragment; -public class SourcePresenter extends BasePresenter2 { +public class SourcePresenter extends BasePresenter { @Inject SourceManager sourceManager; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java index d36973c960..72ec067211 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/activity/MainActivity.java @@ -13,13 +13,13 @@ import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.mangafeed.R; -import eu.kanade.mangafeed.presenter.BasePresenter2; +import eu.kanade.mangafeed.presenter.BasePresenter; import eu.kanade.mangafeed.ui.fragment.LibraryFragment; import eu.kanade.mangafeed.ui.fragment.SourceFragment; import nucleus.factory.RequiresPresenter; -@RequiresPresenter(BasePresenter2.class) -public class MainActivity extends BaseActivity { +@RequiresPresenter(BasePresenter.class) +public class MainActivity extends BaseActivity { @Bind(R.id.toolbar) Toolbar toolbar;