mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Delete old BasePresenter
This commit is contained in:
parent
b36aa69a67
commit
1929eea19d
9 changed files with 12 additions and 38 deletions
|
@ -1,9 +1,10 @@
|
||||||
package eu.kanade.mangafeed.presenter;
|
package eu.kanade.mangafeed.presenter;
|
||||||
|
|
||||||
import de.greenrobot.event.EventBus;
|
import de.greenrobot.event.EventBus;
|
||||||
import rx.subscriptions.CompositeSubscription;
|
import nucleus.presenter.RxPresenter;
|
||||||
|
import nucleus.view.ViewWithPresenter;
|
||||||
|
|
||||||
public class BasePresenter {
|
public class BasePresenter<V extends ViewWithPresenter> extends RxPresenter<V> {
|
||||||
|
|
||||||
public void registerForStickyEvents() {
|
public void registerForStickyEvents() {
|
||||||
EventBus.getDefault().registerSticky(this);
|
EventBus.getDefault().registerSticky(this);
|
||||||
|
@ -16,11 +17,4 @@ public class BasePresenter {
|
||||||
public void unregisterForEvents() {
|
public void unregisterForEvents() {
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CompositeSubscription subscriptions = new CompositeSubscription();
|
|
||||||
|
|
||||||
public void destroySubscriptions() {
|
|
||||||
subscriptions.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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<V extends ViewWithPresenter> extends RxPresenter<V> {
|
|
||||||
|
|
||||||
public void registerForStickyEvents() {
|
|
||||||
EventBus.getDefault().registerSticky(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void registerForEvents() {
|
|
||||||
EventBus.getDefault().register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void unregisterForEvents() {
|
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@ import rx.android.schedulers.AndroidSchedulers;
|
||||||
import rx.schedulers.Schedulers;
|
import rx.schedulers.Schedulers;
|
||||||
import uk.co.ribot.easyadapter.EasyAdapter;
|
import uk.co.ribot.easyadapter.EasyAdapter;
|
||||||
|
|
||||||
public class LibraryPresenter extends BasePresenter2<LibraryFragment> {
|
public class LibraryPresenter extends BasePresenter<LibraryFragment> {
|
||||||
|
|
||||||
@Inject DatabaseHelper db;
|
@Inject DatabaseHelper db;
|
||||||
@Inject PreferencesHelper prefs;
|
@Inject PreferencesHelper prefs;
|
||||||
|
|
|
@ -2,6 +2,6 @@ package eu.kanade.mangafeed.presenter;
|
||||||
|
|
||||||
import eu.kanade.mangafeed.ui.activity.MangaCatalogueActivity;
|
import eu.kanade.mangafeed.ui.activity.MangaCatalogueActivity;
|
||||||
|
|
||||||
public class MangaCataloguePresenter extends BasePresenter2<MangaCatalogueActivity> {
|
public class MangaCataloguePresenter extends BasePresenter<MangaCatalogueActivity> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,5 @@ package eu.kanade.mangafeed.presenter;
|
||||||
|
|
||||||
import eu.kanade.mangafeed.ui.fragment.MangaChaptersFragment;
|
import eu.kanade.mangafeed.ui.fragment.MangaChaptersFragment;
|
||||||
|
|
||||||
public class MangaChaptersPresenter extends BasePresenter2<MangaChaptersFragment> {
|
public class MangaChaptersPresenter extends BasePresenter<MangaChaptersFragment> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import eu.kanade.mangafeed.data.models.Manga;
|
||||||
import eu.kanade.mangafeed.ui.activity.MangaDetailActivity;
|
import eu.kanade.mangafeed.ui.activity.MangaDetailActivity;
|
||||||
import eu.kanade.mangafeed.view.MangaDetailView;
|
import eu.kanade.mangafeed.view.MangaDetailView;
|
||||||
|
|
||||||
public class MangaDetailPresenter extends BasePresenter2<MangaDetailActivity> {
|
public class MangaDetailPresenter extends BasePresenter<MangaDetailActivity> {
|
||||||
|
|
||||||
private MangaDetailView view;
|
private MangaDetailView view;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import rx.Observable;
|
||||||
import rx.Subscription;
|
import rx.Subscription;
|
||||||
import rx.android.schedulers.AndroidSchedulers;
|
import rx.android.schedulers.AndroidSchedulers;
|
||||||
|
|
||||||
public class MangaInfoPresenter extends BasePresenter2<MangaInfoFragment> {
|
public class MangaInfoPresenter extends BasePresenter<MangaInfoFragment> {
|
||||||
|
|
||||||
@Inject DatabaseHelper db;
|
@Inject DatabaseHelper db;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import eu.kanade.mangafeed.sources.Source;
|
||||||
import eu.kanade.mangafeed.ui.fragment.SourceFragment;
|
import eu.kanade.mangafeed.ui.fragment.SourceFragment;
|
||||||
|
|
||||||
|
|
||||||
public class SourcePresenter extends BasePresenter2<SourceFragment> {
|
public class SourcePresenter extends BasePresenter<SourceFragment> {
|
||||||
|
|
||||||
@Inject SourceManager sourceManager;
|
@Inject SourceManager sourceManager;
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,13 @@ import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
|
||||||
import butterknife.Bind;
|
import butterknife.Bind;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import eu.kanade.mangafeed.R;
|
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.LibraryFragment;
|
||||||
import eu.kanade.mangafeed.ui.fragment.SourceFragment;
|
import eu.kanade.mangafeed.ui.fragment.SourceFragment;
|
||||||
import nucleus.factory.RequiresPresenter;
|
import nucleus.factory.RequiresPresenter;
|
||||||
|
|
||||||
@RequiresPresenter(BasePresenter2.class)
|
@RequiresPresenter(BasePresenter.class)
|
||||||
public class MainActivity extends BaseActivity<BasePresenter2> {
|
public class MainActivity extends BaseActivity<BasePresenter> {
|
||||||
|
|
||||||
@Bind(R.id.toolbar)
|
@Bind(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
|
Loading…
Reference in a new issue