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

(cherry picked from commit cf5e60f8ebb417985e7ae635dcc3e06fea3d6c8c)

# 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

View File

@ -362,8 +362,6 @@ class MangaInfoHeaderAdapter(
binding.mangaCover.loadAnyAutoPause(manga) binding.mangaCover.loadAnyAutoPause(manga)
// Manga info section // Manga info section
binding.mangaSummarySection.isVisible = !manga.description.isNullOrBlank() || !manga.genre.isNullOrBlank()
binding.mangaSummarySection.description = manga.description
// SY --> // SY -->
binding.mangaSummarySection.setTags( binding.mangaSummarySection.setTags(
manga.getGenres(), manga.getGenres(),
@ -373,6 +371,8 @@ class MangaInfoHeaderAdapter(
source source
) )
// SY <-- // SY <--
binding.mangaSummarySection.description = manga.description
binding.mangaSummarySection.isVisible = !manga.description.isNullOrBlank() || !manga.genre.isNullOrBlank()
} }
/** /**

View File

@ -72,7 +72,9 @@ class MangaSummaryView @JvmOverloads constructor(
doOnNextLayout { doOnNextLayout {
updateExpandState() updateExpandState()
} }
requestLayout() if (!isInLayout) {
requestLayout()
}
} }
} }
@ -239,7 +241,10 @@ class MangaSummaryView @JvmOverloads constructor(
// SY <-- // SY <--
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { 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) super.onMeasure(widthMeasureSpec, heightMeasureSpec)
return return
} }