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 this.download = download
// Update the chapter name. // Update the chapter name.
view.download_title.text = download.chapter.name view.chapter_title.text = download.chapter.name
// Update the manga title // Update the manga title
view.manga_title.text = download.manga.title view.manga_title.text = download.manga.title

View file

@ -266,7 +266,7 @@ class LibraryFragment : BaseRxFragment<LibraryPresenter>(), ActionMode.Callback
// Restore active category. // Restore active category.
view_pager.setCurrentItem(activeCat, false) view_pager.setCurrentItem(activeCat, false)
// Delay the scroll position to allow the view to be properly measured. // 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. // Send the manga map to child fragments after the adapter is updated.
presenter.libraryMangaSubject.onNext(LibraryMangaEvent(mangaMap)) presenter.libraryMangaSubject.onNext(LibraryMangaEvent(mangaMap))

View file

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

View file

@ -1,55 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout
android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" xmlns:tools="http://schemas.android.com/tools"
android:layout_marginLeft="15dp" android:layout_width="match_parent"
android:layout_marginRight="15dp" android:layout_height="wrap_content"
android:orientation="vertical"> android:paddingLeft="@dimen/material_layout_keylines_screen_edge_margin"
android:paddingRight="@dimen/material_layout_keylines_screen_edge_margin"
android:paddingTop="@dimen/material_component_lists_padding_above_list">
<LinearLayout <TextView
android:id="@+id/download_progress_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Regular.Caption.Hint"
tools:text="(0/10)"/>
<TextView
android:id="@+id/manga_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_toLeftOf="@id/download_progress_text"
android:orientation="horizontal"> android:layout_alignParentLeft="true"
android:maxLines="1"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.Regular.Body1"
tools:text="Manga title"/>
<LinearLayout <TextView
android:layout_width="wrap_content" android:id="@+id/chapter_title"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:orientation="vertical"> android:layout_height="wrap_content"
<TextView android:layout_below="@id/manga_title"
android:id="@+id/manga_title" android:maxLines="1"
android:layout_width="wrap_content" android:ellipsize="end"
android:layout_height="wrap_content" tools:text="Chapter Title"
android:text="Manga Title" android:textAppearance="@style/TextAppearance.Regular.Caption"/>
android:textAppearance="@style/TextAppearance.Regular.Body1"/>
<TextView
android:id="@+id/download_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chapter Title"
android:textAppearance="@style/TextAppearance.Regular.Caption"/>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/download_progress_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:textAppearance="@style/TextAppearance.Regular.Caption.Hint"
android:text="(0/10)"/>
</LinearLayout>
<ProgressBar <ProgressBar
android:id="@+id/download_progress" android:id="@+id/download_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:layout_below="@id/chapter_title"
style="?android:attr/progressBarStyleHorizontal"/>
</LinearLayout> </RelativeLayout>