MangaSummaryView: Fix incomplete description on tablet ui (#6518)

(cherry picked from commit cf5e60f8eb)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
This commit is contained in:
Ivan Iskandar
2022-01-30 22:47:53 +07:00
committed by Jobobby04
parent efe70499ac
commit 3c216e0cb9
2 changed files with 9 additions and 4 deletions
@@ -362,8 +362,6 @@ class MangaInfoHeaderAdapter(
binding.mangaCover.loadAnyAutoPause(manga)
// Manga info section
binding.mangaSummarySection.isVisible = !manga.description.isNullOrBlank() || !manga.genre.isNullOrBlank()
binding.mangaSummarySection.description = manga.description
// SY -->
binding.mangaSummarySection.setTags(
manga.getGenres(),
@@ -373,6 +371,8 @@ class MangaInfoHeaderAdapter(
source
)
// SY <--
binding.mangaSummarySection.description = manga.description
binding.mangaSummarySection.isVisible = !manga.description.isNullOrBlank() || !manga.genre.isNullOrBlank()
}
/**
@@ -72,7 +72,9 @@ class MangaSummaryView @JvmOverloads constructor(
doOnNextLayout {
updateExpandState()
}
requestLayout()
if (!isInLayout) {
requestLayout()
}
}
}
@@ -239,7 +241,10 @@ class MangaSummaryView @JvmOverloads constructor(
// SY <--
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
if (!recalculateHeights) {
// Wait until parent view has determined the exact width
// because this affect the description line count
val measureWidthFreely = MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY
if (!recalculateHeights || measureWidthFreely) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
return
}