mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-18 23:39:16 +01:00
Delete old BasePresenter
This commit is contained in:
parent
b36aa69a67
commit
1929eea19d
@ -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<V extends ViewWithPresenter> extends RxPresenter<V> {
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 uk.co.ribot.easyadapter.EasyAdapter;
|
||||
|
||||
public class LibraryPresenter extends BasePresenter2<LibraryFragment> {
|
||||
public class LibraryPresenter extends BasePresenter<LibraryFragment> {
|
||||
|
||||
@Inject DatabaseHelper db;
|
||||
@Inject PreferencesHelper prefs;
|
||||
|
@ -2,6 +2,6 @@ package eu.kanade.mangafeed.presenter;
|
||||
|
||||
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;
|
||||
|
||||
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.view.MangaDetailView;
|
||||
|
||||
public class MangaDetailPresenter extends BasePresenter2<MangaDetailActivity> {
|
||||
public class MangaDetailPresenter extends BasePresenter<MangaDetailActivity> {
|
||||
|
||||
private MangaDetailView view;
|
||||
|
||||
|
@ -8,7 +8,7 @@ import rx.Observable;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
|
||||
public class MangaInfoPresenter extends BasePresenter2<MangaInfoFragment> {
|
||||
public class MangaInfoPresenter extends BasePresenter<MangaInfoFragment> {
|
||||
|
||||
@Inject DatabaseHelper db;
|
||||
|
||||
|
@ -7,7 +7,7 @@ import eu.kanade.mangafeed.sources.Source;
|
||||
import eu.kanade.mangafeed.ui.fragment.SourceFragment;
|
||||
|
||||
|
||||
public class SourcePresenter extends BasePresenter2<SourceFragment> {
|
||||
public class SourcePresenter extends BasePresenter<SourceFragment> {
|
||||
|
||||
@Inject SourceManager sourceManager;
|
||||
|
||||
|
@ -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<BasePresenter2> {
|
||||
@RequiresPresenter(BasePresenter.class)
|
||||
public class MainActivity extends BaseActivity<BasePresenter> {
|
||||
|
||||
@Bind(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
|
Loading…
Reference in New Issue
Block a user