This commit is contained in:
len
2016-07-02 14:12:52 +02:00
parent ce7118084a
commit 5fe1799dab
4 changed files with 40 additions and 51 deletions

View File

@ -26,7 +26,7 @@ class DownloadHolder(private val view: View) : RecyclerView.ViewHolder(view) {
this.download = download
// Update the chapter name.
view.download_title.text = download.chapter.name
view.chapter_title.text = download.chapter.name
// Update the manga title
view.manga_title.text = download.manga.title

View File

@ -266,7 +266,7 @@ class LibraryFragment : BaseRxFragment<LibraryPresenter>(), ActionMode.Callback
// Restore active category.
view_pager.setCurrentItem(activeCat, false)
// Delay the scroll position to allow the view to be properly measured.
view_pager.post { tabs.setScrollPosition(view_pager.currentItem, 0f, true) }
view_pager.post { if (isAdded) tabs.setScrollPosition(view_pager.currentItem, 0f, true) }
// Send the manga map to child fragments after the adapter is updated.
presenter.libraryMangaSubject.onNext(LibraryMangaEvent(mangaMap))

View File

@ -21,8 +21,6 @@ class LibraryHolder(private val view: View,
listener: FlexibleViewHolder.OnListItemClickListener)
: FlexibleViewHolder(view, adapter, listener) {
private var manga: Manga? = null
/**
* Method called from [LibraryCategoryAdapter.onBindViewHolder]. It updates the data for this
* holder with the given manga.
@ -30,8 +28,6 @@ class LibraryHolder(private val view: View,
* @param manga the manga to bind.
*/
fun onSetValues(manga: Manga) {
this.manga = manga
// Update the title of the manga.
view.title.text = manga.title