Upgrade to EventBus 3
This commit is contained in:
@@ -5,7 +5,8 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import icepick.Icepick;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
@@ -58,20 +59,8 @@ public class BaseActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public void registerForStickyEvents() {
|
||||
registerForStickyEvents(0);
|
||||
}
|
||||
|
||||
public void registerForStickyEvents(int priority) {
|
||||
EventBus.getDefault().registerSticky(this, priority);
|
||||
}
|
||||
|
||||
public void registerForEvents() {
|
||||
registerForEvents(0);
|
||||
}
|
||||
|
||||
public void registerForEvents(int priority) {
|
||||
EventBus.getDefault().register(this, priority);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
public void unregisterForEvents() {
|
||||
|
||||
@@ -3,7 +3,8 @@ package eu.kanade.tachiyomi.ui.base.fragment;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity;
|
||||
import icepick.Icepick;
|
||||
|
||||
@@ -33,20 +34,8 @@ public class BaseFragment extends Fragment {
|
||||
return (BaseActivity) getActivity();
|
||||
}
|
||||
|
||||
public void registerForStickyEvents() {
|
||||
registerForStickyEvents(0);
|
||||
}
|
||||
|
||||
public void registerForStickyEvents(int priority) {
|
||||
EventBus.getDefault().registerSticky(this, priority);
|
||||
}
|
||||
|
||||
public void registerForEvents() {
|
||||
registerForEvents(0);
|
||||
}
|
||||
|
||||
public void registerForEvents(int priority) {
|
||||
EventBus.getDefault().register(this, priority);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
public void unregisterForEvents() {
|
||||
|
||||
@@ -4,7 +4,8 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import icepick.Icepick;
|
||||
import nucleus.view.ViewWithPresenter;
|
||||
|
||||
@@ -24,10 +25,6 @@ public class BasePresenter<V extends ViewWithPresenter> extends RxPresenter<V> {
|
||||
Icepick.saveInstanceState(this, state);
|
||||
}
|
||||
|
||||
public void registerForStickyEvents() {
|
||||
EventBus.getDefault().registerSticky(this);
|
||||
}
|
||||
|
||||
public void registerForEvents() {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user