From 5fe1799dab4a9fae92a2e137e748ec84b20b04fe Mon Sep 17 00:00:00 2001 From: len Date: Sat, 2 Jul 2016 14:12:52 +0200 Subject: [PATCH] Fix #333 --- .../tachiyomi/ui/download/DownloadHolder.kt | 2 +- .../tachiyomi/ui/library/LibraryFragment.kt | 2 +- .../tachiyomi/ui/library/LibraryHolder.kt | 4 - app/src/main/res/layout/item_download.xml | 83 +++++++++---------- 4 files changed, 40 insertions(+), 51 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt index 9d7ab3dff..bdd6d2bce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt @@ -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 diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt index f4849acef..5f14d4eec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt @@ -266,7 +266,7 @@ class LibraryFragment : BaseRxFragment(), 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)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt index 075803220..9cf28ae46 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt @@ -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 diff --git a/app/src/main/res/layout/item_download.xml b/app/src/main/res/layout/item_download.xml index b16d7f07b..2008002f8 100644 --- a/app/src/main/res/layout/item_download.xml +++ b/app/src/main/res/layout/item_download.xml @@ -1,55 +1,48 @@ - + - + + + android:layout_toLeftOf="@id/download_progress_text" + android:layout_alignParentLeft="true" + android:maxLines="1" + android:ellipsize="end" + android:textAppearance="@style/TextAppearance.Regular.Body1" + tools:text="Manga title"/> - - - - - - - - - - - + + android:layout_height="wrap_content" + android:layout_below="@id/chapter_title" + style="?android:attr/progressBarStyleHorizontal"/> - \ No newline at end of file + \ No newline at end of file