Show download status in chapters fragment
This commit is contained in:
@@ -5,6 +5,8 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
protected void setupToolbar(Toolbar toolbar) {
|
||||
@@ -47,4 +49,16 @@ public class BaseActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public void registerForStickyEvents() {
|
||||
EventBus.getDefault().registerSticky(this);
|
||||
}
|
||||
|
||||
public void registerForEvents() {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
public void unregisterForEvents() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package eu.kanade.mangafeed.ui.base.fragment;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import eu.kanade.mangafeed.ui.base.activity.BaseActivity;
|
||||
|
||||
public class BaseFragment extends Fragment {
|
||||
@@ -18,4 +19,16 @@ public class BaseFragment extends Fragment {
|
||||
return (BaseActivity) getActivity();
|
||||
}
|
||||
|
||||
public void registerForStickyEvents() {
|
||||
EventBus.getDefault().registerSticky(this);
|
||||
}
|
||||
|
||||
public void registerForEvents() {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
public void unregisterForEvents() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user