diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt
index 46c60707e3..a9a8b40a1a 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt
@@ -515,6 +515,9 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) :
fetchChaptersFromSource()
}
+ val header = headerAdapter ?: return
+ header.setNumChapters(chapters.size)
+
val adapter = chaptersAdapter ?: return
adapter.updateDataSet(chapters)
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoHeaderAdapter.kt
index d270cf979a..5c6eecc8a2 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoHeaderAdapter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoHeaderAdapter.kt
@@ -41,6 +41,7 @@ class MangaInfoHeaderAdapter(
private var manga: Manga? = null
private var source: Source? = null
+ private var numChapters: Int? = null
private val scope = CoroutineScope(Job() + Dispatchers.Main)
private lateinit var binding: MangaInfoHeaderBinding
@@ -71,6 +72,12 @@ class MangaInfoHeaderAdapter(
notifyDataSetChanged()
}
+ fun setNumChapters(numChapters: Int) {
+ this.numChapters = numChapters
+
+ notifyDataSetChanged()
+ }
+
inner class HeaderViewHolder(private val view: View) : RecyclerView.ViewHolder(view) {
fun bind() {
if (manga == null) {
@@ -155,6 +162,7 @@ class MangaInfoHeaderAdapter(
.launchIn(scope)
setMangaInfo(manga!!, source)
+ setChapterInfo()
}
/**
@@ -316,5 +324,14 @@ class MangaInfoHeaderAdapter(
isChecked = isFavorite
}
}
+
+ private fun setChapterInfo() {
+ // Chapters heading
+ binding.chaptersLabel.text = if (numChapters == null) {
+ view.context.getString(R.string.chapters)
+ } else {
+ view.context.resources.getQuantityString(R.plurals.manga_num_chapters, numChapters!!, numChapters)
+ }
+ }
}
}
diff --git a/app/src/main/res/layout-land/manga_info_header.xml b/app/src/main/res/layout-land/manga_info_header.xml
index ea6a7842f7..1bc76b04c3 100644
--- a/app/src/main/res/layout-land/manga_info_header.xml
+++ b/app/src/main/res/layout-land/manga_info_header.xml
@@ -1,38 +1,36 @@
-
-
+
-
+
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:padding="16dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/manga_cover"
+ app:layout_constraintTop_toTopOf="parent">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/manga_info_header.xml b/app/src/main/res/layout/manga_info_header.xml
index 17d864487d..d7f8e45dc4 100644
--- a/app/src/main/res/layout/manga_info_header.xml
+++ b/app/src/main/res/layout/manga_info_header.xml
@@ -5,7 +5,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:paddingBottom="8dp"
tools:context=".ui.browse.source.browse.BrowseSourceController">
+ app:layout_constraintGuide_percent="0.33" />
+
+
+
+
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 779ae9be0f..13cac05c9c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -463,6 +463,11 @@
About
Show more info
Show less info
+
+ - No chapters
+ - 1 chapter
+ - %1$s chapters
+
Delete downloaded chapters?
Copied to clipboard:\n%1$s
Source not installed: %1$s