extends NucleusAppCompatActivity<
protected void setupToolbar(Toolbar toolbar) {
setSupportActionBar(toolbar);
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ if (getSupportActionBar() != null)
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
public void setToolbarTitle(String title) {
- getSupportActionBar().setTitle(title);
+ if (getSupportActionBar() != null)
+ getSupportActionBar().setTitle(title);
+ }
+
+ public void setToolbarTitle(int titleResource) {
+ if (getSupportActionBar() != null)
+ getSupportActionBar().setTitle(getString(titleResource));
}
public Context getActivity() {
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 13e46ab0c4..208fe513c3 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
@@ -82,7 +82,7 @@ public class MainActivity extends BaseActivity extends NucleusSupportFragment
super.onCreate(savedInstanceState);
}
+ public void setToolbarTitle(String title) {
+ ((BaseActivity)getActivity()).setToolbarTitle(title);
+ }
+
+ public void setToolbarTitle(int resourceId) {
+ ((BaseActivity)getActivity()).setToolbarTitle(getString(resourceId));
+ }
+
}
\ No newline at end of file
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/activity/CatalogueActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/fragment/CatalogueFragment.java
similarity index 77%
rename from app/src/main/java/eu/kanade/mangafeed/ui/activity/CatalogueActivity.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/fragment/CatalogueFragment.java
index 52a82422da..348a388ab7 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/activity/CatalogueActivity.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/fragment/CatalogueFragment.java
@@ -1,13 +1,14 @@
-package eu.kanade.mangafeed.ui.activity;
+package eu.kanade.mangafeed.ui.fragment;
-import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
-import android.support.v7.widget.Toolbar;
+import android.view.LayoutInflater;
import android.view.Menu;
+import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ProgressBar;
@@ -22,6 +23,7 @@ import butterknife.OnItemClick;
import eu.kanade.mangafeed.R;
import eu.kanade.mangafeed.data.models.Manga;
import eu.kanade.mangafeed.presenter.CataloguePresenter;
+import eu.kanade.mangafeed.ui.activity.MangaDetailActivity;
import eu.kanade.mangafeed.ui.adapter.CatalogueHolder;
import eu.kanade.mangafeed.util.PageBundle;
import eu.kanade.mangafeed.widget.EndlessScrollListener;
@@ -29,10 +31,7 @@ import nucleus.factory.RequiresPresenter;
import uk.co.ribot.easyadapter.EasyAdapter;
@RequiresPresenter(CataloguePresenter.class)
-public class CatalogueActivity extends BaseActivity