Show chapter count

This commit is contained in:
inorichi
2015-10-19 17:27:41 +02:00
parent 9ad6efbada
commit 0c77a7034a
6 changed files with 71 additions and 17 deletions
@@ -27,7 +27,7 @@ import uk.co.ribot.easyadapter.EasyRecyclerAdapter;
public class MangaChaptersFragment extends BaseFragment<MangaChaptersPresenter> {
@Bind(R.id.chapter_list) RecyclerView chapters;
@Bind(R.id.swipe_refresh) SwipeRefreshLayout swipe_refresh;
@Bind(R.id.swipe_refresh) SwipeRefreshLayout swipeRefresh;
private EasyRecyclerAdapter<Chapter> adapter;
@@ -77,7 +77,7 @@ public class MangaChaptersFragment extends BaseFragment<MangaChaptersPresenter>
}
private void setSwipeRefreshListener() {
swipe_refresh.setOnRefreshListener(() -> getPresenter().refreshChapters(this));
swipeRefresh.setOnRefreshListener(() -> getPresenter().refreshChapters(this));
}
public void onNextChapters(List<Chapter> chapters) {
@@ -85,10 +85,10 @@ public class MangaChaptersFragment extends BaseFragment<MangaChaptersPresenter>
}
public void onNextOnlineChapters() {
swipe_refresh.setRefreshing(false);
swipeRefresh.setRefreshing(false);
}
public void setSwipeRefreshing() {
swipe_refresh.setRefreshing(true);
swipeRefresh.setRefreshing(true);
}
}
@@ -50,7 +50,6 @@ public class MangaInfoFragment extends BaseFragment<MangaInfoPresenter> {
public void setMangaInfo(Manga manga) {
mArtist.setText(manga.artist);
mAuthor.setText(manga.author);
mChapters.setText("0"); // TODO
mGenres.setText(manga.genre);
mStatus.setText("Ongoing"); //TODO
mDescription.setText(manga.description);
@@ -61,4 +60,8 @@ public class MangaInfoFragment extends BaseFragment<MangaInfoPresenter> {
.centerCrop()
.into(mCover);
}
public void setChapterCount(int count) {
mChapters.setText(String.valueOf(count));
}
}